Author Topic: Resistor on optocoupler  (Read 1401 times)

0 Members and 1 Guest are viewing this topic.

Offline delphes123Topic starter

  • Contributor
  • Posts: 44
  • Country: be
Resistor on optocoupler
« on: April 10, 2023, 07:06:20 pm »
Dear all,

I found this schematic and I was wondering the exact function of the resistor R2, except acting as a kind of pullup when mosfet is not conducting, I am not quite sure why it should be mandatory to have it ?

Thanks
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14795
  • Country: de
Re: Resistor on optocoupler
« Reply #1 on: April 10, 2023, 07:15:41 pm »
R2 is not really needed. So are R3 and R4.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6257
  • Country: de
Re: Resistor on optocoupler
« Reply #2 on: April 10, 2023, 07:38:19 pm »
R2 is not really needed. So are R3 and R4.
^This.
Someone has too many resistors lying around.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Resistor on optocoupler
« Reply #3 on: April 10, 2023, 08:11:50 pm »
R3 is useful to prevent ringing on the gate but those other resistors serve no useful purpose. There are many circuits posted on the internet that were designed by people that didn't really know what they were doing.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15360
  • Country: fr
Re: Resistor on optocoupler
« Reply #4 on: April 10, 2023, 08:32:49 pm »
R4 serves as a pull-down. Avoids having a floating gate when the GPIO is in high-Z (which is the case with most MCUs until the GPIO gets configured as an output.) With the MCU_PWM signal name, there is little doubt that this is driven by some MCU's GPIO.

R4 would actually be the one not to remove here, R3 may or may not be needed.

The real question is for R2.

Anyway this is clearly overdone, in most cases you'd be able to drive the optocoupler directly from the MCU GPIO and call it a day. You wouldn't even need a pull-down (but you would need a series resistor.)

This looks like something the author may have taken from some schematic and used it in a cargo cult way.
 
The following users thanked this post: james_s

Offline wasedadoc

  • Super Contributor
  • ***
  • Posts: 1659
  • Country: gb
Re: Resistor on optocoupler
« Reply #5 on: April 10, 2023, 08:44:03 pm »
The 2N7002 can be "iffy" if the logic signal is only 3.3 Volts. Look at the max threshold voltage and note also the test conditions. Vgs=Vds and Ids is very small.
 

Offline John B

  • Frequent Contributor
  • **
  • Posts: 822
  • Country: au
Re: Resistor on optocoupler
« Reply #6 on: April 10, 2023, 10:45:15 pm »
I'll admit to using a few more resistors than perhaps needed....

R2 will provide a discharge path for the opto's diode once the mosfet turns off, it should speed up the turn off time, but not sure if 10k will do much. I remember doing some tests with this approach in order to try to speed up the switching times of a basic PC817 type opto. This included other things like a parallel RC branch driving the opto in order to create pulse of charging and discharging current. Nothing really helps a PC817 that much.

I also would include R3 out of habit on a MOSFET. I don't know what the peak currents would be on charging a MOSFET gate like this, that would depend on how the output stage is driven, switching times, trace inductance etc, but just to be sure I do usually put a series resistance in there.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6257
  • Country: de
Re: Resistor on optocoupler
« Reply #7 on: April 10, 2023, 11:04:58 pm »
If you're concerned about speed or turn-off time, forget about R2.
Reducing the value of R5 would give much more bang for your bucks. Try with a collector current of 2...5 mA instead (provided your optocoupler has the CTR to drive that).
 

Offline srb1954

  • Super Contributor
  • ***
  • Posts: 1111
  • Country: nz
  • Retired Electronics Design Engineer
Re: Resistor on optocoupler
« Reply #8 on: April 10, 2023, 11:24:23 pm »
R2 will provide a discharge path for the opto's diode once the mosfet turns off, it should speed up the turn off time, but not sure if 10k will do much. I remember doing some tests with this approach in order to try to speed up the switching times of a basic PC817 type opto. This included other things like a parallel RC branch driving the opto in order to create pulse of charging and discharging current. Nothing really helps a PC817 that much.
The speed improvement from R2 will be completely insignificant compared to the switch off delay of the photo-transistor.

Much greater speed improvement can be obtained from placing a resistor between the base and emitter of the photo-transistor, assuming the base connection is bought out externally. This helps sweep any charge out of the base so the transistor can turn off more quickly, albeit at a considerable reduction in the opto-coupler CTR.
 

Offline MegaVolt

  • Frequent Contributor
  • **
  • Posts: 930
  • Country: by
Re: Resistor on optocoupler
« Reply #9 on: April 14, 2023, 01:25:00 pm »
R2 reduces the current through the LED. We were faced with the fact that an optocoupler with a logical output turned on at a logical zero at the output of the control logic. Those. any minimum current can turn it on. The current was much less than the current indicated in the datasheet. Therefore, it was necessary to introduce a separate current path through the resistor.

I understand that not all optocouplers are so sensitive. But it is better to put a resistor and be able to put any optocoupler.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf