John Wargo's Chunky Desktop USB Switch Means Never Having to Yank a Cable Again

With two USB sockets wired via a physical switch, taking control of a microcontroller's power is just a finger poke away.

Gareth Halfacree
3 months ago β€’ 3D Printing / HW101

Software developer and maker John Wargo has built a pleasingly-chunky device with only one job to do: make it easy to cut the power to a USB device with the flip of a switch.

"In my spare time, I do a lot of software development on Microcontrollers and platforms (Arduino, Raspberry Pi, [Espressif] ESP32, Particle, etc.)," Wargo explains. "During testing of apps (or sketches) for these devices, I often find myself unplugging the USB cable from my computer to deal with a specific issues in my code. For example, sometimes my code for an ESP32 device panics the device and it reboots repeatedly. Rather than let the device continually reboot while I figure out what went wrong, I disconnect the USB cable while I stare at my code for a while until I find the solution."

Tired of constantly pulling and reconnecting cables, Wargo looked for a solution β€” and found USB power switches. "They were all inline versions," he explains of the reason off-the-shelf solutions were rejected, "with the switch wired into the middle of a cable. Based on the position of my development computer, any cable-based device like that would pull a small microcontroller project off my desk and put the switch below the level of the desk."

Instead, Wargo built his own desktop switch β€” chunky enough to stay put yet providing the same flick-switch power control as the in-line versions. Housed in an off-the-shelf enclosure with a 3D-printed front panel, the USB switch is simple enough: a pair of USB 3.0 Type-A panel-mount sockets on breakout boards are wired together on all pins β€” except for power and a second ground, which go instead to a double-pole single-throw (DPST) power switch mounted between them.

"Connect a USB-A to USB-A cable between your computer system and the Input port on the switch. Next, connect a USB cable between the Output port on the switch and an external device," Wargo writes of the gadget's usage. "When you turn the switch on, the device should power up. With the device powered on via the switch, you can deploy code to the device and interact with it from the computer system like you would with a normal USB cable."

Full instructions are available, along with 3D print files for the faceplate, on Instructables.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Get our weekly newsletter when you join Hackster.
Latest articles
Read more
Related articles