Monitoring your developer health with an ANT+ sensor
The new venue (Leeds City Museum! A night in a museum!) played host to roughly 120 people for the creation of 35 hacks, amongst them, myself and Wes from the Server Density team. Although entered as a team, Wes and myself had very different aims in mind (watch for the upcoming post explaining what he did, and how he did it).
I’ve been playing recently with the idea of using the same sensors that I use for cycling, but with a desktop machine, the eventual aim to create a ‘health monitoring’ box, probably based on something like the Raspberry Pi. Going into the event with nothing more than the knowledge that someone had written a python library that should talk to an ANT+ sensor, I thought I’d like to get something together based on the Heart Rate sensor strap.
7 hours, and a patch to the library later, I had a console that would tell me that I have a rest heart rate of around 75bpm. Not sure if that’s affected by the amount of caffeine based drinks I’d had by then, but it probably is….
From that beginning, I created: developerhealth. This is a collection of small programs (an OS X based git post-commit hook, a Linux based Heart Rate Monitoring daemon, and a web app based on Flask, all backed by a MongoDB database).
These combine to create something that looks a little like this:
The yellow line is my heart rate, updated every 10 seconds, including spikes where I stood up and walked around. The blue dots are git commits to the repository, posted to the site via the post-commit hook. The hook also takes a picture, and records your current location, which is visible on the details page (which I don’t have a screen shot of unfortunately).
That was basically it! 24 hours to make and present something (in 90 seconds). I’m quite happy with the end result, it worked for the demo and achieved what I wanted it to. The code isn’t great, it’s reasonably complex to setup and run, and it’s probably not something I’ll ever need again.
As a bonus, I created a Server Density plugin, that will post your current heart rate to a Server Density graph. Again, mostly pointless but entertaining if nothing else.
Final shot, the effect that presenting your hack to 120 people can have on your heart rate:
Code available on GitHub for those wanting to try it. Patches gleefully accepted.
Enjoy this post? You may also like How to build stunning custom iOS graphs on iPhone and iPad