# 24V signal to drive led

I have a PLC which gives 24V DC output. I would like to drive an external LED using 24V.

Is this the correct way to drive an led? Which is the right method let me know any changes needed. simulate this circuit – Schematic created using CircuitLab

• Your title says 24 V but your text says 12 V. Could you edit to clarify? – The Photon Oct 3 '19 at 5:28
• Also, how big an LED are you talking about? A 5 mA indicator, or a 100 W lamp? – The Photon Oct 3 '19 at 5:30
• i wanna blink normal 3mm LED external. usually PLC has inbuilt LED for notification. but i would like to blink external 3mm led separately. – AMPS Oct 3 '19 at 5:49
• cct1 is bad - it shorts the power supply in order to extinguish. This only works if Imax_supply is less than I_out_psu_max. If you MUST reverse signal polarity in this manner place the opto across the LED. | Circuit 2 needs a single series resistor - R = V/I = (24V-Vf_Led)/Vseries. Vf LED is about 3V for white LEDs. less for some others - see spec sheets. – Russell McMahon Oct 3 '19 at 6:22

Really all you need is a single series resistor. simulate this circuit – Schematic created using CircuitLab Figure 1. OP's thoughts.

In your first circuit the LED will light while the PLC output is off. If the opto-isolator turns on then it will try to short-circuit the 5 V supply to ground. That would destroy the opto-isolator if enough current flows through it. As it turns R1 will limit the current through the opto-LED to $$\ I = \frac {V}{R} = \frac {24}{10k} = 2.4 \ \text {mA} \$$ so the opto-transistor may not turn on hard enough. I have written a little on "current transfer ratio" in Opto-isolators intro.

In your second circuit R4 is just wasting power and should be removed from the circuit. simulate this circuit – Schematic created using CircuitLab

Figure 2. All that is required for 5 mA through the LED.

The power dissipated in R1 is given by $$\ P = \frac {V^2}{R} = \frac {24^2}{4700} = 122 \ \text {mW} \$$ so a 0.25 W resistor would be fine.