Cheapo PIR

by contrechoc in Circuits > Gadgets

5352 Views, 20 Favorites, 0 Comments

Cheapo PIR

pir-gadget.jpg
intro:
Want to do something with moving people? (Activate a video, or a turning table in a window sill, alarm when the burglar visits your house... )
The official PIR sensor too expensive? (around 10 euro's)
Do you have a shop like ACTIONS in the neighborhood?
Get a PIR for 2.40 euro's (actually 2.39 :-)
This instructable is about how you can hack it, and connect it to an Arduino, starting whatever you like.

The gadget is for use during the night. When it sees somebody moving, it will light up, and keep the LED's on for 20 seconds.
It only works at night, using a LED (not an LDR), (i think).....
The disadvantage of this gadget is that the three power LED's use ... power :-)

This is really easy hacking, cheapo and fun to play with!






Components and Tools

pir-inside-front.jpg
Component:
one of these PIR sensors
just some wires, to connect power and signal
one resistor of 2K - 10K, to get the signal to the arduino, but no current
maybe male headers, but you can use the metal ends of resistors for this too

Tools:
screwdriver to open the PIR gadget
soldering device
pincher

in the background: (the usual stuff)
multi meter, to check the PIN which goes HIGH on the PIR gadget
Arduino
USB printer cable
Computer

How To

pir-inside.jpg
Open the gadget.

solder wires to the PLUS and GND of the battery case, from the inside (look at the + and - sign inside the case)
connect these to the PLUS and GND of the arduino (you can use male headers for this, or little pieces of metal from some resistors you used in other projects)

we need the PIN that goes HIGH from the chip, measuring the PIN's gave me this one< look at the picture
solder a wire to this PIN.
solder the resistor of around 5K Ohm to this wire and connect it to an (digital input)  PIN of the arduino

there are two details:
1. the gadget only reacts in the dark, light value is measured at the side, there is a LED like small thing, you have to carefully tape this of using black tape (several times). Then the gadget thinks it is dark! (you can also desolder this LED, then it works in daylight too.)

2. the three power LED's are on when the PIR "sees" IR of humans. These LED's consume a lot of power. You can either get the LED's all out (desoldering) or reduce the number to 1.

Be carefull with the white wires: they detach easily, and when the detach from the circuit and you forget where they should be connected, you need to buy a second gadget to reconnect!

Script for Testing

pir-PIN-2.jpg
pir script.png
You have connected the PLUS and GND wire to the arduino.
The signal wire is going to one of the digital input PIN's, say 8.

Then there is this easy script to read of the value and display it using Serial Window:

int inputPin = 8;

void setup(){
  pinMode (inputPin, INPUT);
  Serial.begin(9600);//only used to check the value
}

void loop(){
  if ( digitalRead(inputPin)==HIGH){
      Serial.println("HIGH PIR saw something moving");
  }else
  {
     Serial.println("LOW PIR saw nothing");
  }
  delay(1000);
}

After checking that it works you can use the signal any way you like of course.