Remote Meteorological Station with UDOO – pt 1: Sensors and LEDs

Hello guys, this is the first part of a project which will help you to create a remote meteorological station that monitors humidity, temperature and pressure. We are dividing the projects in few parts in order to allow you to better understand the logics and components behind the project. All the data collected by the meteorological station could be remotely accessed via web thanks to a UDOO’s self hosted server made with apache and MySQL, this means that we will browse our meteorological data from anywhere with our favorite devices: smartphone, tablets or directly on UDOO.

In this first tutorial we are going to connect DHT11, a temperature and humidity sensor, with UDOO through the Arduino IDE.

For this tutorial you need:

Let’s start

First you need to insert the micro SD in your UDOO, connect the HDMI, the keyboard and mouse then power it up.

Ok, you are now ready to download the DHT11 library by clicking here
The library has two file: one header and one file .cpp, so copy the code of dht11.h in a new file with the same name and do the same with dht11.cpp.
Create a new folder with the name “DHT11” and put the files into, then move the folder in /Home/Arduino/libraries

Now go to Arduino IDE and add the library at the sketch, then you will see:


void setup() {

void loop() {

Create a new object of type DHT11 and define the pins for the sensor and for the alert LEDs.

dht11 DHT11;

#define DHT11PIN 13
int led_hum = 12;
int led_temp = 11;

In void setup() initialize the serial monitor with 9600 baud, then insert two strings of text for the physical aspect of the sketch and set in output the pinmode of the two alert led

void setup() {
  Serial.println("UDOO & DHT11 - TEST PROGRAM By Alessandro Paghi");
  Serial.println("Humidity (%)\tTemperature (C)\tLed_Hum\t\tLed_Temp");
  pinMode(led_hum, OUTPUT);
  pinMode(led_temp, OUTPUT);


In void loop() call the function read() with the parameter DHT11pin;

Then print in the serial monitor the value of humidity and temperature


Execute a control on a value of humidity. If it has a value greater than 45%, turn on the green alert led, else turn off.

    digitalWrite(led_hum, HIGH);
    digitalWrite(led_hum, LOW);

Execute a control on a value oh temperature. If it has a value greater than 23°C, turn one the white alert led, else turno off.

    digitalWrite(led_temp, HIGH);
    digitalWrite(led_temp, LOW);

Insert a deley of two seconds


Okay guys, now connect physically the component and compile and run the sketch.
When humidity is greter than 45% led green turn on and when temperature in greater than 23°C led white turn on.

For download the Arduino sketch click here


Submit a comment