The agony of constantly unplugging and replugging the USB cable every 5 seconds to power your project! It’s even more infuriating when you’ve exhausted all the front USB ports and have to awkwardly reach around to the back of the PC. This project seeks to alleviate this frustration by incorporating a simple button to toggle the USB power on and off, along with some additional convenient features.
While a USB hub with individual port power switches would be a straightforward solution, this project takes a more innovative approach. By utilizing the MIC2545A high-side switch with 3A adjustable current limiting and soft-start functionality, this design offers a more sophisticated solution. The switch is controlled by an ATtiny25V microcontroller, allowing for customized control of the switch’s behavior in short-circuit conditions. Normally, the MIC2545A would limit the current, but with the microcontroller, it can immediately shut off the switch upon detecting a short circuit, or use a small delay or low-pass filter to prevent tripping due to instantaneous current spikes. Additionally, ESD protection is added to the data and power lines, a noise filter is included on the power line, and a dual-color status LED is implemented.
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.