Rocode >> Hobbies >> Sensors

Security Sensors

At PSA Products Pty Ltd I was formally trained in the installation of the Supa 8 Burglar Alarm.

This included discussion of keypads, strobes, reed switches, PIR sensors and door latches.

The Supa 8 Alarm system

The manual for the Supa 8 Alarm may be found on PSA Products website:

http://psaproducts.com.au/Assets/Documents/PDF/SecurityPDF/SUPA8_Installer_Manual.pdf


Sensors around my home

Below are details of my experimentation with internet connected sensors around my residential address.

I have two types of sensor systems around my home.

  1. Raspberry Pi and its GPIO (General Purpose Input Output) connectors
  2. 1-wire Sensors

Raspberry Pi

Raspberry Pi is an ARM GNU/Linux hobbyist computer for 21.60.

The Raspberry Pi home page is http://www.raspberrypi.org/.
See also the Wikipedia page http://en.wikipedia.org/wiki/Raspberry_Pi.

I purchased some electronic parts online via ebay.

  • Electronic Project Starter Kit
  • Resistor Assorted Pack
  • Reed Switch
  • PIR Module
  • 2.54 wires

    Raspberry Pi Experimentation

  • Protective Case Transparent Blue for Raspberry Pi
  • Solderless Breadboard Protoboard 830 Tie Points 2 buses Test Circuit
  • Raspberry Pi GPIO Breadboard Adapter
  • 26 Wire IDC Flat Ribbon Cable
  • Breadboard Wire Terminal Block

    Raspberry Pi Breadboard


    Reed Switch

    Using the Breadboard and LED from the Starter Kit and a 330 ohm resistor. I wired up a circuit for the Raspberry Pi to use the Reed Switch.

    I followed the instructions from this web page
    http://www.raspberrypi.org/phpBB3/viewtopic.php?t=9770&p=112792
    specifically the later KISS circuit.

    A video of this above example circuit is available on YouTube
    http://youtu.be/SNHY1Tv7p1w

    Here is my implementation of the circuit.

    The first photo is the circuit with the reed switch closed.

    The reed switch is normally open (NO) when the switch is not separated and no current flows.

    Raspberry Pi Reed Switch Closed

    The second photo is the circuit with the reed switch open.

    Here the switch is open and the circuit is connected. The series red LED shines brightly and the 330 ohm resistor stops the circuit from shorting.

    The GPIO port of the Raspberry Pi is connected in parallel to the reed switch and detects a voltage across the circuit. This is passed back to the software as a change on the port.

    Raspberry Pi Reed Switch Open

    I connect the 3.3 volts supply to the one side of the Reed Switch. The ground via a LED and resistor to the other side of the Reed Switch. The GPIO is connected between the LED and resistor.

    Raspberry Pi Reed Switch Circuit

    Raspberry Pi Reed Switch Breadboard

    I have written a script, called doorchecker.sh, on my Raspberry Pi to monitor the GPIO port connected to the Breadboard circuit.

    This emits the action of the reed switch opening or closing to my Elvin Router.

    doorchecker.sh

    The emitted notification is sent via my AVIS Router to subscribed software on the LAN.

    Elvin Notifications sent via LAN

    My Windows 7 desktop has received the emitted notifications that the reed switch has opened or closed.

    Raspberry Pi Reed Switch Notifications

    Here is a screencast showing the reed switch being opened then closed. The matching Elvin Notifications are displayed on subscribed Tickertapes.

    Reed Switch and Elvin Notifications

    After installing doorchecker.sh to /usr/local/bin/doorchecker.sh. I start the bash script using a service wrapper in /etc/init.d/doorchecker.

    /etc/init.d/doorchecker

    This custom doorchecker service is started using the chkconfig command.
    chkconfig --level 234 doorchecker on

    This will set the service to start automatically on boot.


    PIR Module

    Using the Breadboard and LED from the Starter Kit and a 330 ohm resistor. I wired up a circuit for the Raspberry Pi to use the PIR Module.

    Raspberry Pi PIR Module Prototype

    I connect the 5 volts supply to the +ve of the PIR. The ground to the -ve of the PIR. A resistor and LED are inserted to the OUT of the PIR. The GPIO is connected between the LED and resistor.

    Raspberry Pi PIR Module Circuit

    Raspberry Pi PIR Module Breadboard

    I have written a script, called pirchecker.sh, on my Raspberry Pi to monitor the GPIO port connected to the Breadboard circuit.

    This emits the action of the PIR module detecting movement to my Elvin Router.

    pirchecker.sh

    The emitted notification is sent via my AVIS Router to subscribed software on the LAN.


    Pressure Mat

    Using the Breadboard and LED from the Starter Kit and a 330 ohm resistor. I wired up a circuit for the Raspberry Pi to use a Pressure Mat.

    Raspberry Pi Pressure Mat

    I connect the 3.3 volts supply to the one side of the Pressure Mat. The ground via a LED and resistor to the other side of the Pressure Mat. The GPIO is connected between the LED and resistor.

    Raspberry Pi Pressure Mat Circuit

    Raspberry Pi Pressure Mat Breadboard

    I have written a script, called matchecker.sh, on my Raspberry Pi to monitor the GPIO port connected to the Breadboard circuit.

    This emits the action of the Pressure Mat detecting movement to my Elvin Router.

    matchecker.sh

    The emitted notification is sent via my AVIS Router to subscribed software on the LAN.