Mayoogh Girish
Published © CC BY-NC-SA

Control AC Light Using Arduino

In this tutorial, I will show how to interface a 5V relay with Arduino and control an AC load.

IntermediateProtip33,694
Control AC Light Using Arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
General Purpose Transistor NPN
General Purpose Transistor NPN
BC547
×1
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×1
Relay (generic)
5V
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematic

Connect as per the given circuit diagram

Code

Code

Arduino
Upload the code to your arduino
void setup() {
  pinMode(13, OUTPUT);    
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   
  delay(1000);                      // Wait for a second
  digitalWrite(13, LOW);  
  delay(2000);                   
}

Credits

Mayoogh Girish
7 projects • 217 followers
Maker Bloger @ http://mgprojecthub.com/

Comments