Clock with sensors for temperature, humidity and air pressure. TFT 2.2inch 320x240 SPI with SDCard socket. Sensors: DHT22 aka AM2302, SHT11, BMP180 RTC: DS3231 with 24C32 EEPROM on board.

Dependencies:   BMP180 DS3231 RHT03 SDFileSystem SPI_TFT_ILI9341 _24LCXXX mbed SHTx

Clock and environmental display

Used a Nucleo L152RE, cheap display with QVGA 320x240 resolution and SPI bus plus SDCARD socket and a bunch of cheap board from Chinese dealers:

  • DS3231 RTC with on board EEPROM 4k Byte
  • BMP180 pressure sensor
  • SHT11 temperature and humidity sensor
  • TTP224 capacitive switch buttons with 4 pads

Simple weather forecast regarding the pressure. Not very reliable. Still searching for infos.

Data will be stored every ten minutes for statistics into EEPROM and on SDCARD EEPROM data is used for statistics display. The text file on SDCARD can be used for importing into some programs on PC.

Backlit control is done by a Pololu 3.3V step-down converter (I was to lazy to search for a transistor ;-) ).

SHT11 uses not the normal I2C protocol. I set it up for second I2C port (PB_11, PB_10). I used a AM2302 sensor, but sensor or lib were not very reliable and the update was hanging several hours. These combined temperature and humidity sensors with digital interface are not very cheap.

Update 1st June 2014

Some major changes. Now using SHT11 temperature humidity sensor. Code for AM2302 and DHT22 still available. Display changed to landscape orientation and inverted to white letters on black background. I use a TTP224 touch module with 4 buttons. Backlit control with a Pololu 3.3V step down converter (#2097) using the SHDN pin. A little bit bigger weather icons (95*85 pixel)

Normal display


Stats display


New media files for icons on black background:


Text for previous version

Now my little clock is running a few day and shows a little issue. It seems, the DHT22/AM2302 sensor is not very reliable and sometime the program hangs getting the data. I will show up with an workaround next days. Later on it is planned to change the sensor. I already ordered a SHT11 sensor which has I²C bus.

Weather symbols converted to RGB565 bmp files with size of 72x72. Put these files on a SDcard

May, 18: Now guessing weather. First splash screen disabled. Changed the reading of temp sensor. If after 5 tries no luck, take old values. The AM2302 reading is not very reliable.

Not really happy with the layout, but a good beginning. :) /media/uploads/RobertFischer/weather_color_v1.jpg