Ceska verze

Simple weather station (thermometer + hygrometer + barometer) with AVR

     Introduction:
This simple homemade weather station can measure and display all the basic meteorological variables - air temperature (thermometer), relative humidity (hygrometer) and atmospheric pressure (barometer). It allows you to set the orientation weather forecast. For all three measured values minimum and maximum are stored and that can displayed or reset by buttons.
     Description:
The circuit is controlled by a microprocessor IO4 - Atmel AVR ATmega8, ATmega8A or ATmega8L. Temperature is measured by the integrated circuit IO3 LM35. It provides the output voltage linearly dependent on the temperature with coefficient of 10mV / °C. As the humidity sensor IO2 I used integrated sensor HIH-5030 (you can also use improved HIH-5031). Pressure is measured by circuit IO1 - integrated pressure sensor MPXH6115A. You can also use MPXHZ6115A, MPXA6115A, MPXAZ6115A or MPX4115A. The thermometer measures the room temperature in the range 2.0 ... 99.9 ° C. Humidity meter (hygrometer) measures the relative humidity in the range of 1 ... 99%. The barometer measures air pressure in hectopascals range 150 ... 1150 hPa (1 hPa = 1 mbar = 0.75 torr = 0.75 mmHg = 0.02953 inHg). To view the values LED display is ​​used. The barometer uses a four-digit display, hygrometer two- and thermometer three-digit display. The displays are controlled by multiplexing as a single 9-digit display. Cathodes are connected to port D, anodes to entire port B and PC5 pin through current amplifying transistors T1 ... T9. Frequency of multiplexing is about 100Hz. R1 to R8 determine the current of display and thus the brightness. For measurement of analog signals three unbalanced inputs of 10-bit AD converter circuit ATmega8 (A) (L) are used. When measuring each variable, more samples are always taken and averaged to eliminate random errors (noise). AVR IO4 is using built-in RC oscillator running at 1MHz as a source clock. Crystal is not necessary - the frequency is not critical for analog-to-digital converter (ADC). Weather station is powered from a stabilized 5V power supply with the 7805 regulator in typical application.
     Measurement:
The first part of the display shows the temperature, the second one relative humidity and third shows the atmospheric pressure. If the value is out of range or sensor has malfunctioned (unexpected input voltage ADC0 to ADC2), the symbol "_" (value less than the allowable range) or " ‾ " (a value higher than the allowable range) is displayed. Data is refreshed about every 3 - 4 seconds.
     Min / Max memory:
Weather station tracks and stores all measured values ​​for maximum and minimum value. This can be viewed by pressing the buttons MIN or MAX. A moment after the button is released the actual value is displayed again. Memory for minima and maxima can be reset by pressing both buttons simultaneously. Note: Monitoring min and max begins after a delay of 15 seconds from power on of the weather station to avoid the storage of meaningless values ​​just after the power on, when the circuit is still unsettled.

The program for download:
source code in Assembler (ASM)
compiled in HEX file (1028 Bytes)
How to write the program into the AVR is described here.

I can send you the programmed microcontroller. For more info click here.


Schematic of the simple weather station (thermometer + hygrometer + barometer) with AVR


Configuration bits setting.
(Hexadecimal values are Low Fuse: 21, High Fuse: D9.)


Testing the weather station in the bread board. Displaying data in order: Temperature (°C), relative humidity (%), atmospheric pressure (hPa). Note: The digit on far left is not connected.


Pressure sensor MPXH6115A with SMD-THT adapter.


Relative humidity sensor HIH-5030 and board ready to make the SMD-THT adapter.


Relative humidity sensor with adapter


Pressure, humidity and temperature (LM35) sensor and part of the AVR ATmega8 in breadboard.


Weather station soldered to an prototype board.


Displays of the weather station (T-5631BUY-11, LD-D056UR-C, 2x LD-D028UG-C).


Homemade weather station in operation


The PCB board from bottom.


The sensors


Completed DIY weather station in a diskette box.


Video - testing the weather station with AVR.



Added: 10. 7. 2013
home