Go Down

Topic: Transistor not switching off (Read 863 times) previous topic - next topic

wizdum

I have a transistor connected to my Arduino so that I can switch a relay on and off. I followed the diagram here: http://www.arduino.cc/playground/uploads/Main/relays.pdf

The transistor is an NPN type NTE123AP, (2n2222 equivalent), the relay is a R22-5d16-12 (12v coil), and I am using a 1k ohm resistor between the transistor base and the Arduino. When the arduino pin is active, the relay switches on, but when the pin switches back off (~0v on the arduino pin) the relay does not switch off. I poked around with my multimeter and found that the side of the current limiting resistor closest to the arduino is reading ~0v, while the other side (connected to the base of the transistor) is reading 0.73v. If I short that to ground, the voltage goes to ~0v and the relay will then switch off. Do I need some kind of pull down resistor in the circuit somewhere? I have used this exact same design before, with the same code, the same parts, and no problems. I have purchased a new transistor, and I still have the same problem.
"Anyone who isn't confused really doesn't understand the situation."

Electronic props for Airsoft, paintball, and laser tag -> www.nightscapetech.com

Grumpy_Mike

You used to get this problem with germanium transistors not silicon. I suspect that something is not what you think it is. Like the ground not being connected or the pin on the arduino not being defined as an output in the sketch.

wizdum


You used to get this problem with germanium transistors not silicon. I suspect that something is not what you think it is. Like the ground not being connected or the pin on the arduino not being defined as an output in the sketch.


I found a different relay and it seems to be working now. Could that relay just have been too large for a 2n2222? (The diagram mentions using a TIP102 for "large" relays) The coil resistance is 270 Ohms and the coil voltage is rated for 12v, although I am powering it with 10v.

I did check the code and the ground, both were fine (forgetting to set the pin as output already bit me once, heh.).
"Anyone who isn't confused really doesn't understand the situation."

Electronic props for Airsoft, paintball, and laser tag -> www.nightscapetech.com

Grumpy_Mike

Quote
The coil resistance is 270 Ohms and the coil voltage is rated for 12v, although I am powering it with 10v.

So at 12V this would only have drawn 44mA so it is not too big for the transistor you are using. Even at 10V you only have 37mA.

Go Up