Let's Make Robots!

PIR (Passive Infrared Sensor)

Vendor's Description: 

PIR's are cheap little things that combined with a little chip (PIR Sensor Control IC) and possible a Fresnel Lens will tell you if there is motion in font of it. Especially that of a human body, as it is reacting on Infra Red.

You can not use a PIR for anything but on something that stands still, to detect something else that moves.

No, you cannot use a PIR to make a robot follow you. The PIR only detects changes. A moving robot (even turning it's head) would be one constant "alarm" of "changes" - not possible to tell what is what.

If you want to make a robot follow you, you either have to use a camera and some serious calculations, or something like the devantech Thermopile array sensors or hack an Infrared thermometer (often refered to as a Laser thermometer asthey often come with a guiding laser-beam).. or something else :D

PIR's can only detect changes! A moving robot will detect changes all the time! 


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

These things come in housings with usually 2 or more thingeys, so that difference is easier to detect by letting the signals cancel each other out, and then note that one made a jump before the other.

However, you CAN also get them in "singles", and yes, you can also strip all away, and so "measure heat" on distance. BUT.. All sorts of other things will have a saying in the equation, you will need "something to compare with", or .. arh - too hard to explain in english for me :) Go ahead, I send a case of beer to the first one who can make a robot follow / track a person / measure heat (without other means of making reference) using a PIR!

Now THAT's one worth winning...

I started to make it track my hand but then I found out my ATmega644 was defective... Porta does not work. The other one I ordered is just a toaster, it gets extreamly hot if any power is applied. I have two more comming. I did just desolder a Atmega32 from a dead robot. I'll give it a try.

 My sensor is still in the three pin case. I don't see why you say it can only detect changes. As you can see in the video if my hand is to the right the voltage drops while if it is at the left it becomes higher. The sensor uses two PIR elements that counter each other. If say the right one sees more IR then the signal goes higher but if the left sees more then it goes lower. That way it stays the same if the temperature changes. 

 Sorry but you won't be able to measure temperature. These sensors are made to detect differences in temperature not the actual temperature.


OK. I know it is not perfect but it is a start. The PIR sensor tracks my hand! It would be a lot better but the way the sensor is it gives an output from something like 650mv to 700mv that is then amplified by an op amp. The signal seems to drift, but only by a few mv. That drift is amplified enomously. It can be trimed out but the potentiometer in my setup is extreamly sensitive. The code assumes that when it sees nothing the value is 2v but as it drifts it will sometimes lock on to the side of your hand and not the center.

 It has a ways to go but it is a start. I am uploading a video now to youtube. I think I will try a good DAC to use as refrence. That will allow the ATmega to compensate for the drift. An auto calibration feature. :)



Nice work.. But still I see nothing / read nothing that makes me believe that you can make a robot follow a person with this. Drifting.. Yes :) Changes.. Yes :) Constant tracking.. No :(

I can adjust for the drift by feading the opamp an offset voltage. I am currently doing that with a potentiometer. Last night I ordered a 12bit DAC to do the job for me. I was thinking of having one of the sides of the servo covered so the PIR sensor could be blocked and automationcaly calibrated every X seconds or miniuts.

 When I manage to get it calibrated right (you can't even turn the potentiometer just slight taps changes it a lot!) it can detect me on the other side of the room. I have not built a robot yet so I could not actually have it follow me. I am planing on making a "smart" sensor to acomidate for the drifting. Then I will make a robot. 

 The drifting could acturally be the potentiometer as when ever I even touch my desk it jumps a little, extreamly sensitive. Hopefully a 12bit DAC is percise enough.

I also ordered a better opamp. In the secutiry system that I stole the PIR sensor from I think they used a capacitor to filter out the drift by only letting changes through. The analog output from it is much different then my circuit if you put your hand near it the voltage rises then quickly drops and then levels out. Mine it stays high untill you move your hand.

 Another problem that you can see in the video is this sensor takes a long time to react. That is why it does not stay pointed at my hand it kinda moves back and forth. If I slow the servo more then it works better.


Well I can only say that it would be way cool if you manage! It is a big dream to make a robot track & follow humans, and this way would be very cheap and simple compared to using more advanced methods.

I tried to do what you are doing without luck, but I am not as skilled as you, so perhaps you will do better than me :) Good luck.

I just though of a big problem when trying to track humans. You will NOT be able to do it with the PIR alone. The PIR is good for saying "There is someone to the left" but not good for saying "they are 3 feet away". You could guess the distance with poor accuracy but it would have to be used with a Sharp IR sensor or ultrasonic to get the distance. It would help it pick out the human amont the other obstacles.

 Would this still count if the micro used the PIR to find the human and sonar to detect the distance so it would not run into the person?

Fritsl what exactly did you try? What was your setup? You probably have a lot more experience then me with robots. I am now just making my first robot. I have done a lot of work with microcontrollers but things like handheld devices, or LED cubes.

 The DAC I order was a sample from Microchip. They say it takes 2-3 weeks to get. I don't think I can wait that long. Maybe an order to Digikey. :)

No problem using a SRF05 or similar together.

Problem over all is that you will not continuasly be able to read "There is a human". You ask for my setup. My setups are a mess, I work on intuition, have no fine gear. I read how they work, understand, test cornerstones, burn something, conclude. Would take for ever to backtrack, sorry :)

I repeat myself: They can be used to detect changes! 

By strange setups not plausable you WILL be able to measure temperature at a distance, even when you say this cannot be done. But you will need constant calibration / knowledge of the thing you are pointing at.

As I see it, what you have now is the illusion that made me go and spoil a couple of perfectly fine alarms etc. It looks like it can be done, but you will need a steady "this from that" to use it to track (together with a distance sensor) and that is never what you get, only "difference between this and that" (= changes). Unless you keep calibrating which is not very smart to have in a robot :)