Home Chapter 9 Maxuino/Arduino passive infrared sensor
Maxuino/Arduino passive infrared sensor

 A wonderful pyroelectric sensor device that detects motion by measuring changes in the infrared (heat) levels emitted by surrounding objects for sensing out to a distance of 30 feet down to a few feet.  The PIR  (passive infrared sensor) are best on a stable platform or one not moving, as they sense by imaging infrared light and when they detect a change in infrared quanta they switch high at 5 volts. 

They are robust and easy to use though they can also switch off and on quickly, that sometimes software filtering is a good idea.

They have a longer detection range, selectable by an onboard jumper and a wider supply voltage that can range from 3 to 6 VDC.

The Parallax PIR Motion Sensor:

Features

Detect a person up to - 30 ft. away, or up to 15 ft. away in reduced sensitivity mode

Jumper selects normal operation or reduced sensitivity

Source current up to 12 mA @ 3 V, 23 mA @ 5 V

Mounting holes for 2-56 sized screws

3-pin SIP header ready for breadboard or through-hole projects

You can find the PDF data sheet here 

 

 
 PIR sensor (larger then actual size.)

  

 
 Notice pins (GND, VCC and OUT) VCC goes to Volage + and out to the signal input

You would attach this sensor exactly as if you were attaching a input switch to your Arduino UNO Microcontroller.

Maxuino code for driving a PIR on the Arduino UNO

 

 
 Copyright Ken Rinaldo

Instructions on Modifying hardware to make a shotgun PIR sensor

You can change the area of sensing that the PIR can see by modifying the PIR with a thin tube or by painting portions of the fresnel lens. 

Modifying the PIR sensor

In this activity, you will turn the PIR sensor into a shotgun sensor. The PIR, with the Fresnel lens, allows you to mount this sensor on the ceiling and see in a full 360-degree area. However, what if you wanted to sense in only a 180-degree area? Well, one trick is to paint out portions of the Fresnel lens to create mini sweet spots where the sensor can see vs where the sensor cannot see. For example, in order to allow it to see only 180 degrees, you would paint out half of the sensor. I recommend white acrylic paint for this and make sure it is thick enough to block the infrared heat from your infrared sources. You can also change the sensor into a shotgun sensor by putting a piece of brass tubing 3/4 inch long over the heat sensor.

Parts necessary

One PIR sensor and Google to find best prices  and one small brass tube (step tubing) The sensors above can be purchased from the Robotshop for about $10 at time of this writing. 

  1. Carefully remove the Fresnel cap that is covering the sensor. You will notice a round can-shaped form with a rectangular window. Notice, as well, the capacitors on each side.

    Fresnel lens coming off the PIR sensor
    Model by Jessica Miller

    PIR sensor revealing heat sensor and two Capacitors . Model by Jessica Miller



    PIR sensor with a small tube of one inch long cut to fit over the cover of the sensor.
    It must slip over the sensor can and be careful not to use glue here as it can creep
    onto the sensing window of the PIR sensor.
In order to see how the fresnel sees light try this experiment:
  1. Now, take the Fresnel lens, put it over your eye, and turn your head while looking at a light source.
  2. Notice how the light jumps from one window to the next in the lens?
  3. When the lens is attached to the sensor, this is how it is imaging infrared heat onto the can-shaped pyroelectric sensor inside.
  4. Place the small tubing that came with your kit over top of the sensor.
  5. Now run the program entered above and notice how the sensor will only sense in a narrow beam where your tube sensor is pointed?
  6. Remember to give the sensor 25 - 40 seconds to warm up.