Buscar

arduino - Using optocoupler with MOSFET for dimming a LED - Electrical Engineering Stack Exchange

Prévia do material em texto

Using optocoupler with MOSFET for dimming a LED
 Asked 5 years, 1 month ago Active 5 years, 1 month ago 5k timesViewed
1
I have a blue LED which I want to dim using an Arduino, an optocoupler and an N-MOSFET.
For achieving this I assembled the circuit on a breadboard as shown in the pictures, using a
YwRobot breadboard power supply to provide power to the optocoupler's transistor, and the
MOSFET. I used the Fading example sketch from the Arduino IDE.
When I try to dim the LED in this basic configuration: 
The LED slowly lights up, reaches its maximum, then slowly dims, then the cycle repeats as it
should in this case.
(PW → Resistor → LED → Ground)Mout
But in the circuit it behaves weirdly.
It doesn't dim, it's on full brightness, but when the cycle reaches again zero voltage, it's turned
off. No sign of change in the brightness.
I tried modifying the delay of the cycle and I used a multimeter to measure the LED's voltage.
As soon as the cycle moved from turned off state to a slightly higher voltage (I used 1
unit increments in analogWrite and 4 second delay) the LED was on full brightness .
any
(0V )
(2, 8V )
I don't know what's going on. Maybe I don't need one of the resistors on the optocoupler's BJT
side? I tried taking the resistor out but then the LED was always on, didn't even bother to
turn off so I put it back.
R3
Questions:
What should I change in the circuit to make the LED dim like in the basic configuration?
Do I need current limiting resistors for the BJT both on the emitter and the collector side 
 in this case? I know that in the case of FETS, the , so one resistor 
 is enough.
( , )R2 R4 =ID IS
( )R6
https://electronics.stackexchange.com/questions/214435/using-optocoupler-with-mosfet-for-dimming-a-led
https://electronics.stackexchange.com/questions/214435/using-optocoupler-with-mosfet-for-dimming-a-led?lastactivity
https://electronics.stackexchange.com/posts/214435/timeline
 Here are the schematic and the Fritzing project:
Datasheets:
4N35M optocoupler datasheet
IRLZ34N n-mosfet datasheet
https://i.stack.imgur.com/4dIs7.png
https://i.stack.imgur.com/Uep1v.jpg
https://www.fairchildsemi.com/datasheets/4N/4N35M.pdf
http://www.irf.com/product-info/datasheets/data/irlz34npbf.pdf

Continue navegando