Go Down

Topic: PIR Sensor Trouble (Read 462 times) previous topic - next topic

DaveyReilly

I bought this PIR sensor (http://www.sparkfun.com/products/8630) recently with the intention of making a little Arduino burglar alarm.
For whatever reason it wouldn't work so I went to a lecturer and between the two of us, we got it to work using an analog pin instead of digital and having a battery connected as well as USB.

When I reassembled it when I got home it won't work again. I know I'm close, missing a resistor or something like that, but I can't for the life of me figure it out.

Picture of wiring: http://imgur.com/xqzLx

The three wires on the right were just left there from an earlier attempt.

Grumpy_Mike

Can you post a schematic? Pictures are hard to see what you have done.

Quote
and having a battery connected as well as USB.

You should not have to do this, the sensor will work off 5V.

johnwasser

What is that black thing plugged in next to the PIR connector?

As near as I can tell:

The Black wire is Power and goes to Arduino +5.
The Brown (center) wire is Ground and goes to Arduino Ground.
The Red wire is the signal.  It connects to an Arduino digital input pin.  It needs a pull-up resistor but you can use the internal one like this:
Code: [Select]

const int PIRpin = 3;  // Or whatever pin you have it connected to
void setup() {
   pinMode(PIRpin, INPUT);
   digitalWrite(PIRpin, HIGH);  // Enable the internal pull-up resistor
}
[/code
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Go Up