This chapter will introduce you to the powerful features of the Arduino Yún microcontroller board. In this chapter, you will learn how to create a simple weather station that will send data to the cloud using the features of the web-based service Temboo. Temboo is not 100 percent free, but you will be able to make 1000 calls to Temboo per month using their free plan. You will learn how to connect sensors that measure temperature, humidity, and light level to your Arduino Yún. These sensors will first be separately tested to make sure that the hardware connections you made are correct.
Then, we are going to use the Temboo Arduino libraries to send these measurements to the cloud and to different web services so that they can be accessed remotely regardless of where you are in the world. Temboo is a web-based service that allows you to connect different web services together and proposes ready-to-use libraries for the Arduino Yún.
For example, the first thing we are going to do with Temboo is to send the data from your measurements to a Google Docs spreadsheet, where they will be logged along with the measurement data. Within this spreadsheet, you will be able to plot this data right in your web browser and see the data that arrives getting stored in your Google Docs account.
Then, we will use Temboo again to send an automated e-mail based on the recorded data. For example, you would like to send an alert when the temperature drops below a certain level in your home, indicating that a heater has to be turned on.
Finally, we will finish the chapter by using Temboo to post the data at regular intervals on a Twitter account, for example, every minute. By doing this, we can have a dedicated Twitter account for your home that different members of your family can follow to have live information about your home.
After completing this chapter, you'll be able to apply what you learned to other projects than just weather-related measurements. You can apply what you see in this chapter to any project that can measure data, in order to log this data on the Web and publish it on Twitter.
The Arduino Yún board is shown in the following image:
Of course, you need to have your Arduino Yún board ready on your desk along with a micro USB cable to do the initial programming and testing. Also, we recommend that you have a power socket to the micro USB adapter so that you can power on your Arduino Yún directly from the wall without having your computer lying around. This will be useful at the end of the project, as you will want your Arduino Yún board to perform measurements autonomously.
You will then need the different sensors which will be used to sense data about the environment. For this project, we are going to use a DHT11 sensor to measure temperature and humidity and a simple photocell to measure light levels. DHT11 is a very cheap digital temperature and humidity sensor that is widely used with the Arduino platform. You can also use a DHT22 sensor, which is more precise, as the Arduino library is the same for both sensors. There are several manufacturers for these sensors, but you can find them easily, for example, on SparkFun or Adafruit. For the photocell, you can use any brand that you wish; it just needs to be a component that changes its resistance according to the intensity of the ambient light.
To make the DHT11 sensor and photocell work, we will need a 4.7k Ohm resistor and a 10k Ohm resistor as well. You will also need a small breadboard with at least two power rails on the side and some male-male jumper wires to make the electrical connections between the different components.
On the software side, you will need the latest beta version of the Arduino IDE, which is the only IDE that supports the Arduino Yún board (we used Version 1.5.5 when doing this project). You will also need the DHT library for the DHT11 sensor, which can be downloaded from https://github.com/adafruit/DHT-sensor-library.
To install the library, simply unzip the files and extract the DHT
folder to your libraries
folder in your main Arduino folder.