Skip to main content

Arduino Life 4: Visualizing Your Project's Data with Ubidots

Back to the basics with my learning project, a temperature, humidity and light level sensor with the Arduino Yun.

While text printouts to the Serial Monitor, viewing text files via SSH and login the data to a Google Spreadsheet are fine, wouldn’t it be cool to be able to see your project’s data visualized in near real time? Sure it would. 

Enter Ubidots, and IoT (Internet of Things) visualization service that can receive data from your Arduino projects and graph it in a number of ways.

I was first made aware of Ubidots via this YouTube video from Acrobatic - Visualize Sensor Data Using ESP8266 (ESP-12E)

While I haven’t yet made the jump to using the ESP8266 myself, it was introduction to Ubidots as a service. They have a variety of libraries and code examples for connecting your Arduino projects and, in my case, there was a specific library for the Arduino Yun. While this library worked fine for sending 1 variable of data to the service, I ran into significant problems when I tried to send the 3 variable from this project (Temperature, Humidity and Light Level). If I added a second variable, the sketch would seem to hang when it connected to the Ubidots API.

Thankfully, a quick message to the Ubidots forums resulted in an updated library only a day later, and now — as you can see from the screen shot below — all 3 variables are being received and graphed.

Ubidots

Using the Arduino Yun Library made it exceedingly easy to send my project data. I only needed to include the library...

#include <UbidotsYUN.h>

Define some constants for my API key and the key for each variable I was sending.

#define TOKEN “API Token Here"
#define TEMP “Variable Token Here"
#define HUMID "Variable Token Here"
#define LIGHT "Variable Token Here"

Start the Ubidots library

Ubidots client(TOKEN);

Initialize the Ubidot client

 client.init();

Then send the current data along to Ubidot each time through my loop

// Update Ubidots
client.add(TEMP, temperature);
client.add(HUMID, humidity);
client.add(LIGHT, lightlevel);
client.sendAll();

Complete Sketch Available Here as Ubidots.txt

Once I had a working Arduino library from Ubidots, it was easy to add these statements to the project and start feeding data.

On the Ubidots side, before you make your first call to the Ubidots API, you set up a “Data Source”. A Data Source is a collection of variables from a specific project. This creates the necessary variable tokens you need to include in your sketch that connect each piece of data in your sketch to a specific luggable and graphable piece of data in the Ubidots Dashboard.

Ubidots data source 

Ubidots data source detail

Once the Data Source is set up, you can set up your dashboard with various widgets to present the data however you wish.

Ubidots

Here I have set up 2 widgets for each of my variable — one showing a current gauge of the data values and then a bar chart of recent data. You can change the scales on either access to show more or less data or set your own min/max data levels to get exactly the graph you want. Other widgets include Metrics — showing Min/Max, Averages and more — Maps, if you are using GPS or measurement data — Tables — and Control buttons.

Give Ubidots a try as a front end for your next Arduino IoT project and I think you will be pleasantly surprised with its features.

Please send along your questions and comments.

Comments

Unknown said…
Great work! I made something similar to your project and made the data available to Android smartphone http://www.survivingwithandroid.com/2015/12/internet-of-things-project-arduino-ubidots-android-2.html

Popular posts from this blog

Onion Pi makes your web traffic anonymous via Open Electronics

Hmmm, might be an easy (and relatively cheap) way to play around with Tor and learn a bit more about this anonymizing service. -- Douglas Adafruit’s Onion Pi is a Tor proxy that makes your web traffic anonymous, allowing you to use the internet free of snoopers and any kind of surveillance. Follow Adafruit’s tutorial on setting up Onion Pi and you’re on your way to a peaceful anonymous browsing experience. Tor is an onion routing service – every internet packet goes through 3 layers of relays before going to your destination. This makes it much harder for the server you are accessing (or anyone snooping on your Internet use) to figure out who you are and where you are coming from. Read Onion Pi makes your web traffic anonymous via Open Electronics * A portion of each sale from Amazon.com directly supports our blogs ** Many of these books may be available from your local library. Check it out! An interesting link found among my daily reading

How to Build a Raspberry Pi-Powered Digital Photo Frame via Tom's Hardware

A digital photo frame is a small screen that can sit on your desk in your office or in your kitchen displaying your favorite pictures, changing at regular intervals. The first commercial digital photo frame was introduced in the 1990s shortly after the digital camera. Digital photo frames made a comeback in popularity during 2020, perhaps because people were staying at home more. In this tutorial, we’ll turn our Raspberry Pi into a digital photo frame using MagicMirror and the GooglePhotos module. Please note, we will skip installation of the 2-way mirror in the original Magic Mirror project. Consider this project, “Magic Mirror, without the mirror.” Read How to Build a Raspberry Pi-Powered Digital Photo Frame via Tom's Hardware An interesting link found among my daily reading

On my Mac/Windows PC…Disk Inventory X/WinDirStat

Disk Inventory X | WinDirStat   There comes a time in every computer user's life when they need to figure out why their hard drive is out of space and Disk Inventory X and WinDirStat are a great help. Their operation is pretty straightforward. Look at the hard drive directory and see what is taking up the most space. Then allow the user to prune, backup or other remove these files to free up some space. Simple, effective and very, very useful when you need it. Free Previously in On My Mac... iMovie Tweetdeck Celtx Scriptwriting Software LogMeIn Kindle Reader MarsEdit Blog Editor Cyberduck Minecraft Dropbox Garageband MPEG Streamclip Google Chrome Evernote On My Mac/Windows PC is an on-going series highlighting the software (and sometimes, hardware) I use on my Mac nearly every day. Look for additional On My Mac…posts in the coming weeks! -- Douglas