loading

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

<p>i think you have forgot in the void setup &quot;Serial.begin(9600);&quot; so you k=can see the &quot;light on&quot; and &quot;light off&quot; on the serial monitor</p>
Smart idea! Thanks for shearig :)
<p>Very informative! so, going by this and something I saw elsewhere but, didnt really &quot;get it&quot; is one of these relays can be attached to a PIR sensor directly for signal and act as a motion switch to &quot;turn on&quot; whatever may be attached to the relay &quot;out&quot; without the need of a micro-controller ie: arduino etc. Do you know how to do this? I've tried but just have an &quot;always on&quot; thing goin' ...no switching going on.</p>
<p>this is an instuctable for pir senosr with arduino :<a href="https://www.instructables.com/id/Arduino-Basics-PIR-Sensor/" rel="nofollow">https://www.instructables.com/id/Arduino-Basics-PIR...</a>.....but for sure you can make a circuit without a micro-controller ,but is going to a bit hard,i think you cant and you shouldnt connect to your project a relay like this because is made for micro-controles ,it's going to easier with a relay like this (((http://www.google.com/imgres?imgurl=http%3A%2F%2Fw... </p><p>YOU CAN ALSO BUY A PIR SENSOR FOR HOME SECURITY AND ATTACH WHATEVER YOU WANT....IF YOU WANT MORE HELP ASK ME ;)</p>
<p>Nice work. Thanks for sharing this!</p>
thanks seamster!!

About This Instructable

2,425views

45favorites

License:

More by creator45:The Easiest way to make your own  pcb The easiest way to make  wardrobe lights THE ULTIMATE CONTROL BOX 
Add instructable to: