Projects‎ > ‎

Pyroelectric Infrared sensors (PIR) (thermograph)

posted Jan 24, 2011, 4:00 AM by robert sturzbecher   [ updated Jan 24, 2011, 5:32 AM ]
Pyroelectric sensors are cool and so is thermograph but the main real downside is cost. 
If you don't need it to be accurate here is a cheap and easy way of adding it to your next Arduino project.


For this project I will use a pyroelectric sensor from a PIR motion detector. Of coarse the temperature reading is not going to be very accurate but if you need accuracy then you will need something better then a $2 PIR sensor. 


There are a few things to note about PIR sensors. 
  • Background temperatures and Sensor temperatures influence the output.
    Holding the sensor or heat near the case will also influence the output.
    (So don't put them next to things that can generate heat like motors, LEDs ,ect..)

  • Motion detector types have 2 elements inside them.
    A left and a Right. One will drop the output voltage and the other will increase it.
    (This is why we cover one file with foil tape) These sensors normally have square windows.

  • These sensors see humans, The motion detector PIR sensors have filters built in that are optimized to see the heat emitted by humans. 

Ok lets start


Modding the sensor is done with a small bit of foil tape. Because the sensor has a left&right sides that increase and decrease the output depending upon which side detects the most heat we will cover one side. I used foil tape as the metal is a good IR reflector and a good conductor of heat and will hopefully disperse the heat. I found it was better to block the side the lowers the voltage, but you can do ether.
   





Wiring the sensor is easy, They only have 3 pins (Drain/Vcc, Source/Out, Ground). To wire to an Arduino you need to connect up as below

  • Drain/Vcc goes to 5Volts.
  • Source connect directly to a Analog pin of the Arduino and needs a 47k resistor that connects to Ground. 
  • Ground goes to ground.
Above is an extract from datasheet with my notes on it.

I didn't have a 47k so I used a 20k, still works well.



The Code to get the sensor value.

                        sensorValue = analogRead(sensorPin);

What did you expect it to be more complex? You can use most of the Arduino demo sketches to use the sensor. The only thing to note it that analogRead works better if you put a delay in front of it to let things settle first. 


Putting to use 
If you want something a little more complex you could try mounting the sensor on servos and use it to track people and their appendages ;) and oh yes that is a wireless camera on top.
You could even use it to map the surrounding environment.


In the video below the head does a sweep reading the PIR sensor values then returns to the strongest point with the lights, then repeats. The values are outputted to the computer if connected.  


The next step for this that I am working on is to process the data computer side to create a 2d PIR image, almost like Thermo graph but without the stupidly expensive price tag. 


The Datasheet is also downloadable from the product page above.

You can also get the sensors from other online stores like (I'm not plugging them its just were I shop) 
http://www.littlebirdelectronics.com










    
Ċ
robert sturzbecher,
Jan 24, 2011, 5:59 AM
Comments