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.

Tiny Wow - Tools That Solve Your Files Problem - Convert to/from many file formats [Shared]

A nice collection of quick, online tools, to convert to and from a variety of file types. Just the site to keep in mind when you need to shuffle one type data into a new system. — Douglas TinyWow & Your Privacy Don't you love finding a great online tool-set that claims to be free, let's you build and interact the way you want, only to be denied access if you don't pay for an account(or sign up for an account). Our site is free. We don't limit. We don't even take sign-ups. Might we take sign-ups one day? Sure, we probably will(but not any time soon). When we do go down that route, what we will NOT do is trick you into spending your time using our tools, only to be denied access before you can download what you have just spent your precious time creating. TinyWow is free. We don't have ads, we don't sell data. We currently have no plans to monetize. Why offer these tools for free? We operate two tech websites: Alphr & TechJunkie. We thought our use

TechIQ Gift Guide #15: Sams Teach Yourself Wordpress 3 in 10 minutes

#15 Sams Teach Yourself Wordpress 3 in 10 minutes Chuck Tomasi , fellow Friends in Tech member and co-author of Podcasting for Dummies , along with another Friends in Tech member and podcasting partner, Kreg Steppe , have a new book out that would be a great gift for anyone interested in blogging and New Media. Wordpress is my first recommendation when someone wants to get started with blogging, but it can be a little intimidating. It is very powerful and with power comes complexity. That said, this book can help to jumpstart your Wordpress knowledge and help you be productive. There is also a companion podcast to the book, Wordpress in 10, available from the author's web site. From Amazon.com... "Sams Teach Yourself WordPress in 10 Minutes gives you straightforward, practical answers when you need fast results. By working through its 10-minute lessons, you’ll learn everything you need to build great blogs with WordPress and WordPress.org, and reach any audience by web brows