USB Controlled Relay

As noted in my look at the ScreenBar. Not being able to control the light from my PC was one of the downsides. Since then I’ve got to some Elgato Key Lights. Since I spend an increasing amount of time on video calls. This moved lack of USB control from a minor point to something a little more annoying. That prompted me to go look for a solution. USB relays do seem to be a thing. Which gave me an idea.

The plan was to use the relay to switch a USB extension which is connected to the ScreenBar.


The USB Cable with Switch just seemed like the simplest solution to attach to the relay. I went for the splitter cable so I can run the whole thing from a single port.

The first thing to do was crack open the switch, then really all that was left was to wire in the terminals on the relay and connect all the cables. All very straight forward on the hardware side.

USB switch internals

On the software side the instructions were quite minimal:
USB switch the default communication baud rate: 9600 BPS
USB switch communication protocol
Data (1) - startup logo (the default is 0 xA0)
Data (2) - switch address code (the default is 0 x01, identifies the first switch)
Data (3) - operation data (0 x00 to "off", 0 x01 to "on")
Data (4) - check code
For example:
Open the USB switch:A0 01 01 A2
Close the USB switch: A0 01 00 A1

Some of the comment were more helpful and gave a better starting point for the code. I knocked up a little script and now have a software controlled ScreenBar.


I expect a Stream Deck will be in my future to complete my setup.

Author: Zoe

A recovering games coder.