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

Microsoft release Outlook.com email services to replace Hotmail

Today Microsoft released its new email service Outlook.com to replace its Hotmail brand. This new streamlined Metro interface design looks good and functions well so far. You can use your existing Microsoft account to log in and then choose an email alias (i.e. douglaswelch@outlook.com) for your new email address. Here are several articles that discuss Outlook.com... Goodbye, Hotmail; Hello, Outlook.com [REVIEW]  Outlook Is a Completely New, Feature-Filled Webmail Service from Microsoft Go Get Your @Outlook Email Address Quick Before Someone Else Does I will post links to more articles and reviews as they appear.

Shared calendars are one part of an organized family

by Douglas E. Welch , techiq@welchwrite.com 206-338-5832 Reader/Listener Line As a parent with a school-age child, I often hear other parents bemoaning their disorganized existence. Along with the busy schedules of two working parents you might have art classes, karate classes, Little League, soccer and more. Add in more than one kid and organizing your life can quickly become a nightmare. This is exactly why one of my most important organizing devices is a shared calendar that reflects all the activities and events for everyone in the household...and I do mean everything. If someone -- is required to be somewhere -- at sometime, it goes into the calendar. If we are given a calendar that reflects all the events for a particular activity (say, Little League), all these events immediately go into the calendar, along with notations on whether we are providing the team snack, working in the snack bar, etc. Even events that occur anytime during the day, like family birthdays, and other rem...

Google Docs adds templates

I have started to move away from using Microsoft Office (Word, Excel, Powerpoint, etc) in favor of online tools like Google Docs . Even as a computer consultant, I find that I use probably less than 10% of the features in any of these projects. One feature I really like in Google Docs is the easy, online file sharing that also allows you to edit simultaneously with someone else. Today, Google Docs added some templates including business cards, brochures and more. At the moment, it looks like they are rolling out this feature over time, so you might not yet see the templates on your account. When available, you will find the templates under the New... menu item. From Open Loops ... Today, Google quietly rolled out a new feature for their Google Docs Applications: Templates! It's so new that it isn't even listed on the new features page at this time. When one opens their Google Docs account and chooses to start a new document, a new "From Template..." command is pre...