Presented here is a simple and inexpensive PC- based home security system. It uses a simple interfacing circuitry, and is developed using Perl and Shell scripts and tested on Linux (Ubuntu 9.10) environment. The computer should be connected to the Internet, webcam, speaker and microphone. The door bell switch in the interfacing circuit activates the webcam, speaker and microphone.
Fig. 1 shows the block diagram of live home security system. The webcam, speaker and microphone are fixed near the front door at a particular orientation for optimal recording. When a visitor rings the bell by pressing the door bell switch, his image is captured by the webcam. The speaker plays an audio asking the name of the visitor. The visitor’s voice (name) is recorded in the PC through the microphone. The captured image and audio files are sent to the e-mail ID of the house owner. The house owner can receive and access these files in his smartphone with inbuilt e-mail client within seconds from anywhere.
Apart from Ubuntu operating system, you need the following software to be installed in your PC:
Mplayer. To play the audio. Mplayer is a free and Open Source media player. It is available for all major operating systems, including Linux.
arecord. To record the audio. arecord is a commandline sound file recorder for the ALSA soundcard driver. It supports several file formats and multiple sound cards with multiple devices.
Streamer. To capture the image. Streamer is a versatile program that allows capture from a webcam or video device using only the command line in Linux.
xdotool.
To control the keyboard shortcut from the command line in Linux for Thunderbird (e-mail client). xdotool allows programmers to emulate keystrokes and mouse actions.
Thunderbird. To send an e-mail to the recipient’s e-mail ID.
Project description
The interfacing circuitry is shown in Fig. 2. It is built around a 555 timer configured in monostable mode. The circuit does not require external power supply. It is directly driven by the 5V supply received from the USB of the user’s PC. When the timer is activated, it connects the USB webcam with the PC for 10 seconds—set as per the time constant of the monostable multivibrator (T=1.1×R2×C1). The loop.pl code given at the end of this article runs continuously in the PC to check whether the webcam is connected or not.
Before running the application program, you need to execute ‘lsusb’ command, which lists out the number of USB devices connected to your PC. In the list, you can find the webcam device name (Logitech in this case). Each USB device connected to a computer will have a vendor ID and a product ID