How A Tiny Relay Became A USB Swiss Army Knife

Multifunctional USB controlled PCB on blue background

Meet the little board that could: [alcor6502]’s tiny USB relay controller, now evolved into a multifunction marvel. Originally built as a simple USB relay to probe the boundaries of JLCPCB’s production chops, it has become a compact utility belt for any hacker’s desk drawer. Not only has [alcor6502] actually built the thing, he even provided instructions. If you happened to be at Hackaday in Berlin, you now might even own one, as he handed out twenty of them during his visit. If not, read on and build it yourself.

This thing is not just a relay, and that is what makes it special. Depending on a few solder bridges and minimal components, it shape-shifts into six different tools: a fan controller (both 3- and 4-pin!), servo driver, UART interface, and of course, the classic relay. It even swaps out a crystal oscillator for USB self-sync using STM32F042‘s internal RC – no quartz, less cost, same precision. A dual-purpose BOOT0 button lets you flash firmware and toggle outputs, depending on timing. Clever reuse, just like our mothers taught us.

It’s the kind of design that makes you want to tinker again. Fewer parts. More function. And that little smile when it just works. If this kind of clever compactness excites you too, read [alcor6502]’s build log and instructions here.

17 thoughts on “How A Tiny Relay Became A USB Swiss Army Knife

  1. I wouldn’t call it multifunction device so much as call it multipurpose PCB. The reason being that in order to switch between functions, you must bridge or remove a particular set of components. Unless you like soldering really small things a lot, you’re not going to be switching between functions but rather have multiple PCBs that are built to act as different devices.

    It’s the difference between pushing a button to retract the roof of your car versus getting out some wrenches and a manual to carefully remove the roof of your car.

    1. I see what you mean after I studied the underside of the PCB. Yeah shorting solder pads to achieve a certain function makes it single use, unless you care to fire up the good old solder iron and desoldering pump.

      Jumpers would have been more appropriate, but make it bulkier. I am still extremely impressed and would want one. A watch dog to power cycler a tiny SBC server is always nice. My ultimate dream would be though a revolver style magazine to swap micro SD cards on an SBC server.

      I know network boot would be easier, but how many SBC servers am I going to run for that and what if both hang one time? Okay enough yapping from me ;)

    1. Actually, I had a lot of help from ChatGPT. When I told the AI it would be published on Hackaday, it went really hyperbolic — you should’ve seen the first draft! 😄 It took quite a bit of manual editing to bring it back down to Earth. But hey, being Italian, we have a saying: “Ogni scarrafone è bello a mamma sua!” — which roughly means “Every cockroach is beautiful to its mother.” In other words, I might be a little biased about my project!

      1. The closest English expression is probably “A face only a mother could love.” Which is somehow even meaner, but at least avoids the implicit comparison to blattella germanica (or any of the other common species).

    1. USB Command Interface
      The firmware uses USB CDC (Virtual COM Port) to communicate via serial commands; accepts structured ASCII commands (easy to use in Bash, Shell and Serial Terminal).

      Example Commands (Send via Terminal/Script)

      Command Function
      #S1! Switch ON relay
      #P3! Pulse relay for 300ms
      #F90! Fan at 90% PWM
      #W40! Load controlled with a PWM signal at 40% (B4 or B5 Closed)
      #A75! Servo motor positioned at 0°
      #Z15000! Set the PWM frequency at 15 KHz
      #I! Transmit on the USB the input pin state
      #T! Transmit on the USB the fan RPM
      #O! Transmit on the USB the PWM percentage of the output

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.