Electronic – 2N2222 low side relay switch not turning off

npnrelay

I've been pulling my hair out over this for weeks and I can not for love nor money work out why it's not working.

I have a very standard NPN low side switch setup to turn a relay on/off from a 3.3V signal. In reality the 3.3V signal will come from an ESP8266 but on my breadboard setup its coming from a power supply.

When I push the tactile pushbutton the relay turns on, when I let the button go, the relay stays on.

The only way I can get the relay to turn off again is to disconnect the 12V power source.

Circuit Diagram

Things I've tried:

  • I've tested all of the voltages and they're fine
  • I thought maybe the 2N2222 (TR1) base wasn't draining properly so I tried connecting it to ground via a 10k ohm resistor as well as the 1k ohm, no luck there
  • I thought maybe for some crazy reason 3.3V just wasn't cutting it so I tried a 5V signal instead, no luck there either
  • I tried all of the above with a 330 ohm resistor instead of a 1k (R1) to increase the current through the transistor, no luck there either
  • Thought I might be losing my mind and had wired the transistor in backwards. I hadn't, that transistor is now dead
  • Thought the relay might be fried, swapped it out for a different one then connected it directly to 12V. Worked just fine
  • Read through this identical question
  • Also read through this one

If anyone has any ideas on how to get this to work or if they notice something I've wired backwards (highly embarrassing) please let me know.

Appreciate the help!!

Circuit Photo1
Circuit Photo2
Circuit Photo3

Best Answer

So before pressing the button voltage measures 6.9V. Press the button and voltage difference drops to 0.25V. Release the button and voltage goes up to 6.5V – Bananaman 20 mins ago

Given that your supply is 12V it should measure near 12V or near 0V between collector and emitter. The 0.25V is good, but the 6.9V and 6.5V are not.

Either your 2N2222 is connected backwards or it is defective, check that it is oriented correctly and/or replace it with a new one.

From the photo it looks like you have the transistor backwards this may have damaged it.