Light Dimmer using Arduino

AC LIGHT DIMMER WITHOUT ZERO CROSSING DETECTOR

In this tutorial, we are going to control the Light Dimmer using Arduino which will intensity of a 100W AC Bulb without using Zero Crossing Detector so you can also other Libraries that use Interrupts such as SoftwareSerial.h.

Despite the simplicity of the Zero Crossing Detector circuit, the software needed was a bit complicated as it needed to keep looking always of the zero crossings of the AC signal, then keep a watch on the time and then finally open the TRIAC. So to avoid letting the Arduino just wait for most of the time, an interrupt and a timer was necessary.

We will just use PWM, like with LEDs. Someone looking for that would no doubt end up at design by Ton Giesberts/Elektor Magazine 2 that can do PWM of an AC source.

The components Required for this Tutorial are listed below :

  • Arduino Uno
  • BRIDGE RECTIFIER BR1010
  • DIODES
  • IRF730 MOSFET
  • OPTOCOUPLER 4N35
  • RESISTORS

Circuit Diagram

CIRCUIT DIAGRAM OF AC LIGHT DIMMER
CIRCUIT DIAGRAM OF AC LIGHT DIMMER

As you can see in the above circuit diagram the AC Input is rectified using a BR1010 Bridge Rectifier (Datasheet at the end of the post) and that is provided to the voltage divider of resistors 100K and 6.8K of 0.5 or 1W to provide switching voltage to the Power MOSFET IRF730 which has max gate to source voltage of +/- 20V.

Volatge Divider of AC Light Dimmer
Volatge Divider of AC Light Dimmer

Voltage Divider Formula for Gate Switching

Thus we are applying 10.357V on the gate of MOSFET IRF730 for switching.

Code for AC Light Dimmer

int ledPin = 9;    // Bulb connected to digital pin 9

void setup() {}

void loop() {
  // fade in from min to max in increments of 5 points:
  for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) {
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);
    // wait for 30 milliseconds to see the dimming effect
    delay(100);
  }

  // fade out from max to min in increments of 5 points:
  for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5) {
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);
    // wait for 30 milliseconds to see the dimming effect
    delay(100);
  }
}

Now Connect the AC Wires Carefully and Upload the code to Arduino Uno and watch your 100W AC Bulb Fade.

Leave a Reply

Your email address will not be published. Required fields are marked *