Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

PIR Motion Sensor with Analog Output

  1. May 18, 2015 #1
    I'm working on a little arduino-like project that involves a motion detector with customizable sensitivity.
    The ambition here is that I could get a PIR sensor wired up that would give an analog-esque output depending on how much motion it detects. I know standard PIR sensors have a potentiometer on them for sensitivity, and another for delay.
    My idea is to remove both of those potentiometers and instead have both the delay and the sensitivity handled by software that I'm working on. In other words, the PIR would output an analog voltage value based on the motion it detects, and that value would be read in by a device, compared against a programmable threshold, and then a decision would be reached as to whether enough 'motion' had been achieved to set a flag high. When this occurs, the program itself would also handle the delay time (for example, how long to leave a light on). Removing all potentiometers and making it purely software dependent for customization is the goal here.

    I'm looking at a few schematics and pictures of PIR sensors and I believe at some point that the PIR itself is at some point putting out an analog signal, which is then being checked with a comparator. With that idea in mind, I think it's possible to cut out the extraneous stuff on these sensors and simply have the PIR's analog output data constantly being sent. If I can cut out the potentiometers, it'll save a little on the cost side and it'll also make it easier for a potential user to change customization via the control program and not have to fiddle with hardware components.

    How would I go about crafting a circuit that is constant analog output for a PIR sensor?
  2. jcsd
  3. May 18, 2015 #2


    User Avatar

    Staff: Mentor

    I find Google Images especially helpful for these kinds of searches. I Googled PIR Sensor Schematic, and got lots of good hits. Give that a try and let us know what you find... :smile:
  4. May 19, 2015 #3
    I'm still a little unclear what you want.

    Do you want to measure the amount of heat, or how hot it is? The difference would be whether you got a bigger signal from a sparkler in a room or an elephant in a room.

    If you need something sort of accurate, you will likely need to cool your lens. If so, peltier coolers might work. (Otherwise your lens will set off your detector. commercial devices get around this by measuring differences in temperature, rather than analog measures.)

    The basic device is any of a number of infrared semiconductor devices which work more or less like normal ones. Transistors are common, as are diodes.

    For the transistor, the IR light replace (or augments) the base current in driving the collector current. set it up like you would a common emitter amplifier. This will give an analog signal which you can massage as you like. Digikey sells them and has the datasheets online. Read a couple of datasheets to get the feel of the devices, their limits, and their quirks.

    To vary the gain, they also sell digitally controlled resistors. :smile: (Caution: These too have data sheets. They are not always a straight substitutes.)
  5. May 19, 2015 #4
    In layman's terms, I want to handle the sensitivity settings and delay functions of a standard PIR motion sensor (such as https://www.adafruit.com/products/189) in software.

    An analogy for what I'm gunning for could be done with a VOX system. A VOX has a potentiometer on it to adjust sensitivity (when it says something is loud enough to be considered 'speech'), and another potentiometer to adjust the delay for which it continues to output high after speech is heard. What I would want to do is rip this circuit back to being just a microphone, which outputs a voltage based on the volume of noise that it hears. Using that voltage, I can simply read it off, compare it against some threshold for sensitivity, and determine whether or not the volume was high enough to be considered 'on' based on that-- and then induce a software delay to simulate the one from the potentiometer.
    By this logic, a VOX has been stripped backwards into just a microphone with an output voltage, and that connects to the analog inputs of my microcontroller. These analog inputs receive the voltage and work with a programmable sensitivity setting.

    I want to do something similar with a PIR motion sensor, strip it of its physical sensitivity settings and instead just have it output a voltage that fluctuates based on the motion it detects. I can work with that voltage in software to determine a response. I don't want there to be physical potentiometers in my circuit to adjust settings.

    I'll go dive into some more schematics, berkeman.
    Jeff, could you explain the bit about the common emitter amplifier and IR light replace a little more clearly? I'm currently an undergraduate student and I've only had one real course about semiconductor devices so I'm not as familiar with them as I'd like to be. Do you have any reading material you recommend to get me a little more clear on them?
  6. May 19, 2015 #5


    User Avatar

    Staff: Mentor

    That's not how PIR sensors work. They have a multi-faceted lens that creates multiple images of whatever is in the room giving off IR radiation (like people). As the people move around, the multiple images cause changing amounts of IR energy hitting the sensor area. Your circuit picks up these changes, and converts the activity into some occupancy digital signal. The key to the detection circuitry is to be able to pick up changes in the IR level of the sensor, regardless of what the background (DC) IR level is.
  7. May 19, 2015 #6
    Horowitz and Hill, "The Art of Electronics". IMO, the best electronics book.

    How each device works depends on the device. I will assume you get a BJT transistor. They are somewhat easy to understand as well as being somewhat easy to design. There are simpler circuits to understand (like diodes), but they are a little harder to work with.

    A BJT transistor is a current multiplier. It has three wires, the emitter, the base, and the collector. When properly set up (for common emitter operation) all the current flows through the emitter. The amount of current through the base controls the amount through the collector. The amount is multiplied by the ß (beta). So if 1mA flows through the base, ß*1mA flows through the collector. ß is typically about 50, but varies a great deal.

    The infrared light will replace some or all of the base current.
  8. May 20, 2015 #7
    I think this might be along the lines of what I want.

    After watching this video and a few like it, I'm under the impression that the PIR sensor in the middle of it all, which would be the white dome in the link I posted before. If that's the case, I feel as if I simply remove that component and put it into a circuit it will function the way I intend. I've ordered one from Adafruit, and I'll check it out, see if it outputs 0-5V based on a 5V input and varying motion. I'll report back whenever it comes in and I get a chance to dismantle it!
  9. May 20, 2015 #8
    Sorry, I'm on a limited bandwidth (satellite), so no video. Good luck.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook