That’s what I did this week, as my wanderings into wireless data collection continue: Post the temperature and humidity from my little experiment to a table at data.sparkfun.com.
Here are the steps as things stand now:
- The sensor reads the data (as in my original post).
- The Ardunio formats a message and texts it with a Fona (wiring details here, updated code here).
- Instead of texting to Twitter, it now texts to a phone number I bought at Twilio for $1/month.
- Twilio then relays that data to my project server in the Amazon cloud as an http “POST” (deets on setting up a cloud server here).
- My project server parses the text message, composes a URL with the data, and hits the Sparkfun open data system with that URL (code for that is here).
This all happens in just a few seconds, every 20 minutes.
I like sending data via SMS text. It feels simple and clean, and it’s actually not that complicated. But there are some ways this could be simpler.
One is to stop after Step 3, the text to Twilio. Twilio actually logs every incoming text, including the time and contents, which one can download as a csv. It’s available only to the Twilio account holder, so it’s not public like the Sparkfun table, but it’s got all the information right there and is timestamped, too.
Another way is to skip both Twilio my sever entirely and at Step 2 have the Arduino and Fona use a cellular data connection to hit the Sparkfun site all by itself. The Arduino would need to compose the URL and then basically open an internet channel to use it. That’s what Kina Smith did here (see the
sendURL function). I definitely plan to give that a whirl.
I’m also excited that the low-power tricks I’m using in my Arduino code have kept this little box running for a couple of weeks now … and the battery has barely drained at all. I’m tempted to let it keep running until it dies, just to see how long that really is. At this rate, it could be a couple of months!