MOC3021 Optoisolator Triac 6 pins
MOC3021 Optoisolator – Triac Driver Output (DIP-6)
Overview
The MOC3021 is a 6-pin DIP optoisolator with triac driver output, designed to provide safe and reliable electrical isolation between low-voltage control circuits (e.g., Arduino, ESP32) and high-voltage AC loads. It uses an infrared LED as the input and a triac-like output device capable of triggering an external triac, commonly used in AC switching applications like dimmers, motors, and lighting.
Key Features
Isolation between input and output (up to ~5000 Vrms)
Activates an external triac to switch AC loads
Random-phase output—can be used for non-zero-cross triggering
Compact DIP-6 package; pins spaced for standard PCBs
Low input LED current—use with a current-limiting resistor
Suitable for use up to 400 V peak AC on the output side
Arduino & AC Load Wiring Example
Connect anode (pin 1) to an Arduino output pin through a ~330 Ω resistor.
Cathode (pin 2) goes to Arduino GND.
MT1 and MT2 connect to the gate and terminal of an external triac (e.g., BTA16) in series with the AC load.
Use a zero-cross detector (optional) for smoother dimming.
Ensure a snubber network or snubber-cap across the triac to suppress voltage spikes.
Power the Arduino from a separate low-voltage supply, keeping control and AC sides isolated.
Applications
AC lamp dimmers and fan speed controllers
Solid state relays and automated lighting
Motor control via microcontrollers
Any AC-load switching requiring isolation and safe interfacing