In this project you will be able to create a fully functioning alarm system. It alerts you via text message whenever the sensor gets tripped. Let's look at what you need to put in the code.
First you will need your phone "e-mail" address. Carriers have a system in which someone can text you via email. Here is a list of some of the most common carriers' phone addresses:
- AT&T: email@example.com for a normal text message (SMS), or firstname.lastname@example.org for a multimedia message (MMS)
- Verizon: email@example.com for both SMS and MMS messages
- Sprint PCS: firstname.lastname@example.org for both SMS and MMS messages
- T-Mobile: email@example.com for both SMS and MMS messages
- Virgin Mobile: firstname.lastname@example.org for both SMS and MMS messages
Just replace the TO portion with your phone address. Now onto the Gmail user portion. The "GMAIL_USER" is going to be your Gmail account email address. Then put in for "PASS" your password. If you want to be more secure, you can set up an application-specific password in your Google Account Settings. Now load the code into your Raspberry Pi and enter: "sudo python the/file/location". That's it! Now you can have a cheap security system in under 30 minutes! If you're feeling extra ambitious, change the code to where it takes a picture with the Pi-Cam. I would really like to see what can be done with that. Thanks!