This year at Connected Environments we have dedicated Fridays as ‘hack-days’. The rules are fairly simple: “build something using Pachube and eat food”. During the first one I decided to play with an Arduino as I had never touched one in my life. I also had no idea what a circuit was.
After a quick download and install of the Arduino IDE (plus the USB driver for OS X), Neill gave me an introduction to circuits, resistors and resistive sensors. We also drew fake electronic symbols and probed our surroundings with multimeters.
Playing around with some of the sample projects in the IDE quickly shows how easy it is to program the Arduino and what an incredible platform it really is. We soon built a crude circuit that modified an LED’s intensity based on the ambient light reading.
Time to talk to Pachube
The idea was to register an account on pachube.com, create a new feed and have the Arduino send the light sensor reading directly to Pachube using our api key.
To my surprise and slight embarassment, I discovered that the Arduino IDE comes with sample code for connecting an Arduino with an ethernet shield to Pachube. In fact the example code does everything required.
As my sensor reading was being made over analog 0, the only modifications made to my script were to enter the feed id, my api key, plus the mac address and ip address of the ethernet shield.
Note: a couple of things threw me: the sample ip address is 192.169 instead of 192.168 and Pachube’s ip address has changed to 220.127.116.11 (even though we’ve kept the old one). We’ll try and get this updated in a future releases of the Arduino IDE.
Attach a battery and a weatherproof enclosure and you have the beginnings of an internet enabled weather station.