Logging PIR activity

Discussion in 'General Electronics Chat' started by expelledboy, Dec 18, 2012.

  1. expelledboy

    Thread Starter New Member

    Oct 25, 2011
    6
    0
    I would like to monitor and act upon events generated by my some 50+ PIR detectors. What I need is a real time feedback mechanism of when any one of them is triggered.

    I dont know much about alarm panels, but I get how the detectors work. Basically a switch.

    In my early experimentation's I simply pumped a voltage down the detectors one signal line, and checked if got back on the other end using a pin on an arduino. I have gathered that this is what older alarm panels used to do. Type2 alarm panels somehow use resistance to determine if it has been triggered.

    Problem is that the arduino does not have enough inputs. I could just get a arduino mega and be done with it, but it concerns me that I would be implementing a system that was deemed unsatisfactory to the task. Furthermore this still has to act as my security system!

    What I want ideally is an off the shelf alarm panel with serial output of when a PIR has been triggered. Does anyone know of such a system?

    Alternatively does anyone know all the features of the Type2 alarm panels, and how they work, so that I can replicate that instead?

    There seems to be a substantial amount of supporting circuitry, which I presume is used to smooth out PIR anomalies, reducing false positives. It concerns me that by forgoing use of a commercial solution I would be re-inventing the wheel, considering I do not know what anomalies I might find.
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,446
    3,362
    If the passive IR detector is basically a switch contact that is normally open (NO), wire all of them in parallel.
     
  3. expelledboy

    Thread Starter New Member

    Oct 25, 2011
    6
    0
    So all of them would have to fire simultaneously to generate an event? Also I want to implement different behaviors given which PIR has triggered. For example at 4AM in the morning an alarm at my front gate is very different from one in my bedroom.
     
  4. MrChips

    Moderator

    Oct 2, 2009
    12,446
    3,362
    With normally open switches connected in parallel any one sensor would trigger an event.
     
  5. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    To tag along, here, after the interrupt is registered( a PIR has detected motion), a multiplexer could scan all of your sensor lines and determine which sensor was triggered. This would require log2(n) + 1 I/O pins on your controller, where n is the number of sensors present in your system.

    Alternatively, you could implement the serial data method, but you'd need to have a microcontroller dedicated to a number of sensors, monitoring their outputs and generate a unique identifier for each sensor attached to it. Since you are using Arduino, I think it's safe to say you don't know about microcontrollers, so we can simply ignore this long string of text I've written here...
     
  6. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    As tshuck noted, you could use multiplexers. For example a CD4067 has 16 inputs and one output so it would take 4 of them for the 50 channels. Each has a 4-bit address line and a 1-bit enable line. The outputs are tied in parallel and go to one Arduino input. The enable lines could be controlled by an 8-bit multiplexer, such as the CD4051 to select which multiplexer is active. The 4-bit mux address and 3 control bits for the enable mux are controlled by the Arduino.
     
  7. expelledboy

    Thread Starter New Member

    Oct 25, 2011
    6
    0
    I honestly dont know much about microcontrollers, but an arduino is not a microcontroller with supporting circuitry, loaded with a software c++ bootloader?

    Oops, getting my switched mixed up. They can be NC or NO, but when they are configured for the type2 alarm panels they are NC, and are wired as such:

    Code ( (Unknown Language)):
    1. Sin ----o____o----|3K3|------o____o---- Sout
    2.         tamper              detector
    The PIRs have the a terminal block with the following connections:

    • 12+
    • Gnd
    • TamperA
    • TamperB
    • Common
    • NO
    • NC
    At the panel Sin connects to a 5V source, and Sout to a pin on the alarm board.

    As I have my arduino setup right now I just measure the digital signal at Sout.

    As I said I could use a mux, or an arduino mega, but ideally I would like to take advantage of existing PIR interfacing boards, or alternatively copy their behavior exactly. They use resistance to determine either that the signal line has been cut or the detector has triggered. The only way I can think they achieve this is by using ADCs and measuring changes in voltages?

    PS: I have done some research and found the DSC and CADDX Alarm Systems. Preliminary investigations look promising.
     
  8. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    More or less, yes, though it isn't a c++ bootloader... the microcontroller does not understand c++...

    An Arduino is little more than a modified programming language and a bunch of libraries. It is an abstraction from the uC to a place where the user doesn't really need to think about what is happening internally.

    I said that you should avoid this since you'd need a large number of Arduinos, each of which cost quite a bit. A bunch of uCs can be relatively cheap, all the uCs for this project for the price of a single Arduino.

    An analog mux(or several) can allow you to sample each line individually, though, depending on your ADC's speed, you could see a bit of latency...
     
  9. gerty

    AAC Fanatic!

    Aug 30, 2007
    1,153
    304
    Another route to take is to use CCTV instead of pir.
    CCTV with a DVR will provide the motion detection, record time/date, and give you actual video of the event.
    The motion detection aspect comes from the DVR itself, it's a feature on most DVRs.
     
  10. expelledboy

    Thread Starter New Member

    Oct 25, 2011
    6
    0
    Yes, an analog mux would work. When the PIRs trigger the switch is opened typically > 1 second.

    If you desensitize CCTV, to account for movements caused by wind, you will find the motion detection is rather limited for detecting humans.
     
  11. soda

    Active Member

    Dec 7, 2008
    174
    13
    Hi
    This is a alarm i designed for myself. It's working with PIR detectors and need an normally close contact on the PIR. If you need a circuit for an normally open PIR contact then just remove Q2 and connect Q1 straight to IC1 (NE555)

    If 15v for the supply is too high then change it to 12vdc. It'll still work. Just make sure to connect all the PIR switch contacts in series if the PIR's are normally close and in parallel if the contact's are normally open. That's it
     
    expelledboy likes this.
  12. expelledboy

    Thread Starter New Member

    Oct 25, 2011
    6
    0
    Cool! Thanks.
     
Loading...