Optocoupler Based TRIAC Circuit

Introduction

In our day to day life, we are constantly controlling different kinds of lights, AC/DC motors and many more appliances. Instead of just turning something ON or OFF, sometimes it is necessary to regulate the intensity of light or speed of motors. Although controlling the intensity of DC lights and regulating the speed of DC motors, it is quiet straight forward. Using PWM signals along with a MOSFET, we can achieve this functionality. But for AC appliances, this is not as straightforward. Since, for AC signals, we have to consider an alternating signal, we need to select a TRIAC as the switching element of the circuit. Using a TRIAC, we can drive high powered AC load with the help of a small DC signal. Since Main Lines can be hard to incorporate with small DC signals, it is necessary to use an optocoupler in order to isolate both the AC Signal and the DC signal. So, in this tutorial, we are going to look into how we can make an optocoupler based TRIAC circuit which is capable of driving high voltage AC loads with only 5V DC as the driving power source.

Use Cases

  1. Isolation of Control and Load Circuits
  2. High-Voltage Load Switching
  3. Dimming and Motor Speed Control
  4. Automation and Appliance Control

Required Components

  1. MOC3021 Optocoupler
  2. BT136 TRIAC
  3. Resistors
  4. Capacitors
  5. 220V AC Bulb
  6. Switch
  7. Breadboard or Veroboard (Optional: PCB)
  8. Connecting wires
  9. 220V AC and 5V Supply

Circuit Diagram

Instructions

The hardware setup should be made according to the above diagrams. The circuit can be implemented on a breadboard or on a Veroboard for proper connections. Even better, the whole circuit can be implemented on a PCB using the layout design file from the files section of this page. After the setup is made, upload the code to the ESP32. Make sure the code is adjusted according to the specifies instructions mentioned in the code. Certain variable values might need to be changed to a better output.

CAUTION: Be very careful while handling mains. If you are not sure about what you are doing, refrain from working with any mains connections. Be sure take safety measured as well.

Continuously Learn Create Share