A Simple Home Alarm System with DAQ and Labview


We all like peace of mind knowing that our home is safe when we are away, at work, or for whatever other reasons. The system here is a simple home alarm system with a motion sensor. The Labview virtual instrument (VI) described here can be easily expanded to a full-fledged alarm system with several sensors, and strategies of detection.
Objectives:
Design a simple alarm system using a PIR (Passive InfraRed) motion sensor that will detect movement on digital input of a DAQ device, and then output an alarm sound using the computer speakers,  sending at the same time a message of intrusion.
Background:
A Passive InfraRed sensor (PIR sensor) is an electronic device that measures infrared (IR) light radiating from objects in its field of view. PIR sensors are often used in the construction of PIR-based motion detectors (see below). Apparent motion is detected when an infrared source with one temperature, such as a human, passes in front of an infrared source with another temperature, such as a wall.(source)
Pre-Requirements:
Labview and DAQmx softwares  installed in your PC, and the DAQ device duly working, and recognised by Labview.
Required Equipment:
NI Labview 2010 Student
NI DAQmx 9.0.2
NI USB-6009 DAQ device
PIR movement sensor C-7288 or similar
Wiring leads

Basic Knowledge:
It is required to have basic knowledge in setting up a simple VI, such as the VI in the project Internet Control of a Labview VI.
The PIR Connections:
The Labview VI:
Build a Labview VI such as shown below. It uses an email SubVI that sends an email notification using SMTP service:
The Labview VI and all the components are available here.
Before Running the VI:
You need to have your DAQ Assistant function correctly set for your DAQ device. Check the above mentioned project Internet Control of a Labview VI.
Next, you need to open the Email_alert_subVI.vi contained in the zipped file just downloaded. You need to set up the SMTP details correctly.
Test the subVI running it, and checking whether you receive the email sent by the subVI.Please note that you have to be online to test the subVI.
 In order to make default the set up constants of SMTP, make current value default in the Block Diagram (e.g. for Sender’s Name constant, right click onto it with mouse, choose Data Operations, and next choose Make Current Value Default, and so on for each constant).
After setting up all constants, save the subVI, and open it, and check if the values you have chosen are shown on your subVIs’s Front Panel. Double check, testing again the subVI ensuring email is sent to you by the subVI.
How it works:
When running continuously the VI, the DAQ device detects motion with PIR sensor. The detected signal generates a 400Hz sinal that is sounded in your PC speakers, and the Intrusion LED on Front Panel of Labview VI is switched on.
The detected signal sends an email alert, using the subVI already set up by you with your SMTC account detals.
The alarm latches, and can be only stopped if you reset it by pressing the RESET button on the Front Panel. After resetting the VI will be ready to detect any new motion.
Tips and Tricks:
  • You can modify the VI in order log each intrusion time to file using a ‘Write To Spreadsheet File.vi’ express VI. There are plenty of examples on Internet on how to do it.
  • Expand your application by integrating more logic into the VI.  Possible scenarios might include a wait of a few seconds after clicking run to give you time to exit your home before the alarm starts to detect motion.
  • You can sent text messages to your cell phone using email to text servies (SMS) such asClickatell, and many other such services. Normally these services are not free, but they are reliable. They all allow free credit to test your system.
  • You can add an arming feature with keyboard input such as the Home Alarm at Student Projects page  found here.
  • You can also add webcam as a motion detector and record any intrusion. You can find a tutorial with Yawcam. The system will send you also a text message (SMS) making use of a cheap webcam. Press here to see the tutorial.
Acknowledgments:
A special thanks is due to NI Developper Zone for inspiration. The actual project is based on article Dorm Room Alarm System Using a PIR Motion Detector, and following resources:

2 comments:

  1. Nice post physics students. To know more about alarm systems in detail, please visit our site:
    www.alarmsystems1.com

    ReplyDelete
  2. Wow that's really great information about home security system. Professional wireless burglar alarm security system is best ways to protect your home and family from burglaries. You can monitor your home premises 24/7 every minutes from anywhere even you are not at home. You do not missed any visitor footage. Its really helpful for everyone.

    ReplyDelete