0
\$\begingroup\$

I want to drive a MOSFET (IRFZ44N) with an optocoupler (PC817) to control the brightness of an 50 W 12 V LED. The PWM is generated by an ESP8266, 1 kHz.

Following schematic is used:

schematic of the circuit

In general it works, but PWM set to 10% does not result in 10% brightness of the LED. I expect it be much darker.

I have a circuit to compare with, where the brightness of the LED is as expected with 10% PWM:

enter image description here

Why does the circuit with the optocoupler does not get as dark (fast switching?) like the one with the two transistors?

When I understood the datasheet of the PC817 correct, it should be able to handle up to 80 kHz?

Thanks in advance!

Edit: In the first schematic (a later version of my project) I added the two capacitors at the output to get rid of the switching 1 kHz noises. The Schottky diode is there because I expect the user to use a relays as well, but then without the ability to adjust brightness by PWM.

\$\endgroup\$
8
  • \$\begingroup\$ Under what condition did the datasheet suggest 80kHz bandwidth? What does this suggest compared to your circuit, and, with respect to the duty range you expect from it? || Do you actually need an opto? The circuit shows common grounds. Is there a simpler solution you may be overlooking? \$\endgroup\$ Commented Jun 11 at 0:58
  • \$\begingroup\$ While the text says the opto is PIC817, is the part actually a PC817? \$\endgroup\$ Commented Jun 11 at 5:21
  • \$\begingroup\$ My fault! It is indeed the PC817, not PIC817 that was mistyped be me. i corrected it in my question text \$\endgroup\$
    – DeltaLima
    Commented Jun 11 at 7:43
  • 1
    \$\begingroup\$ It won't isolate anything with the grounds connected. Related: electronics.stackexchange.com/questions/714850/… \$\endgroup\$
    – winny
    Commented Jun 11 at 8:03
  • 1
    \$\begingroup\$ Very common trap. Too common. Aim for a shared ground with solid ground plane unless very special purpose or laws prohibiting you from doing so \$\endgroup\$
    – winny
    Commented Jun 11 at 8:41

1 Answer 1

2
\$\begingroup\$

You are discharging the gate too slow through 10k. Change this 10k to PNP transistor:

enter image description here

\$\endgroup\$
7
  • \$\begingroup\$ Even with a booster, the opto itself is limited to a couple 10s of µs in this configuration. \$\endgroup\$ Commented Jun 11 at 0:56
  • \$\begingroup\$ @TimWilliams Maybe the problem is miller effect, rising drain potential --> rising gate potential, causing very slow turn off. If so, then this booster will certainly help. I feel that 20µs is still very short compared to the 1000µs PWM cycle time, and shouldn't be so noticeable, so I don't think opto-coupler speed is the real problem. \$\endgroup\$ Commented Jun 11 at 5:03
  • \$\begingroup\$ @TimWilliams rather, I don't think opto-coupler speed is the biggest problem. \$\endgroup\$ Commented Jun 11 at 5:19
  • \$\begingroup\$ @SimonFitch More like 50us at 10k: farnell.com/datasheets/73758.pdf Fig.13. Though I'm not sure what they mean by "Ic = 2mA", implying Vcc > 20V maybe, but, the whole point is Ic varies, I don't know. IRFZ44N is around 40nC or 4nF equivalent, 4nF * 10k = 40us time constant, say 90us 10-90% rise/fall, so both are relevant. \$\endgroup\$ Commented Jun 11 at 6:13
  • \$\begingroup\$ So when I understood it correct, lowering the pull down resistor might already help? Or is the PNP Transistor to add mandatory to solve the problem? \$\endgroup\$
    – DeltaLima
    Commented Jun 11 at 8:17

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