Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Relay-Controlled LED Circuit

View and Edit Project In Cirkit DesignerImage of Arduino Relay-Controlled LED Circuit

Circuit Documentation

Summary

This circuit is designed to control a relay module using an Arduino UNO. The relay module can be used to switch on and off a connected load, such as a light or other electrical device. The circuit includes an LED indicator that lights up when the relay is activated. A resistor is used to limit the current flowing through the LED.

Component List

Arduino UNO

1 Channel 5V Relay Module

LED Two Pin (Red)

Resistor

Wiring Details

Arduino UNO


1 Channel 5V Relay Module


LED Two Pin (Red)


Resistor


Documented Code

void setup() {
  pinMode(2, OUTPUT); // Set pin 2 as an output for the relay control
}

void loop() {
  digitalWrite(2, HIGH); // Turn the relay on
  delay(1000);           // Wait for 1 second
  digitalWrite(2, LOW);  // Turn the relay off
  delay(1000);           // Wait for 1 second
}

This code initializes pin D2 as an output and toggles the relay on and off every second, providing a simple control mechanism for the relay module.