2
\$\begingroup\$

I have relay conected with arduino and high voltage bulb, now how can I control voltage to fade in and out bulb? I know that a relay is an on off device so maybe a triac or IGBT would be needed?Would an optpcoupler be good for isolation? Should I use a PWM output on the arduino?

\$\endgroup\$
4
\$\begingroup\$

With a relay? You can't.

The relay contacts are either open (lamp fully off) or closed (lamp fully on) and can't switch a relay fast enough to give a dimming effect.

schematic

simulate this circuit – Schematic created using CircuitLab

What you're looking for is a triac controlled dimmer.

schematic

simulate this circuit

In this case an opto-coupled triac is used. Your micro would switch the LED D1 on at the appropriate point in the mains half-cycle turning on the triac. The triac stays on until the next zero-cross of the mains and then turns off. At 100 (50 Hz) or 120 (60 Hz) half-waves per second the flicker is not noticeable.

Your code would have to monitor the mains zero-cross somehow, ramp the delay in triggering the triac and pulse the optoisolator at the right time. Plenty of examples on a web search.

\$\endgroup\$
1
\$\begingroup\$

+1 for the opto-coupled triac.

Opto-couplers are nice because you can "drive" the circuit as if you were controlling an LED. Throw a resistor in series and you can separate your arduino from the high voltage.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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