NPN 2222 switching back on when Photon deep sleeps

This is my first use of a transistor, and I think I have the circuit correct as it works fine when the Photon is on. However, when the Photon goes into Sleep_Mode_Deep, it kicks back on (at a slower speed). He’s a simple diagram of what I’m doing:

do I just have a leak that stays on once powered?

@okeefe, in deep sleep ALL Photon pins will go into high impedance mode (floating). To fix this, you need a bias resistor on the base of the transistor to keep it OFF when the GPIO floats. In your case, a 4.7K to 10K ohm resistor to GND should keep the base from floating. Think of it as a “pull-down” resistor.

1 Like

Thank you! Something like this? photon_simple02

Yup. You should limit the current into the base by adding a 470 ohm resistor between the GPIO D6 and the base as well.

Also, since you are driving an inductive load (fan), you should have a flyback diode across the fan, something like this:


The fan may or may not have it built in. Do you have a model #?


Its a super cheapo I had around from a RPi kit, Aokin LD3007MS. I dont have any diodes around, I’ll need to order some…

@okeefe, you may be fine without the diode but ideally you should have the diode. A cheap 1N4001 will do (though somewhat overkill).