Thought I might start moving some of my old posts across from my old site and put them all here in one place.
Pyroelectric Infrared sensors (PIR) (thermograph)
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.
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
Above is an extract from datasheet with my notes on it.
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.
You can get the sensors from freak labs store like I did for $2 each
http://www.freaklabsstore.com/index.php?main_page=product_info&cPath=36&products_id=128
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 |
can you post there a code?
ReplyDeleteI have the code for processing here http://gr0b.blogspot.com.au/2011/01/processing-pyroelectric-pir-part3.html for doing 2d images.
ReplyDeleteFor the code in the youtube video it is a mash up of the arduino analog read example and servo sweep example. The servo moves from side to side and stores servo position if the analog value is greater then previous analog value. Then at the end of a sweep return to the servo position with the greater analog read value.
This comment has been removed by the author.
ReplyDeleteI am doing a similar project at the moment. I have foil covering one half. While keeping the heat source ans sensor from moving, the output still decays back to the baseline fairly quickly. This makes it unsuitable for absolute measurements, like the temperature of my hand.
ReplyDeleteI'm assuming yours didn't decay? If it did, wouldn't your graph be too noisy to use?