Motion Activated Security Camera Using Intel Edison

Introduction: Motion Activated Security Camera Using Intel Edison

The goal of this project is to make a security camera which is turned on by a motion senor. A Passive Infra-Red (PIR) motion sensor continuously monitors for any motion in its field of view. When a motion is detected it causes a USB camera to capture an image. This picture is sent to the user's email over WiFi using Intel Edison’s integrated WiFi module. This security system is suitable for both residential and commercial security systems.

Step 2: Installing Intel Edison Board Drivers and Flashing Firmware

Intel Edison's firmware is usually updated weekly. So, it is a good idea to update the firmware to ensure you face fewer firmware bugs.

To update the Edison firmware to the latest version, go to Intel® Edison Board Installer and select appropriate operating system to download the IOT Design Kit installer. Open the Installer and it will take you through the steps to update Edison drivers and firmware. It also allows you to install IDE of your choice for programming Edison. You can choose from Arduino IDE for Edison, Intel XDK IoT Edition, Eclipse. For this project, we did not use any of these IDEs. The code is written in node.js in a text editor like vi and run on Edison terminal through SSH.

In case you prefer to update firmware manually, or the Intel Edison Board Installer did not work as expected for you, you can follow the instructions from here to manually install drivers and update the firmware http://www.intel.com/support/edison/sb/CS-035286.h...

Step 4: Connect the PIR Motion Sensor to Edison

We are going to use GPIO pin 6 on Edison Arduino expansion board to connect the output of the PIR sensor. The VCC of the sensor is connected to 5V on arduino expansion board and GND of the sensor is connected to the GND of the board. Please refer to the image above to make sure you have the right connections.

Step 5: Install NodeMailer

We started with the instructable Intel Edison Intruder Alarm by A_Steingrube and improved upon it to send picture taken by the Logitech USB camera as an email attachment. We will need NodeMailer to send emails.

To install Node Package Manager and NodeMailer package on your edison using the following commands.

And then cd into your root directory and use the following command to execute the javascript.

cd /home/root/
node securityCamera_instructable.js

Tada! you should receive an email as shown in the picture!

If you are using Gmail for your demo, you might see that the emails from your Edison are blocked after sending 100-150 emails. That is because Gmail limits the number of emails you can send in a day. We used Yahoomail to get around this issue at the Austin Mini Maker Faire 2015. Yahoomail allows you to send ~100 emails every hour. Alternatively, you can set-up your own email client to get around this issue. Also, you can decrease the email frequency in your code by adjusting the following line

setTimeout(periodicActivity, 30000);

But this also requires the user to be more patient to see the email output.