Introduction: VERY SIMPLY RELAY AND ARDUINO PROJECT
WHAT YOU NEED:
1) A REALY MODULE (IM USING KEYES)
2) 9 VOLT BATTERY
3) 9 VOLT BATTERY CONNECTOR
4) 2 JUMPER WIRES ,AND WIRES
5) A 9VOLT LAMP
Step 1: CONNECTING
CLICK THE WHITE BACKGROUND IMAGE..........
THE CODE:
int Relay = 7;
int stateRelay = LOW; ; void setup() {
pinMode(Relay, OUTPUT); } void loop() { digitalWrite(Relay,LOW); // Turns ON Relays 1
Serial.println("Light ON");
delay(2000); // Wait 2 seconds
digitalWrite(Relay,HIGH); // Turns Relay Off
Serial.println("Light OFF");
delay(2000); }
AND BOOM!!!!!!!!!!! THERE YOU ARE ;))