I'm building a simple circuit based on a relay and transistor to switch a fan for use on my boat. A digital pin from an arduino is connected to base of an NPN transistor, the emitter to ground and the collector to the ground pin of the relay. The circuit does not properly switch. However, if I short the emitter to the collector, the circuit functions fine (although not triggered by the pin). I took out a multimeter and the voltage from collector to emitter reads 0.02v. Is this enough to throw off the pin? Why is there any voltage at all?

EDIT: Extra info. 5V relay, 2N3904, pin from micro > 1k > base | 10k Pull down I do have a protection diode across the coil.

  • 1
    \$\begingroup\$ Because the transistor is an imperfect switch. \$\endgroup\$
    – Thomas O
    Sep 29, 2010 at 21:48

1 Answer 1


First, the voltage from collector to emitter for a BJT will be about 0.2V minimum in saturation mode. Your DMM was making an inaccurate reading for some reason. This limit can be overcome by using a MOSFET, which will simply provide a tiny resistance (5ohms to 10s of milliohms) and, consequently, a tiny voltage drop.

You didn't post any information about your relay, either. Are you operating it within the specified voltages? Some relays will work at 5V, and some will not. Whether it's referenced to ground or not is gloriously irrelevant - Just provide it with the datasheet specified voltage/current, and don't worry about your ground.

All that being said, however, I would guess that you've simply blown up your transistor. The coil in the relay has a lot of inductance and a lot of current, and switching it can generate damaging voltage spikes. If you're using a 5V relay, just hook a 5.1V zener across the coil (cathode to 5V, anode to the collector of your transistor). This should help protect your electronics. With the zener in place, give it another try. (Note that there are more sophisticated protection methods if you need it, but I've always found a zener sufficient for reasonably rugged transistors with the small signal relays I work with - How big is the relay?).

  • \$\begingroup\$ Thanks for the reply. I'm using 5v relay. I have a protection diode across coil already. I've replaced the transistor with no change. Relay is quite small, 32VDC 30A. Needs 200ma at 5V to switch. If I manually switch ground though, i.e short ground to the collector, I can cause the relay to switch. \$\endgroup\$ Sep 29, 2010 at 21:57
  • \$\begingroup\$ :{ Hm. That should be well within the range of a a transistor switch - even a low-beta transistor should saturate at more than 200mA when driven by a microcontroller. Have you tried probing the base directly (well, almost directly - Through a resistor of, say, 250-500 ohms to generate an appropriate base current)? It could be an issue with your code or micro - That's really all that's left to by process of elimination. \$\endgroup\$ Sep 29, 2010 at 22:10
  • 2
    \$\begingroup\$ Well, it looks like (1) your resistor to the base is too big, and (2) you transistor is too small. Take a look at the "On Characteristics" table on p2 of the Fairchild datasheet - As Ic increasesfrom 10 to 100mA, hFE (Or beta, depending on how you learned it) gets smaller. Also look at the "Typical Pulsed Current Gain vs Collector Current" graph - Notice the sharp knee at about 100mA? You've discovered the difference between the salespeople's "absolute maximums" and the real maximums. The 2N3904 isn't meant to run at 200mA continuously, and the closer you get to this, the less gain you get. \$\endgroup\$ Sep 29, 2010 at 22:43
  • 1
    \$\begingroup\$ If the gain was 30 at 200mA, you would need a current of 200/30=~6mA, which would imply a 5V-Vbe = 4V / 6mA = 600 ohms resistance. I am surprised that your relay is being this stubborn, but it looks like it just needs some more current. \$\endgroup\$ Sep 29, 2010 at 22:46
  • 1
    \$\begingroup\$ I usually use a 1n4007 connected how you describe (cathode to +V, anode to the coil/collector junction. The Zener won't be doing anything, it's just acting as a (poor) diode. Having said that, if you connect the zener with the anode to +V, cathode to the 1N4007 cathode, and anode of the 1N4007 to the coil/transistor collector junction, you help the relay shut off more quickly. Not really necessary for this application, though. \$\endgroup\$
    – akohlsmith
    Sep 29, 2010 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.