What Is the MOC3021? Triac-Driver Optocoupler and Uses
The MOC3021 is a triac-driver optocoupler. It contains an LED + a small triac; isolating the MCU, it triggers a power triac and switches AC mains loads (lamps/heaters/motors). It does not drive the load directly; a power triac (e.g. BT136/BT138) and a trigger resistor are also needed. It is random-phase trigger (for dimming); the zero-crossing version is the MOC3041.
The MOC3021 is a triac-driver optocoupler: it contains an LED + a small triac and, isolating the microcontroller, triggers a large power triac. This safely switches AC mains loads (lamps, heaters, motors). For the concept, see what is an optocoupler.
What is the MOC3021 used for?
AC load control from an MCU (dimmers, solid-state switching instead of a relay). The MOC3021 is random-phase trigger (for phase-cut/dimming); the zero-crossing version is the MOC3041/MOC3061 (less noise for simple on/off).
MOC3021 pinout (DIP-6)
| Pin | Function |
|---|---|
| 1 | Anode (LED +) |
| 2 | Cathode (LED −) |
| 3 | NC |
| 4 | Main terminal (triac) |
| 5 | NC |
| 6 | Main terminal (triac) |
Watch out
The MOC3021 does not drive the load directly; it only triggers the gate of the power triac. The circuit also needs a power triac (e.g. BT136/BT138) and a trigger resistor (e.g. 330–470 Ω). A current-limiting resistor on the input LED is a must. Because it works at mains voltage, isolation and safety are critical.
Equivalents
- MOC3041 / MOC3061: zero-crossing trigger versions.
- MOC3020 / MOC3022: the close family.
- PC817 + triac: a discrete solution.
Find it in our catalog
Use the MOC3021 search.