This is a simple application built around Ansteron Board and its libraries. It will connect to the Internet, download weather information, filter out necessary data and display onto LCD module.
We use Yahoo! weather API in this example as it's free and open to all users without having to register an account. For other API services, the idea is similar. You can modify the program according to your service provider if you're going to make one for yourself.
Connection to the Internet is based on W5100 chip. The LCD is 240x320 with ILI9340 controller. Images for the screen are stored on a micro SD card, attached to the back of LCD module.
The LCD module has SPI interface with 3.3v regulator and level shifter built-in. There is also micro SD socket in the back, pretty convenient. W5100 module is from a supplier in China. It works well but we had to do a little modification to make it share SPI bus with LCD module. W5100 chip has a "bug" that it will not release SPI bus for other devices even if CS pin is high. It can be fixed by pulling SPIE pin low and we use an additional pin on Ansteron Board for that.
This is schematic for the whole thing:
3. How this works
Basically, Ansteron Board will connect to Yahoo! weather server though the connection by W5100. It then makes a HTTP request and receives response from the server. Data received is in XML format and Ansteron Board just seeks through that data stream to filter out the tag that it needs. In that tag, there will be weather condition, temperature and date, time when that data was updated. Below is raw data from server, captured on Serial Terminal:
The good thing is that we can match condition codes directly to a bitmap file stored on micro SD card by adding ".BMP" to the end, making it easy to load corresponding image onto LCD.
Similarly, each number of the temperature is mapped to a bitmap file on micro SD card so we have nice, big numbers without have to create a new font. All other texts on the display are just raster font 12x16 comes with ILI9340 library.
Source file for this project is included with Ansteron IDE in examples folder. Bitmap images to store on micro SD card can be downloaded here. Be informed that these images may subject to copyright and cannot be use for commercial purpose.