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
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); }
Post a Comment