Homing in on Heat
One way to make sure that the lights get turned off when you leave a room is to use Passive Infrared (PIR) sensors. Jeff examines the science and technology behind PIR sensors. He then details how to craft effective program code and control electronics to use PIR sensors is a useful way.
By Jeff Bachiochi
“The last one to leave, please turn off the lights.” How many times did you hear this while growing up? It’s an iconic phrase sometimes used to suggest the end of life, but as I remember it, just an effort to save electricity. I would always use the logic that bulbs burn out during the initial surge current and not necessarily from remaining on, but that logic never worked on Mom. To this day I am obsessive about turning lights off (thanks Mom!). To that end I tried installing Passive Infra Red (PIR) sensors to handle this automatically. After being inundated with complaints (from my wife Beverly) about lights turning off “while I’m still in the room,” I gave up.
While PIR devices are sensitive to heat (infrared)—the human body’s radiation is strongest at a wavelength of 9.4 µm—they are based on the heat source moving past the sensor. Let’s look at a typical PIR sensor element to see how this works. The RE200B PIR sensor comes in a TO-5 package. Manufactured by Glolab, this device actually contains two sensors as seen in Figure 1.
Each pyroelectric sensor is made of a crystalline material that generates a surface electric charge when exposed to heat. When the amount of radiation striking the crystal changes, so does amount of charge on the input to a sensitive FET device built into the sensor. The two elements are in series with the FET input connected to their junction. With this configuration and a wide (138-degree) field of view, whatever ambient light falls on both the sensors is canceled out. The sensor elements are sensitive to radiation over a wider range so a filter window is added to the TO-5 package to limit detectable radiation. As a standalone this device is not very useful. We need a way to interrupt the heat source from hitting both sensor elements at the same time.
Anyone familiar with opto encoders already understands how this works. Opto transmitter/receiver pairs are placed on opposite sides of a spoked wheel. Light passes between the spokes as it rotates between the pair. A second pair is placed such that when one light path is blocked by a spoke, the other light path is between spokes. As the spoked wheel rotates, the opto device’s output alternates between one coupled pair and the other. With some logic on the opto outputs, you can tell both direction and speed of the rotation. Creating the same kind of “picket fence” in front of the infrared (IR) sensor elements can cause the radiation to be alternately blocked and passed to each sensor. The trick will be to design the slat width and placement to give the desired effect.
A lens could be used to artificially reduce the field of view, by collecting and focusing it into a smaller spot. Move an object in front of the lens left to right and the spot moves right to left, behind the lens. If the spot passes over the two sensor elements sequentially, voilà—each sensor will produce a push or pull at the center tapped output. And that is something we can detect. A single lens would create one sensitive area out in front of the device. This might be just what you are looking for. However, to be sensitive to a wider range we must have multiple lenses. Since glass is opaque to IR we can’t use a typical glass lens. It turns out that polyethylene type materials do pass IR light and can be formed in various Fresnel lens patterns.
The idea for the Fresnel lens goes back to the French mathematicians of the late 18th century. This was an attempt to make lenses thinner while retaining the optical quality of the original. Figure 2 shows how unnecessary thickness is removed from an original lens without changing the lens’ curvature. In the early 19th century this idea was adapted for use in lighthouses by Augustin-Jean Fresnel. The thin cross section of the Fresnel lens makes it ideal for PIR lenses. …
Read the full article in the June 335 issue of Circuit Cellar
Don’t miss out on upcoming issues of Circuit Cellar. Subscribe today!
Circuit Cellar's editorial team comprises professional engineers, technical editors, and digital media specialists. You can reach the Editorial Department at email@example.com, @circuitcellar, and facebook.com/circuitcellar