Creators
Earth Bondhon Author
Earth Bondhon
CalculatorToolsProjectExpert
Reviewers
Małgorzata Koperska, MD Steven Wooding
Last updated: November 28, 2025

Optocoupler and Triac AC Load Control MOC3021 Driver Circuit

🇺🇸
English
Default
🇪🇸
Español
Spanish
🇫🇷
Français
French
🇩🇪
Deutsch
German

*Please note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

Optocoupler and Triac to Control AC Load MOC3021 Triac Driver Circuit

Learn to control AC loads safely using the MOC3021 optocoupler and triac. Step-by-step guide with components, working principle, circuit diagram, and troublesho...

What Is an MOC3021 Triac Driver Circuit?

MOC3021 is a zero-crossing optoisolator, which is fitted with a triac driver. It is constructed to separate control circuits of low voltage from high-voltage AC loads. This circuit enables the safe switching of AC devices with the help of a microcontroller, a switch, or any DC trigger.

running LED effect circuit diagram

One of the most common electronics projects is a running LED chaser circuit powered by a CD4017 IC that is used to illuminate a decoration, as indicators of a signal, or to teach digital electronics. This circuit provides a sequential effect of LED lighting wherein LEDs are activated consecutively in some form of running or chasing effect.

A timekeeping counter, CD4017 IC, is a decade counter fed with the clock pulses of a 555 timer IC. The CD4017 spins the switch 10 of its 10 output pins with each pulse, one after another, with the LEDs then connecting to it, glowing in a sequence. With resistors, capacitors, and LEDs, the CD4017 can be used with resistors to create a nice running light display. This tutorial discusses every single element, the principle of operation, circuit board, step-by-step instructions on building your own LED chaser circuit at home, as well as troubleshooting.

Advantages of Using CD4017 for LED Chasers

  • Sequential Control: Lights LEDs in a controlled order.
  • Simplicity: Requires only a few components like 555 timer & CD4017.
  • Adjustable Speed: Clock frequency controls running speed.
  • Multiple LEDs: Supports up to 10 LEDs per IC.
  • Educational: Demonstrates counting, pulses & sequencing.

Components Required

Component Quantity Purpose
CD4017 Decade Counter IC 1 Sequential LED control
NE555 Timer IC 1 Generates clock pulses
LEDs 10 Visual display
Resistors (330Ω – 1kΩ) 10 LED current limiting
Potentiometer (10kΩ – 100kΩ) 1 Clock speed adjustment
Capacitors (0.01µF – 100µF) 2 Timing & filtering
9V DC Power Supply 1 Powers ICs & LEDs

Working Principle of the Circuit

Clock Pulse Generation

The 555 timer generates square wave pulses that determine LED running speed.

CD4017 Decade Counter

Receives clock pulses and activates Q0–Q9 outputs sequentially.

LED Sequencing

Each output drives an LED through a resistor, creating the chaser effect.

Reset Function

The sequence restarts automatically after 10 pulses.

Circuit Diagram Explanation

555 Timer IC

  • Pin 1 → GND
  • Pin 2 → Trigger (connected to Pin 6)
  • Pin 3 → Clock output → CD4017 Pin 14
  • Pin 4 → Reset (VCC)
  • Pin 5 → Control (0.01µF cap optional)
  • Pin 7 → Discharge
  • Pin 8 → VCC

CD4017 IC

  • Pin 16 → VCC
  • Pin 8 → GND
  • Pin 13 → Disable (GND)
  • Q0–Q9 → LEDs via resistors

Step-by-Step Construction Guide

  1. Assemble the 555 timer in astable mode for pulse generation.
  2. Connect 555 output to CD4017 clock input.
  3. Wire LEDs to CD4017 outputs using resistors.
  4. Connect a stable 9V DC power supply.
  5. Adjust potentiometer to control LED chase speed.

Applications

  • Decorative lighting
  • Electronic display boards
  • Learning digital counters
  • DIY electronics projects
  • Art-based LED installations

Troubleshooting Tips

  • LEDs not lighting → Check 555 output & wiring.
  • Wrong sequence → Verify CD4017 reset & pin connections.
  • Speed issues → Adjust timing resistor/potentiometer.
  • Dim LEDs → Check resistor values.
  • IC heating → Ensure voltage ≤12V.

Frequently Asked Questions - Optocoupler and Triac to Control AC Load MOC3021 Triac Driver Circuit:

What is an MOC3021 triac driver circuit?

A circuit that uses MOC3021 optocoupler to safely trigger a triac for controlling AC loads.

Can it control high-power AC loads?

Yes, as long as the external triac is rated for the load current.

Why use an optocoupler?

To electrically isolate the low-voltage control side from high-voltage AC side.

Which triac is suitable?

Triacs like BT136, BTA16, or equivalent depending on load rating.

What DC voltage triggers MOC3021?

Typically 3.3V to 12V DC, depending on resistor selection.

Do I need a snubber network?

Recommended for inductive loads to prevent false triggering.

Can it be microcontroller controlled?

Yes, microcontroller output pins can directly drive the LED through a resistor.

What is the AC load limit?

Depends on the triac used; MOC3021 only triggers the triac, it does not carry load current.

Is the DC side safe from AC mains?

Yes, MOC3021 provides optical isolation between AC and DC circuits.

Can I control multiple AC loads?

Yes, use separate MOC3021-triac pairs for each AC load.

Comments

Please login to comment.

Earth Bondhon

Earth Bondhon

Calculator Tools Project

Md. Jony Islam is a highly skilled professional with expertise in electronics, electrical, mechanical, and civil engineering, as well as finance. Specializing intransformer service and maintenance for 33/11kV substations, he ensures reliable and efficient electrical systems. His mechanical engineering skills drive innovative designs, while his financial acumen supports effective project budgeting. With a strong foundation in civil engineering, he contributes to robust infrastructure development. Md. Jony Islam's multidisciplinary approach ensures efficiency, quality, and reliability across all projects.