Pages: [1]   Go Down
Author Topic: PIR Sensor  (Read 1291 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 1
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

A query about PIR Sensors...
At the moment I'm working on a project that uses a PIR sensor, a nice and simple idea (you'd think): If the sensor detects motion the alarm sounds (at the moment i'm just testing with LEDs or a piezo buzzer). http://www.conrad.de/ce/de/product/172500/PIR-SMD-MODUL-3-12-V2-mA Thats the sensor. I'm having a problem where the sensor thinks there is movement all the time when there isn't. Whether I use the LED or piezo buzzer as the indicator of motion, they get set to HIGH the second the sensor is turned on. I have tried example programs from here as well as my own. I've given the sensor time to calibrate, even up to 60 seconds. Still, after this 60 seconds it sets the buzzer off.

Now I am a novice so its probably something relatively simple that I don't understand. However, if anyone does have any info or suggestions, can I really ask that you keep as basic/well explained as possible. Expect that I know nothing, because thats not too far from the truth!
I hope someone can help.
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe it is so easy that you have missed to use a pull up R on the output? Manual suggests 22k and max 20mA (drain?) well u know what i mean, do not overload the output.

Edit: to clarify, the output is open collector.


Thanks

« Last Edit: January 28, 2011, 06:51:40 pm by swetrack » Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I wish it was that simple, I have that connected, because then I would have it done by now! smiley-sad Well what I've done since is hook up the reference voltage pin up from the sensor (advice from a friend of mine to make the sensor output value more stable apparently). But its not actually connected to anything at the moment because I literally don't know what to do with it. I've searched for this on the net but every example project doesn't seem to use this reference voltage pin, apparently their projects are so simple and great and easy that it works without. But thats not the case with mine and I'm starting to get really frustrated.
Can anyone point me to a diagram that uses all four of these pins (voltage, ground, sensor output and reference voltage)? I'm lost and frustrated at this point.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16470
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well I can only read english so that link doesn't help me figure out what you should do about the reference pin, but the reset are pretty straight forward. Wire ground to arduino ground pin, power pin to arduino +5vdc pin and finially wire the signal pin to a arduino digital input pin. Because that signal pin is an open collector you will need to enable the internal pull-up on the arduino digital input pin, so in your setup function have:


Code:
int sensorPin = 3;  // or any digital pin you wish to use

void setup()
{
   pinMode(sensorPin, INPUT);  // make it an input pin
   digitalWrite(sensorPin, HIGH); // turns on internal pull-up resistor
   // other setup stuff
}

Now in your sketch when you do a digitalRead() the sensor will read LOW when the signal is active and HIGH when there is no active alarm state.

Lefty
Logged

Pages: [1]   Go Up
Jump to: