Arduino data logger: use Xively platform in IoT project

This post describes how to create an Arduino data logger. Using Arduino data logger we want to send data (retrieved from sensors) to Xively IoT cloud platform. This platform is very interesting and provides several useful features in building IoT projects.
This tutorial explores how to implement an Arduino data logger system. As said, in this example, we will connect Arduino to Xively and we acquire data using sensors. At the end, we will explore how to create a dashboard using the data collected.
Before starting it is useful to look at Xively IoT platform.

What is Xively Platform?

Xively is an IoT cloud platform that is “an enterprise platform for building, managing, and deriving business value from connected products”. Moreover, it provides a cloud-based API with an SDK that simplifies the development process. It supports several prototyping board and technologies:

  • Android
  • Arduino
  • Arm mbed
  • C
  • Java

and much more. Please, refer to their library web site to find more information. In other words, Xively is a Paas(Platform As a Service) that exposes its services via RESTful APIs.
Moreover, Xively supports messaging service based on MQTT protocol.If you want to have more information about this IoT platform read Xively Architecture. In this IoT project tutorial, we will use the free Xively account.

Arduino data logger

Now we know a bit more about Xively and the services it provides, it is useful to start the IoT project: Arduino data logger. As an example, we will build a simple system that monitors the plant status health using a set of sensors that help us to measure environment conditions and the soil moisture.
If you remember, we already explained this project in a previous post called “Smart plant system“. In this post, we will explore how we can achieve the same result using a different IoT cloud platform.

Arduino data logger
This IoT project uses Arduino Uno and a set of sensors:

  • DHT11: Temperature and humidity sensor
  • TEMT6000: Light intensity sensor
  • YL-38 + YL-69: Soil moisture sensor

We want to send all values read from these sensors to Xively and create a dashboard so we can monitor these parameters.

I'm creating my IoT project with SwA tutorial Click To Tweet Xively uses some basic concepts:

Xively device:It is your “device” or the IoT project you are building. Consider it as an envelope containing the data.
Channels: It is the streaming coming from your sensors. Usually, the channel number is equal to the sensor number (as long as you want to monitor them all).

So the first step is adding the “device” to our account:
xively device setup

Then we define the channels. In this example we have 4 channels as it is clear in the picture below:

xively channel config

That’s all. Now you have to use the Xively library for your device (in our example Arduino Uno) and start sending data to the cloud.
The code is very simple:

Please notice that the sketch defines a XivelyDatastream that holds the four stream we send to Xively platform.
Each channel defined previously using Xively interface corresponds to a XivelyDatastream. Remember to use in the data stream the same name used in the Xively interface.
Now if we upload the sketch to Arduino and run it, we will notice that Xively receives the data:

xively cart
xively cloud data
xively sensor data

Connect Xively to

Once the software part is ready and working and the wiring aspects are defined the last step is analyzing how to create a dashboard using the data stored in Xively.
To this purpose, we will use This is a free IoT dashboard tool that can be integrated with Xively easily.
It helps us to represent the information stored in Xively using charts.
The first step is connecting to Xively. This can be done easily using API Key provided by Xively.

freeboard xively integration

Now it is very simple to create charts connecting them to the Xively channels covered before. add chart

At the end, you can create your dashboard:

IoT dashboard

At the end of this post, hopefully, you gained the knowledge about how to create an Arduino data logger system. This system can be used to send sensor data Xively platform.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.