should led be connected across relay diode

Thread Starter


Joined Feb 14, 2009
I've connected an led in my circuit as seen in this "IR receiver relay cicuit". However having seen the method used in this light activated circuit i'm more leaning towards that, does it make a difference. Does the led compromise the
job of the dissipating diode in the first circuit.




Joined Nov 16, 2007
The LED setup is the same in both circuits except the order of the limiting resistor and LED.
Both setup's are fine and should not alter the function of the diode placed across the relay.


Joined Jul 17, 2007
Electrically, there is no difference in the way the relay, reverse-EMF diode and the LED & resistor are connected in the two circuits, except that your LED current limiting resistor is 470 Ohms, and the other is 2.2k Ohms, which if the LED had a Vf of 2v, you LED would get 6mA instead of the 4.5mA the other LED is getting.

But your circuit has a problem with the photodetector.
The datasheet doesn't say whether it is active-low or active-high, nor does it say how much current the output can sink. It has a 20k resistor pull-up for when the transistor is off, and that means your transistor won't be able to sink much current.

For your transistor, Ib, or base current, will be roughly (Vsupply - Vbe) / 20k, or (5v-0.7/20,000 = 2.15mA current. The standard for saturated transistors used as a switch is a gain of ten; so 21.5mA collector current; and maybe if you're lucky it'll work with up to perhaps 3x as much collector current, or around 60mA - but don't count on that.

You're using 6mA in your LED, and the 10k resistor is another 0.5mA (that resistor isn't necessary), leaving 21.5mA-6.5mA = 15mA for the relay. If the relay needs more than 15mA current, it may not work.

But at this point, the device might have a low output when active. In that case, you will need a probably need to use a PNP transistor (like a 2N2907) & base resistor to source current to the relay coil instead of sinking current with an NPN.

Thread Starter


Joined Feb 14, 2009
Thanks guys, not building either circuit was just curious about
the correct way to do it.

appreciate the reply.