PIR Sensor and relay problem


hello all,

i brand new arduino , have project hanging me up. goal hook 3 pir sensors through arduino uno able trigger 1 110v power supply have run for set time , turn off.

i found example of using 1 sensor thinking if make work hook 2 more sensors , adjust code bit but............
i have hooked shown on webpage below have constant on, pir doesn't seem registering......any thoughts?

i got schematic , code here (http://howtomechatronics.com/tutorials/arduino/how-pir-sensor-works-and-how-to-use-it-with-arduino/)

thanks,
joey

hi, , welcome forum.

prepaire 3 pins 3 pir sensors, e.g. this.

int pirsensor1 = 8;
int pirsensor2 = 9;
int pirsensor3 = 10;

do same 3 pinmodes.

pinmode(pirsensor1, input);
pinmode(pirsensor2, input);
etc.

and 3 sensorvalues.

int sensorvalue1 = digitalread(pirsensor1);
etc.

if want output acitvated sensor1, or 2, or 3, use "or" operator.

if (sensorvalue == 1 || sensorvalue2 == 1 || sensorvalue3 == 1) {

that can shortened to...

if (sensorvalue || sensorvalue2 || sensorvalue3) {

the code (from website) relies on "on" timing of pir.
the arduino could more accurate "delay" (for "on" duration) , "else" statement (to turn things off).
see various examples come ide.

if use arduino timing, turn "time" pot on pir anti-clockwise.
leo..


Arduino Forum > Using Arduino > Project Guidance > PIR Sensor and relay problem


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor