AT&T Hackathon Dallas 2014 - M2X Category Winner
This project was created as an entry to the AT&T Hackathon on Feb. 21 and 22nd, 2014 in Dallas, TX.
This project was built from a Sparkfun Inventor's Kit and a Raspberry Pi.
From the provided kit, we used the SparkFun RedBoard (Arduino Uno equivalent), temperature sensor, photoresistor, piezo speaker and LCD.
The goal of this project was to create a portable sensor unit that can detect useful data for plant growers such as light levels and temperature. The unit, wirelessly connected to the internet, then relays data back to the AT&T M2X servers where it's stored for analysis.
The temperature and light logs are graphed in real time and this data is viewable immediately. We're also leveraging another feature of M2X called 'triggers' that sends alerts based on user defined conditions. For instance, if the temperature gets too hot. We're using a web-service called requestb.in to catch those alerts from M2X for us. When a trigger is caught, we print an alert to the unit's screen, play a sound and send a text message.
- tem.py - this reads the arduino's serial port for sensor updates to push to M2X
- tempy.ino - this code is compiled and run on the arduino
- triggers.py - this polls requestb.in for updates to our triggers on M2X
- schema.sql - the definition file for the sqlite phone number database
- m2x-screenshot.png - screenshot of our data graphed in the M2X dashboard
The Arduino code gathers the sensor data and waits for user input to react to the alerts.
The Raspberry Pi runs two Python scripts, one that pulls data from the Arduino and one that sends a text message and tells the Arduino to alert.
The Arduino is plugged in to and powered over USB by the Raspberry Pi. The Raspberry Pi, with a WiFi dongle in it's second USB slot, is then plugged into the wall. It could just as easily be set up to run off of batteries.
We also setup a local SMTP mail server on the Raspberry Pi to send text messages as emails to AT&T phone numbers at @txt.att.net.
This code is free to be reused and repurposed under the MIT License.