How to Make AC Lamp Dimmer using Arduino

Introduction

In the world of electronics, the Arduino platform has revolutionized the way we interact with our surroundings. It allows us to create and control various devices with ease. One such application is the AC lamp dimmer using Arduino. By utilizing an Arduino Uno along with MOC3021 IC and BTA16 TRIAC, we can create a simple yet effective solution to regulate the brightness of the lamp. In this article, we will discuss the details of Arduino Uno, MOC3021 IC, and BTA16 TRIAC, and learn how to connect them to create an AC lamp dimmer.

Introduction to Major Components:

Arduino Uno:

Arduino Uno is a microcontroller board based on the ATmega328P chip. It serves as the brain of our project, enabling us to program and control various components. The board consists of digital and analog input/output pins, which can be configured to interact with other electronic devices. It also has a USB connection, allowing us to connect it to our computer for programming and power.

MOC3021 Optocoupler IC:

MOC3021 is an optically coupled solid-state switch that provides galvanic isolation between the input and output circuits. It is often used as an interface for controlling high-voltage devices, such as TRIACs. The MOC3021 Optocoupler IC consists of a phototransistor optically coupled to a gallium arsenide infrared-emitting diode. When a current flows through the diode, it emits infrared light, which is detected by the phototransistor. This optical coupling allows us to control the TRIAC without any direct electrical connection.

BTA16 TRIAC:

The BTA16 is a TRIAC, which stands for Triode for Alternating Current. It is a semiconductor switch that allows us to control AC devices by regulating the power supplied to them. The BTA16 has three terminals – a main terminal (MT1), a gate terminal (G), and another main terminal (MT2). By varying the voltage applied to the gate terminal, we can control when the TRIAC switches on and off. This characteristic makes it ideal for applications such as lamp dimming.

PC817 Optocoupler

PC817 is an optocoupler, also known as an optoisolator, which is a device used to transfer electrical signals between two isolated circuits by utilizing light. It consists of a light-emitting diode (LED) and a phototransistor integrated within a single package. The LED is used to emit light when a current is applied, and this light is then detected by the phototransistor, converting it back into an electrical signal.

  1. Optoisolator: An alternate term for an optocoupler.
  2. Light-emitting diode (LED): The component of the optocoupler that emits light.
  3. Phototransistor: The component that detects the emitted light and converts it into an electrical signal.
  4. Isolated circuits: Referring to the separate circuits the optocoupler is used to transfer signals between.
  5. Electrical signal transfer: The purpose of the optocoupler, transferring electrical signals across isolated circuits.
  6. Package: The physical casing that contains the LED and phototransistor components.




How to Make AC Lamp Dimmer using Arduino
How to Make AC Lamp Dimmer using Arduino

Circuit Diagram of AC Lamp Dimmer using Arduino

This AC Lamp Dimmer using Arduino can be designed using a few basic components. The circuit diagram of this project is shown below.

How to Make AC Lamp Dimmer using Arduino Circuit Diagram
AC Lamp Dimmer using Arduino Circuit Diagram




More Circuit Layouts






Components List of AC Lamp Dimmer using Arduino

Following is the list of all components used in this project:

  • 1 X ARDUINO UNO
  • 1x MOC3021 IC
  • 1x BTA16 TRIAC
  • 1 X PC817 Optocoupler
  • 8X LED
  • 1X 100 Ohm Resistor
  • 1X 220 Ohm Resistor
  • 1X 220K 3W Resistor
  • 1X PERF BOARD
  • JUMPER WIRES

Arduino Code File:

Explanation of AC Lamp Dimmer using Arduino

Connecting the Circuit:

To create the AC lamp dimmer using Arduino, MOC3021 IC, and BTA16 TRIAC, we need to connect them according to the circuit diagram provided. The connections are as follows:

  1. First connect Arduino UNO board and connect its 5v pin to positive and common pin to ground.
  2. After that connect MOC3021 Optocoupler IC and connect its pin-2 to ground.
  3. Insert an LED and connect its cathode to pin-1 of MOC3021 Optocoupler IC and anode to 100 ohms resister while the other side of the resister to pin D3 of Arduino Uno.
  4. Insert a BTA16 TRIAC and connect its pin-1 to phase of the AC signal and its pin-3 to the pin-4 of MOC3021 Optocoupler IC.
  5. Now take a 220 ohms resister join it between pin-1 of BTA16 and pin-6 of MOC3021.
  6. Now insert a PC817 Optocoupler and connect its pin-3 to ground and also connect its pin-4 to D2 of the Arduino.
  7. Now connect cathode of 1n4007 to to pin-1 of PC817 and anode to Neutral of AC supply. Take another 1n4007 diode and connect its cathode to Neutral of AC supply and anode to pin-2 of PC817.
  8. Now take a 3rd diode 1n4007 and connect its cathode to pin-1 of PC817 and anode to 220k/3w resister’s one side. The other side of the resister will be connected to Phase of the AC signal.
  9. Take a 4th 1n4007 diode and connect its anode to pin-1 of PC817 Optocoupler and its cathode to 220k resister.
  10. Now insert a Push Button and connect its one pin to D4 of the Arduino and the other pin to ground. Take anothr Push Button and connect its one pin to D5 of the Arduino while the other pin to ground.
  11. Now take an AC Lamp and connect its one pin to the pin-2 of BTA16 while the other pin to the Neutral of AC supply.

In this way we have completed all the connections and now lets upload the the code to Arduino. Download the code from the link provided above in Components List section above and upload it to the Arduino to test the project.

By following these connections, we ensure that the Arduino Uno can control the MOC3021 IC, which in turn controls the BTA16 TRIAC. This setup allows us to adjust the brightness of the lamp by varying the voltage applied to the gate terminal of the TRIAC.




Conclusion of AC Lamp Dimmer using Arduino

Creating an AC lamp dimmer using Arduino is a simple and effective way to regulate the brightness of a lamp. With the help of an Arduino Uno, MOC3021 IC, and BTA16 TRIAC, we can easily control the power supplied to the lamp, providing us with a customizable lighting solution. By connecting the components according to the circuit diagram, we ensure that the Arduino can communicate with the MOC3021 and control the BTA16 TRIAC effectively. This project demonstrates the versatility of Arduino in home automation and lighting applications, allowing us to create more personalized and energy-efficient solutions. So, unleash your creativity and take control of your lighting with an Arduino-based AC lamp dimmer.

More projects, You may like:



For more project and circuit diagrams, you can go through the Schematics in the main menu where you can find many interesting projects and circuit diagrams like audio amplifier circuits, voltage booster circuitbattery charger circuit and timer circuits etc., which are all beginner circuit projects. Feel free to check them out!

Thanks for visiting the article and watching the video.

(Visited 349 times, 4 visits today)

Leave a Reply

Your email address will not be published.