Thursday, October 3, 2013
Moved to new Website
Hi, I wanted to let you know, that this Blog has been moved to talk2machines.com
Monday, August 26, 2013
LED Matrix connected to the Internet
The M2M Developer Community offers an example web application for the DevStarter Arduino package. Here you can see your light sensor data as a graph. You can also create an operation which will be executed by the Arduino.
To test this web application, a "DeviceControl" sketch is included in the Cumulocity Arduino library. The string you type in the web interface will be received from the Arduino GBoard and send via the serial connection to your computer.
I wanted to find a practical use for it. So I got a few LED matrices and Rainbowduinos to control them.
For the communication between the GBoard and the Rainbowduinos I included the Wire library in the device control example sketch. Unfortunately I run out of RAM after a short time so I had to search for a solution. I found out, that there is a more efficient library for the I2C communication than the wire library. There is an I2C library on Github. I changed some things that it fits my needs and saved it on Bitbucket. The GBoard code is here.
If you want to test the application you just have to go to https://developer.cumulocity.com/ui/arduino/
and log in with your M2M Developer Platform credentials. Then you have to look for the right device and in the "Device Control" section you can type something and send it to the Arduino. After a short time it will show up on the LED matrix.
To test this web application, a "DeviceControl" sketch is included in the Cumulocity Arduino library. The string you type in the web interface will be received from the Arduino GBoard and send via the serial connection to your computer.
I wanted to find a practical use for it. So I got a few LED matrices and Rainbowduinos to control them.
Problem with the small RAM
![]() |
| The simple Setup |
If you want to test the application you just have to go to https://developer.cumulocity.com/ui/arduino/
and log in with your M2M Developer Platform credentials. Then you have to look for the right device and in the "Device Control" section you can type something and send it to the Arduino. After a short time it will show up on the LED matrix.
Possible Use Case: Extension of the Plant Demo
Until now, this is not really a practical use case. It is just a demo. To use it more practical I could display the sensor data of my plant demo (temperature, moisture and light). If there is something wrong, maybe the moisture is to low, I would display an alarm.
The alarm would be fast and easy to implement. All that I need to do is to include a function that creates an operation if the moisture is to low. This would be done on the device which collects the data.
The alarm would be fast and easy to implement. All that I need to do is to include a function that creates an operation if the moisture is to low. This would be done on the device which collects the data.
Update - August 28th, 2013
I just noticed, that it is not possible with the Cumulocity Arduino Client to create an operation. So I had to extend this library that I can send an operation to the M2M Developer Platform. The modified library is on Bitbucket. Or you click here to Download the latest version as a Zip file. I also included an example where you can test this new feature.
Thursday, May 16, 2013
Helping our Office Plant with an Arduino (Part 2)
In part 1 I told you about the first try, to measure the soil moisture with two nails. But until now, this isn't a connected device. To bring my data into the cloud I used the Gboard, which is a Arduino based board with a GSM module. I used this, because it is cheaper, than a Arduino Uno with a GSM shield.
GBoard Setup
At first we need to setup the GBoard correctly. I will not explain it here, because everything you need to know is well documented in the M2M Developer Community, which is part of the Developer Garden. If you click here, you will see the Developer Platform documentation. Than go to the section "Getting started with Deutsche Telekom M2M DevStarter Arduino".
There are also some sample sketches explained. For example, how to register your Arduino at the developer platform and how to send a measurement.
The hardware now looks like this:
The hardware now looks like this:
The Coding
Now lets do a bit programming. As base, code snippets from the SendMeasurement and RaiseAlarm sketch are used. In the picture above you can see that I also added a light sensor. A temperature sensor could be added, too.
After a bit of searching in the Arduino forum I found this post. Here, somebody posted a code where they used a kind of simulated AC because DC let the nails or other metal sticks corrode faster.
The full code can be found here.
After a bit of searching in the Arduino forum I found this post. Here, somebody posted a code where they used a kind of simulated AC because DC let the nails or other metal sticks corrode faster.
The full code can be found here.
The Web Application
Of course we want to have a nice interface, where you can see your collected data. To do that, I used the energy app which is part of the end-to-end example of the developer platform. To view my collected data, I didn't had to change a lot. I just modified the name of the variable "yField" to the "moisture", because I stored the measurements with this name in the platform. The variable "yTitle" I changed to "Moisture (%)" because I save the soil moisture in percent.
After a bit more modification the result looked this:
![]() |
| Login screen |
![]() |
| Graph |
Thursday, April 25, 2013
Helping our Office Plant with an Arduino (Part 1)
I'm always searching for new ideas for nice and simple M2M or Internet of Things (IoT) examples. A month ago I had a good idea. I came to our office and saw the plant next to my desk and it only had a few leaves. Maybe we watered this plant not often enough and I wanted to change it. Wouldn't it be nice if the plant waters itself or at least sends a message?
Because I didn't had any nails in the office, I used two paper clips. My colleagues looked a little bit confused, after I connected the Arduino with our dying plant. This was my first try:
How can I measure the soil moisture?
I thought about this idea and my first question was, how I can measure the soil moisture with simple tools. Luckily the answer was only one google search away. I just had to stick two nails or other long and thin metal sticks into the soil and connect it with an Arduino like this:Because I didn't had any nails in the office, I used two paper clips. My colleagues looked a little bit confused, after I connected the Arduino with our dying plant. This was my first try:
And with a few lines of code, I got my first readings.
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.print("Soil moisture: ");
Serial.println(analogRead(A0));
delay(1000);
}
Until now, it is nothing new. There are already some Arduino gardening examples on the internet. Also with light and temperature sensor or with pump which starts automatically when the soil is dry. There is something more needed for an M2M solution. I have to connect it somehow with a network.
Next Steps
In our office, we have some GBoards. These are Arduino based boards with a built-in GSM modem. This will help to connect it to the M2M Developer Platform, which is a cloud-based M2M application platform. Have a look at the M2M Developer Community which is part of Developer Garden. Here you can find the GBoard, the Developer Platform and some other interesting things about M2M and the Internet of Things.My first M2M Demo
Target:
Developing a simple energy control Demo with an M2M Development Kit, where a switch can be turned on and off via the internet.
Used Hardware:
For this demo the Cinterion EGS5 Development Kit and a simple switch, which can be switched via a RS232-port are used.
You don't need this swich. If you just want to test, you can simply connect a resistor and an LED to the port, like in the picture below.
The Software:
This demo consists of two parts. One part is the Java™ application on the module and the other part is the Website and a simple text file on a server.
A Java™ Application is running inside the Module. If the program is started, some static variables (e.g. destination host and connection profile) will be initialized. Then, every ten seconds, a loop is executed. In this loop, the Http connection to the server is set up and as input stream it receives the bytes of a text file. These bytes will be converted to characters and combined to a string. If this string is “on”, the COM-port is opened and if this string is “off”, the port will be closed. Any other string will close the port if it is opened and then the application will be terminated.
The Website is simple. It loads the text file and look up the word, which is in this file. Then the labeling of a button and a picture of a light are automatically adapted. When the button is clicked, it changes the word in the text file to the opposite (from “on” to “off” or vice versa). At the same time the button and the picture are updated again.
Developing a simple energy control Demo with an M2M Development Kit, where a switch can be turned on and off via the internet.
Used Hardware:
For this demo the Cinterion EGS5 Development Kit and a simple switch, which can be switched via a RS232-port are used.
You don't need this swich. If you just want to test, you can simply connect a resistor and an LED to the port, like in the picture below.
The Software:
This demo consists of two parts. One part is the Java™ application on the module and the other part is the Website and a simple text file on a server.
A Java™ Application is running inside the Module. If the program is started, some static variables (e.g. destination host and connection profile) will be initialized. Then, every ten seconds, a loop is executed. In this loop, the Http connection to the server is set up and as input stream it receives the bytes of a text file. These bytes will be converted to characters and combined to a string. If this string is “on”, the COM-port is opened and if this string is “off”, the port will be closed. Any other string will close the port if it is opened and then the application will be terminated.
The Website is simple. It loads the text file and look up the word, which is in this file. Then the labeling of a button and a picture of a light are automatically adapted. When the button is clicked, it changes the word in the text file to the opposite (from “on” to “off” or vice versa). At the same time the button and the picture are updated again.
![]() |
| Picture of the DeveloperKit with an LED |
Friday, January 25, 2013
Let's get started
This Blog will be about the internet of things and M2M (the more professionel term)
Subscribe to:
Comments (Atom)







