BREAKING NEWS

18 April 2016

SIMPLY RELAY AND ARDUINO PROJECT

Arduino Based Relay project 

WHAT YOU NEED:
1) A Realy Module (IM USING KEYES)
2) 9V Battery
3) 9V Battery Connector
4) 2 Jumper wire and wires
5) A 9V LAMP




Connection








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);
}

Share this:

Post a Comment

 
Back To Top
Distributed By Blogger Templates | Designed By OddThemes