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

On my iPhone…IFTTT (If This Then That) for iOS

IFTTT (If This Then That) for iOS IFTTT (If This Then That) for iOS My best description of IFTTT, both their main web site, and this new iOS app is "a scripting language for the We." It allows you to set up "recipes" that watch one particular service, like Feedly, Evernote, Gmail and more, and then take action on another service whenever a particular action occurs. I use this to automatically save my shared items from Feedly and elsewhere into an Evernote Notebook and also use it to post automatically post information on a variety of services. The iOS app adds to this functionality by allowing you to take various actions on your phone and triggering IFTTT actions whenever they occur. In the case of the iPhone, initiating actions can include adding new contacts to your iPhone, taking a new picture and more.  For more complete information on how IFFTT works, visit ifttt.com    From the iTunes App Store... " Put the internet to work for you. IFTTT lets y

Audio: Social Networks - LIVE from the Library Internet Seminar - November 8, 2007

This night we talked about social networks, the Writer's Guild Strike, traditional media and the future of new media. Listen to this seminar Links discussed in this seminar: MySpace - Add me as a friend in MySpace Facebook - Add me as a friend on Facebook LinkedIn - Connect to me on LinkedIn YouTube - Watch my videos on YouTube Ning.com Jott.com Garden Fork TV The Minimalist with Mark Bittman quarterlife Blogger.com Wordpress.com Mixergy.com The Wish Book Holiday Podcast Project

This DIY domino clock tells the time using three LED-lit tiles via Arduino Blog

After coming across Carbon Design Group’s Domino Wall Clock, which uses electronic magnetic coil motors to reveal white dots, Instructables member “Kothe” decided to create a simplified version of their own. The clock is comprised of three custom dominoes — the first tile for hours, the second and third for minutes. Unlike its inspiration, Kothe’s device uses addressable RGB LEDs as dots that allow for a variety of colors to shine through. Read This DIY domino clock tells the time using three LED-lit tiles via Arduino Blog An interesting link found among my daily reading