My friend @holadiho wrote a few times about his Spark Core gadget in the past. The Spark Core is a tiny arduino compatible computer that has wifi and a cloud connection build in. Where you have to jump trough a few hoops to connect your Arduino to the Internet and publish data to a cloud the Spark does that for you with only a few lines of code.
What finally pushed me over the edge to cross the aquesition resistance (“Anschaffungswiderstand” TM “@boerge30 was an offer from the Berlin based Tinkersoup maker shop. They offered a so called “Tinkercup” based on the Spark Core.
But what happened then made me chuckle…
OK, sorry. This was a very bad teaser 😉
As a regular coffee drinker I surely had to get this one. It was supposed to publish information about the coffee temperature and amount of cups to the tinkercup web page. While that was certainly a nice and total useless gimmick I quickly converted my Spark into my usual climate logging device.
From other projects I still had a digital temperature and pressure sensor (MPL115A2) and a digital temperature and humidity sensor (DHT22). Connecting them to the Spark core was actually the easiest thing and to publish the readings to the Spark Cloud.
The more difficult part was the display in some RRDGRAPHS (RRDTOOL is one of the coolest open source software of the whole internet for graphing metrics against time). A few lines of Python code were sufficient to read the values from the Spark cloud and update an RRDFILE. Another few lines create some standard RRDGRAPHS from the readings.
But I saw some fancy sourcery on the web with RRDGRAPHS to display a visualization of twillight and sunset & sunrise in the RRDGRAPH. That challenged me to add this to my graphs as well. The original source I found used a shell script and a Linux binary to calculate and generate the graphs.
I wanted this to be in a single Python script. So a bit more research was needed. But finally I found all the components and tossed the code together.
There is certainly room for improvement but for the first shot I’m pretty happy with the results.
The latest addition is an analog photo resistor to get a reading of the light intensity. It’s far from being an accurate measure, but it nicely correlates with the other values and of course the display of sunrise & sunset.
You can find the code and some description of this project in my Github page
After all I have to say the Spark core is really a nice and affordable little toy. For a little more than a bare Arduino uno you get WiFi connection and a basic cloud. For personal projects that’s quite a lot you don’t have to explicitely worry about.