The LCD12864 display uses ST7920 controller that has the option of parallel and serial communication. Serial communication is preferred because it uses only three digital pins (3, 8 and 9) instead of ten or more for parallel. Another advantage with this display is that it can be used in graphic mode. With it you can control individual pixels on screen. I used this to draw the sun or clouds depending on a outside conditions.
LCD display in action. On the first screen you can see the current weather data (temperature, humidity, wind pressure, cloud coverage and sky temperature), the time when they were recorded and if the change from earlier time is positive, negative or constant. On the second picture the display is showing maximum and minimum within certain period and they can even be reset. All the captions are in Slovene language. More pictures can be found in gallery.
The original library was meant to be used with Arduino Mega that has 4 times as much SRAM as ATmega328 I have been using. The screen buffer alone needs 1KB (128×64/8 = 1024 bytes) of memory that is half of the total memory one could use. Beside this in graphic mode you have to store every individual pixel of any character used, leading to overflown memory, leading to broken code and unexpected errors. If you do not want to change the look of the character while the program is running you can store them in FLASH memory along with the source code. Any variable the contents of which will be constant and not changed after initialization can be stored in FLASH using avr/pgmspace library. Doing so updated library can be successfully used on UNO an Duemilanove Arduino broads. Here you can download my updated version of the library I have been using for LCD 128×64.
Useful links at building this device:
Finally the weather shelter is no longer empty. Inside it I put Arduino based weather station, made by me. I wanted it to drain as low power as possible so the Atmega328 MCU is sleeping most of the time except when it gets interrupt to send data to PC or when it detects that anemometer (wind speed) is moving. As voltage regulator I am using LP2950 instead of LM7805 or LD1117 as it has way lower quiescent current of aprox 100uA. That is 50 times less than 5mA as a LM7805 has. Station is running on four AA batteries so every mA counts and with this settup I get for around of two weeks energy. Connection to PC is done using serial Bluetooth module. All the data sent from the station can be seen here.
Anemometer – wind mill:
This one is made of scrap material found at home. The magnet is attached inside the cap and when it passes the hall switch US5881LUA detector Arduino gets interrupt to increase an integer that is measuring wind speed. The calibration was done with anemometer attached to the bicycle. I tested it while cycling at speed form 5 to 25 km/h and got a nice linear graph.
MLX90614 as cloud detector:
The MLX90614 is high-resolution I2C non-contact infra-red thermometer. For my purpose it is pointing to the sky and it is measuring the sky temperature. The temperature depends on whether the sky is clear or overcast. When the sky is clear the temperature is lower and when it is overcast the temperature is higher. Sadly this is not enough to detect clouds. In addition, it is necessary to measure the ambient temperature too. Cloud detector calculates the difference between the sky and ambient temperature. From the tests I deduced that difference of lees than 5 degree means 100% cloudy and difference higher than 22 degree is clear sky. My MLX90614 is not the best for this work as it has field of view of 90°, more suitable would be the one with FOV of 20° or 10°. The casing of the sensor is hermetically sealed and that way it can be directly mounted on top of the shelter without any need for additional rain protection.
This is digital high-precision barometric pressure and ambient temperature sensor. It is designed to be connected directly to a MCU via an I2C bus.
Analog humidity sensor.
Pluviometer – rain gouge:
I even build rain gauge with tipping bucket, but it is not used in final setup as I have no use/need for precipitations data.
For even lover power consumption I replaced Bluetooth module with NRF24 wireless radio transmitter and added internal watchdog timer that wakes up microprocessor when it has to transmit data. NRF24 in comparison with BT drains current of tens uA in contrast of 5mA current for BT. The biggest difference can be seen when modules are not connected to PC. NRF uses the same amount of power in contrast to the BT that draws more than 50mA. Now the only serious power consumers are sensors that remain unchanged.