Skip navigation

… code

In order to make all the elements inside the device work together, the process of developing required both electronics and computer programming.

In the following video the application is tested by switching to several different imput locations: the program was made just for in the project demonstration, in order to change manually the source location. Once a city is selected, the program retrieves the relative weather feed from Yahoo and shows it to the user.Once an interesting feed is found, it can be sent to the Blinky in order to start a visual feedback based on it.

N.B. In the real product the RSS feed should come only from the location where the other box is.

The code developed in Processing allows the system to get information about the weather conditions from a given location via RSS feed, to process it and to send this data to Arduino using the serial protocol.

The Processing code parses the RSS feed (an XML file) for the information about the temperature, humidity, visibility and the wind speed of the given location; it also gets a “weather code” from Yahoo, which is used to get the right weather icon, and comes in useful to get the weather type easily (for more information click here).

The application works in Processing 1.0 and can be downloaded in the downloads section.

The central core of the device is the Arduino board (http://www.arduino.cc) to which is physically connected the BlinkM rgb leds array, the microphone amplification system that detects the breath, and the array of twelve white LEDs.

Inside the Arduino the code can be divided in two main chunks:

  • the first part is the breath detection code which activates the device once received the input and gets the information from the Processing RSS parser about the target weather conditions.
  • the second part is the light presets library which consists of a set of functions through which the LEDs array turns on in differents way depending on the parameters coming from the RSS feeds.

Once the data is sent to Arduino, the software inside it selects a light pattern preset from the library (sunny, rainy, stormy and so on), changing the base color according to the temperature and humidity, in this way, for example, no sunny day output will be the same twice. Finally it sends the preset loop via serial protocol to the rgb LED array, that starts his light representation.

Arduino is an electronic card that can be programmed with a language very similar to Java, and is used also in the Processing environment: it has a dedicated software which is provided by the developer that allows the code debugging and uploading to the Arduino board memory for execution.

Arduino is what is called a “microcontroller” which allows the modulation via software of the power flowing from all the output pins. Part of the pins are digital (on or off), part are analog (0 – 255 value). Digital pins work like switches, analog ones like dimmers.

It also has some analog inputs, used to connect sensors, for example a microphone. Arduino pins are also capable of sending and receiving serial signals, which can be used to control in a very efficent way other Arduino boards or, in this case, the BlinkM leds, each of which has its personal microcontroller integrated in the PCB.

Since all the code necessary to realize the device could not be uploaded to the Ardunino Board due to lack of memory, for the prototype demo the system has been devided in two parts, one developed with Arduino and another developed in Processing and executed from a laptop computer. The two parts communicates via USB / Serial port adapter.

Alternatively we could use a board very similar to Arduino, that is called Wiring (http://www.wiring.org.co/), that works in the same environment and with the same language, but has much less limitations, though this is much more expensive.


home | concept | how to use it | communication | design challenges | code | downloads | credits