Arduino + DHT11 + Serial + PC + Python + Gspread = Logger

I have really wanted to get into the ESP8266 area but am still learning about how to implement so to get some mental excercise, I thought I’d use the native serial capacity of arduino with python’s serial library to upload to a google sheet.

I had originally envisioned maybe a server closet datalogger since the server is on anyway and can process and upload the data at routine intervals.

This project was interesting because it required C implementation for the arduino (which was the easiest part), python to parse the data and upload it to google sheets and the really useful gspread python library.  For me, it was the most moving parts of any project I’ve made thus far.  I’ll expand on the code below, but I wanted to show the early resulting output.  A Gsheet that can be accessed from anywhere to look at local conditions.

 

logger

Click Image for Realtime Data

Arduino is not for quitters

I was originally using a for loop to collect the data on a per minute basis.  This proved problematic with the midnight data reset so I simply used the old arduino c standby “while True:”  That and tweaks in the gspread authentication have greatly improved consistency on a q10 minute upload schedule with no timeouts.  I have some error handling built into a refactor but have not implemented yet…following “if it ain’t broke” mantra.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s