I wonder if there is some simple solution to drive LEDs powered from single rectified voltage.


Assume AC is 220 V, each LEDs is 3.0 - 3.2 V 150 mA. I reckon series connection made it simpler but not sure if the optocoupler is able to provide the current.

Adding a BJT/MOSFET at the opto output should be OK but I am not sure how to connect it. Protective part can be advised but I wish to have the basic ON/OFF function working first.

EDIT on 2019-01-28 12:34

Actually, my design consists of two 30xLEDs paths and wish to end them with an optocoupler to Neutral.

Thanks to JonRB and Transistor, they discovered several fatal issues, so i retry and hope this would make more sense.

Refer to this active current limiter, i wonder if the optocoupler can attach to it. enter image description here Now, with 60 x LEDs (3.0 - 3.2 V 150 mA):

100k Resistor to turn IRF740 FET On.
8 Ohm Resistor with BC817 BJT to limit the current to ~150mA.
Optocoupler PC817 would shutdown both transistors. 

I think IRF740((400Vds) should be capable of AC peak voltage and current limiter can save the LEDs from destory as well.


2 Answers 2


When in doubt, check the datasheet:


The datasheet has two key pieces of information pertinent to your use-case

  1. Collector current - 50mA
  2. Collector-Emitter voltage - 35V

Your use case is targeting 150mA and thus this part is not suitable. Likewise you are stating this is powered from 220V (thus a peak of ~310V) yet this part has a Vce of 35V

Basically this part is not suitable for direct blocking.

A suitably rated FET would be. However... It isn't that simple. I have included an example circuit WITHOUT values as working with main potential isn't something you should do, unless you know what you are doing

The FET needs to have a blocking potential greater than the maximum DCLink voltage. It must be able to sink your target LED current.

The Zener is acting as a crude voltage regulator to limit the voltage applied to the gate. The resistive chain is dropping the vast majority of the DCLink potential.


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ I understand PC817 won't work. I'd first remove the optocoupler label. I also try to avoid another track from the main. maybe I should add this to my question as well. btw, do you think it is impossible? although PS2533 is not popular, do you think it could do the job? \$\endgroup\$
    – Simon
    Jan 27, 2019 at 10:40
  • \$\begingroup\$ Please note that your circuit will destroy the LEDs - you have not included a current-limiting component. While I understand that you were focussing on the LED switching, the OP clearly does not understand the implications of your simplification. \$\endgroup\$ Jan 27, 2019 at 19:17
  • \$\begingroup\$ As it stands yes (unless you say you had 200odd in series and the RDS on is sufficient). \$\endgroup\$
    – user16222
    Jan 27, 2019 at 19:19

The PC817 datasheet lists the Absolute Maximum Ratings as

Collector-emitter voltage    80 V
Emitter-collector voltage     6 V
Collector current            50 mA
Collector power dissipation 150 mW

With a 220 V AC supply and a diode rectifier you will have \$ 200 \sqrt 2 = 350 \ \text {V DC}\$ on the opto-terminals. It will die instantly.

Meanwhile, you have 30 LEDs in series with a minimum forward voltage drop of 3 V giving 90 V across the LEDs. Therefore the worst case voltage drop across the two 120 Ω parallel resistors is 350 - 90 = 260 V. The resistors will limit the current to \$ I = \frac {V}{R} = \frac {260}{60} = 4.3 \ \text A \$. The LEDs will be spectacularly brightly for a very short while.

Note that the power dissipated in each resistor is given by \$ P = I^2R = 2.15 \times 120 = 555 \ \text W \$.

Back to the drawing board, I'm afraid.

  • \$\begingroup\$ ok. thanks. seem I have to vanish this idea....maybe try a relay at rectifier input instead. \$\endgroup\$
    – Simon
    Jan 27, 2019 at 10:50
  • \$\begingroup\$ @Simon Your idea isn't impossible. You've just not considered the parts to use properly; you need to think about ratings when selecting parts. \$\endgroup\$
    – Hearth
    Jan 27, 2019 at 12:08
  • \$\begingroup\$ @Simon - You seem to have concluded that you only need to use a relay rather than an optoisolator. This is not true. Please pay attention to the calculations involving LED current and resistor power. If you use a relay or a MOSFET (perJonRBs answer) you will destroy your LEDS. If, somehow, you don't, you will instead destroy your 180 ohm resistors. \$\endgroup\$ Jan 27, 2019 at 19:16
  • \$\begingroup\$ ok, I should not give up so easily since I started up this question. please check if this current limiter works? \$\endgroup\$
    – Simon
    Jan 28, 2019 at 8:26
  • \$\begingroup\$ Have you calculated the power dissipation in your current limiter yet? (I haven't but I suspect that it's going to be very high.) \$\endgroup\$
    – Transistor
    Jan 28, 2019 at 13:58

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.