A month ago I got a Fitbit Ultra. It’s a small gadget that you carry around with you all the time to monitor your activity. How many steps you take, how many flights of stairs you go up, how far you walk, how much sleep you get and how restful it is, and much more. It also comes with apps and tools for monitoring stuff like diet and weight. And it makes all of this information available to you, both through a website and through an API.
This isn’t really a review – there are plenty of those about already if you’re interested (Of all the reviews I’ve read, The Verge’s review is the closest to what I would write if I was gonna write one). Instead, I want to talk about the fitbit from the perspective of a data-geek.
Before I start, it’s worth putting this in context. I am loving the fitbit, but I don’t pretend that it’s necessarily something you have to get. Put it this way – I used CurrentCosts to monitor my home energy usage on the web and on my mobile, I wrote code to find out which keyboard keys I press most often, I made a whole website to visualise patterns in what I watch on TV, I wrote code to make map visualisations of where I go with my mobile, I wrote code to use a webcam and face recognition software to measure how my mood changes as I watch different TV programmes or play different console games… I could go on (no, really), but you probably get the point.
I find this sort of personal data stuff fascinating. I’m not the only geek in the world like this – Stephen Wolfram wrote a great blog post last month about some of the stuff that he collects that really puts me to shame.
But when I say that I think the fitbit is awesome, just bear in mind where I’m coming from, okay? 🙂
In this post, I want to give examples of the data that it makes available, and what sort of things you can do with it.
Stuff I could do with fitbit data
I’m on holiday, so I’ve not put a lot of time into making something elaborate or considered with the API.
Instead, I’ve made a few quick mashups taking fitbit data and combining it with other data sources that I had readily to hand. My aim is to show the potential of this as a data source, and the range of data types that this little device makes available.
XBox vs Sleep
First up, starting with data from XBox Live. When I finish my work in the evening, I often play a few games online before heading to bed. The fitbit measures how long it takes me to fall asleep when I go to bed.
I took the number of minutes spent playing XBox immediately before bed, and plotted that against how long it took me to fall asleep afterwards, according to fitbit.
Does playing first-person shooter game Modern Warfare 3 make me take longer to fall asleep?
Erm… no. There’s no real pattern there.
Caffeine vs Sleep
One thing the fitbit showed me was just how much coffee and cola I drink. Does caffeine make me take longer to fall asleep?
I took the diet data from fitbit and plotted it against the number of minutes it took me to fall asleep that evening.
Nope. Even when I had the most caffeine, I fell asleep in under ten minutes. Ah well.
I thought it might be interesting to turn this around and try what I was convinced would give me a clear and obvious pattern – I took the number of minutes sleep I got in a night, and plotted that against the amount of caffeine I had the following day.
Did I need more caffeine on days where I’d had little sleep, and less when I’d had a good night’s sleep?
No. This wasn’t going terribly well.
Kids vs Sleep
This one is a bit of fun, and not really from an API. But it had to be a pattern.
I looked through my diary and made a note of all the evenings where the kids were with family or having sleepovers at friends, and plotted that against the number of minutes of sleep that I had that night.
Shock. I get more sleep when the kids aren’t home. 🙂
Sleep vs chattiness
How do I respond to getting more sleep? Does it make me more talkative? I used the twitter API to see how many tweets I sent a day, and plotted it against the number of minutes sleep I’d got the night before.
Is there a pattern there? Erm… don’t know. Don’t think so.
It was interesting that the day after I got very little sleep (I remember that night – Faith was very unwell) I only sent two tweets. One of them was probably moaning about getting very little sleep!
But the day after I got loads of sleep, I only sent a few tweets.
Sleep vs mood
If I still tweet as much however much sleep I get, does it affect what I say?
I ran my tweets through a simple sentiment analysis engine, classifying them as positive, neutral or negative. I then plotted what proportion of tweets ended up in each group, against the number of minutes sleep I’d had the night before.
Does getting not-enough sleep make me grumpier the following day? And if so, is this shown in my tweets?
Erm… no. Damn. I was really hoping to see that the more sleep I get, the more positive I get on twitter.
Maybe my grumpiness is unaffected by the amount of sleep I get. Maybe I just have a decent self-censorship ability online, and keep my grumpiness to friends and family offline. Or maybe the sentiment analysis classifier just wasn’t that accurate.
Exercise vs mood
But while I’m playing with sentiment analysis, what about looking to see what effect increasing exercise has on my mood (as measured by sentiment analysis on my tweets).
I plotted the number of calories that fitbit thought I’d burned that day with the proportion of my tweets that were classified negative vs positive.
Not much of a pattern here either.
To be fair, this is only data from a month. Choosing just two variables without a large enough data set to average out means that you can’t see the effect of everything else (e.g. sleep vs exercise?).
Maybe if I ran this again in another few months the data will have settled down a bit.
Sleep
You can probably tell from the list of the first few ideas that sprang to my mind that I was particularly interested in the fitbit as a source of sleep data.
I did a simple graph to show how much sleep I get on each day.
Look. I get more sleep at the weekend than I do during the week. Surprise! 😉
And a graph to see what time I go to bed based on which day of the week it is.
Other than showing that one Saturday night I went to bed before 9:30pm (I’m so rock-and-roll) there isn’t a lot to learn here.
Stuff you get out-of-the-box with fitbit data
I’ve not done much simple obvious stuff with the data, because you already get that on the fitbit website.
I thought I’d include a few examples to give an idea of what data gets collected and what can be done with it.
Stats
Basic information about how active I’ve been today.
Stats about the last week
Steps
How many steps have I taken each day over the last 30 days?
How many steps have I taken since I got the fitbit?
Distance
How far have I walked each day for the last thirty days?
How far have I walked since I got the fitbit?
Floors
What was the most flights of stairs I’ve walked up in a day since I got the fitbit?
Time spent active
How much of the day have I spent active, vs time spent sat down?
And what does this look like per day for the last thirty days?
Calories
How many calories have I burned over the course of today?
How many calories had I burned compared with how many I ate each day over the last 30 days?
How does the number of calories I burned compare with the number of steps I took each day?
How many more calories can I eat today? (Which varies in response to active I am during the day)
How many calories have I eaten today, and how does that compare with my food plan?
Weight
How much do I weight today?
How has my weight varied over the last 30 days?
Sleep
How much sleep did I get last night?
Sleep stats from the last thirty nights
How much sleep have I had per night over the last thirty days?
How restful was my sleep each night? (Spot the night when Faith wasn’t well!)
Water
How much water have I had to drink today?
Badges and achievements
Which badges have I achieved?
Which are the best badges I achieved?
What do I get when I achieve a new milestone?
You get the basic idea.
There is a ton of data here, most of it time-based, just waiting to be mashed up with other data sources and API. And it’s all very personal – it’s data about me and my body.
Playing with CurrentCost data raised my awareness of the impacts of my activity at home and influenced some real long-term behavioural changes. I hope that playing with fitbit data is similarly raising awareness of the impacts of my own physical activity, and will make some long-term behavioural changes in how active I am.
Even if it doesn’t, it’s a fun new source of personal data to play with.
Tags: fitbit
I assume you’re using libfitbit? have you published the code on github or anywhere? I’ve been meaning to MQTT-enable my fitbit (albeit on a batch basis, since it doesn’t sync unless it is near the base station) so I’m interested.
Looking forward to the new Fitbit scale they are releasing, too.
Incidentally, you might want to join the openyou Google Group as well.
I didn’t write a lot of code to be honest.
I didn’t need to go for anything as complex as libfitbit, as I’m not actually grabbing anything from the fitbit device itself.
Instead, I’m using the REST APIs
(https://wiki.fitbit.com/display/API/Fitbit+Resource+Access+API) to get the data from the website. The REST APIs return reasonably straightforward blobs of JSON or XML – the trickiest bit of it is doing the OAuth stuff, but there are client libraries (I went with Java) to make that easier.
I just wanted to play with the data, so I took the lazy approach – for each of the REST APIs, I grabbed everything I could and wrote it to a local CSV file. Then imported those into OpenOffice and manually made the graphs. I only have a month’s worth of data, so that is simple enough for playing around with ideas.
At some point, I do want to do a proper fitbit hack, though.
[…] | Recent Posts | Pages « | fitbit – a source of personal data […]
Very interesting. I’m tempted to get one but they’re a bit pricier than I’d like. On the other hand, you’ve shown that they’re very good value in terms of cost per graph…
Great article, convinced me to buy one for fun Dale. However, the device seems to fall down on the security side of things, sending its data with your fitbit serial number and password to the fitbit servers in plain text … http://www.openyou.org/2011/04/18/fitbit-and-security-or-lack-thereof/ has more. This could be a snag with it, plus the implication that it could be a handy stepping stone to cracking other accounts that you have linked it to once fitbit open up more access to other apps on their website.
Thanks very much. I hadn’t seen that stuff about the passwords sent in the clear, that was a little disappointing though 🙁
[…] I used face detection as a form of sentiment analysis to measure my reaction to TV viewing, I mashed up my fitbit personal activity data with stuff like sentiment analysis of my tweets, and I wrote an app that monitored my daily happiness. Better […]