Home USB Power Switch and Filter

USB Power Switch and Filter

What’s more annoying than having to pull the USB cable every 5 seconds to power cycle the project you’re working on? Especially when you’ve ran out of front USB ports and have to reach around the back of your PC. This project aims to make things a little bit easier by using a small push button to turn the USB power on and off, along with a few other features.


There are USB hubs available that have power switches for each port, but there’s no fun in that. For this project a MIC2545A high side switch with 3A adjustable current limit and soft-start is used. The switch is controlled by an ATtiny25V allowing customizable control over how the switch operates in short circuit conditions. Normally the MIC2545A will limit the current, however with the microcontroller it is possible to have the switch turn off as soon as a short is detected, or possibly with a small delay or low pass filter so that it doesn’t trip from momentary spikes in current draw. Also added are ESD protection on the data and power lines, a noise filter on the power line (based on this design) and a bi-colour status LED.

The USB switch also has headers for the fault flag and button inputs, allowing multiple switches to be connected together so that a single button can control all switches at the same time, and if one switch detects a fault (from a short circuit condition) then all other switches will detect the fault as well.

Code and other things are available on the GitHub repo.

There are no programming headers on the PCB, instead an IC clip thing is used to connect the programmer to the microcontroller.