Temperature logging with Python and MongoDB

I’ve been working on setting up a database to record temperature data from my apartment. Right now i have a DS18B20 connected to my spark core and i use spark.variable() to get the temp data to the cloud.

From there I use a python script to pull the data off of the spark cloud and store it with MongoDB. Both the database and the python script are running on a BeagleBone Black running Ubuntu. So far its worked out pretty well especially since the spark core can now recover from the CFOD.

I’m also working on a script to generate graphs after pulling the data from the DB. My ultimate goal is to be able to serve those graphs to a webpage that i can view from my browser on or my phone.
you can find the source files here on github.
here is a sample graph with a simple moving average applied to smooth out the data.

I know I could pretty much get an identical service from a source like Xively but I’m having fun and learning a lot by programming it myself. Feel free to offer suggestions or submit pull requests on github if you actually use it. I’m neither a programmer or a web developer so help is always appreciated!

Hi, why don’t you use plotly.com ? It’s a very nice cloud plot service.
You just send your measures this service ( there are arduino, python, etc wrappers ), then configure de data and share it.
I did it and share with some friends the temperature inside my car in a sunny day ( 176 degrees Fahrenheit ).
There are some limitations on the free version ( number of update per day ), so I uploaded all the data at once ( using python ). Have fun !

Elastic search with kibana?

@Blacksheep thanks! that looks very cool. So the best way to get that working would be to replace my MongoDB with an elastic search DB? do you think the overhead is similar to mongoDB so i could run it on my BBB?

got a website running! you can check it out here:

temperature graph

The password is 1234
Still super basic but its at least functional. The source code is in the GitHub.

1 Like

Elastic search depends on the data you’re using - only trouble is its java so not sure quite how well it’ll work.