Description
MOC3023 DIP-6
Tutorial: How to use MOC3023 DIP-6
The MOC3023 is an optoisolated relay that allows controlling high voltage circuits from a low voltage logic system, such as Arduino. It is ideal for DIY projects and prototypes where signal isolation is required.
What you need
- Arduino Uno
- 12V power supply
- LED
Steps
- Connect the MOC3023 input to an output pin of the Arduino.
- Connect the common ground between Arduino and the circuit to be controlled.
- Connect the 12V power supply to the VCC pin of the optoisolated relay.
- Check the datasheet to determine if a pull-up or pull-down resistor is needed at the MOC3023 input.
- Write an Arduino sketch that turns the LED on and off every 5 seconds.
- Verify operation with a multimeter.
- If everything is correct, connect the circuit to be controlled to the relay output.
- Test communication between Arduino and MOC3023.
Example code
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // accende l'LED collegata al pin 13
delay(5000); // attende per 5 secondi
digitalWrite(13, LOW); // spegne l'LED
delay(5000); // attende per altri 5 secondi
}
Mini project
Create an alarm system that turns on a 220V connected lamp when motion is detected. Use the MOC3023 to isolate and control the light.
Common mistakes
- Do not correctly connect the ground between Arduino and the circuit to be controlled.
- Insert too much or very little voltage to the VCC pin of the optoisolated relay.
- Ignore the operational temperature specifications of the MOC3023.
- Do not verify the isolation between the two circuits.
Recommended accessories
- Arduino Uno
- Infrared motion detection sensors
- Additional optoisolated relays
Frequently asked questions
Can the MOC3023 be used with Arduino?
Yes, the MOC3023 is perfect for controlling high voltage circuits from a logic system like Arduino.
What power supply is needed for the MOC3023?
The MOC3023 requires 12V at the VCC pin, but check the datasheet for detailed specifications.







Reviews
There are no reviews yet.