Ever wanted to catch the elusive Santa Claus? Now you can with a Raspberry Pi and a USB webcam. The Pi sends an email or text to whoever you designate.
This is a continuation or evolution of my previous project: The Raspberry Pi Texting Alert. Now, it can turn on a light right before taking a picture and then turns it off after the picture has been taken. In the code, pin 4 gets hooked up to the PIR sensor, and pin 17 gets attached to a transistor. The relay is triggered by 5v logic, and since the Raspberry Pi can only supply 3.3v logic a transistor must be used. A light of your choice can be plugged into the relay module and be made to illuminate the fireplace.
The system can be easily set up on a shelf or a stand, because it only requires 2 outlets. When the PIR sensor is tripped the code I'll delay for 20 seconds, allowing for a non-spamming Pi. The image file gets stored as a png and gets rewritten each time the sensor is triggered. The image is then attached to the main message and sent via your gmail account. The email can also be formed into a text by replacing the "TO" portion with a carrier multimedia text message address. For AT&T, it is "5555555555@mms.att.net
", replacing the 5s. This will allow you to send our email as text message in case the recipient can't access their email.
Comments