I've been working on a project where I need to control 5V to a USB port (to turn on Woot-Off lights whenever there is a Woot-Off). To that end, I've designed a shield for the Arduino. It has its own 5V regulator to power up to four devices (two of them are actual USB ports, two are pads for connecting anything else on 5V) and uses 2n222 transistors to control them.
I was just wondering if anyone could have a quick look at the schematic/board and tell me if I've made any obvious mistakes. Once I get a final revision I'm going to try to get some ordered as a group buy.
Yeah; to switch the 5V side of the USB port, you'll want to use a PNP transistor instead of an NPN like the 2N2222. Recall that the transistor switches on when a current flows across the 0.7V base/emitter junction, which means that if your base is 5V, your output voltage would have to be no higher than about 4.3V if you want it to stay on. A PNP transistor turns on when the Base is at 0V...
Ok, fixed the schematic and board by adding resistors and switching to PNP. I've also drawn one up with NPN as well (with the NPN following the load, connecting it to ground). Can anyone tell me the practical differences between the two schematics?
For the record, the design has moved over to relays to avoid the Vbe voltage drop and to provide a nice audible click, which is good for beginners as it provides instantly verifiable feedback. The first revision works great and a second revision (smaller, with thicker traces and other improvements) is in the works. If anyone's interested in ordering one from BatchPCB let me know and I'll send you the link.