An ethernet weather station Abstract: Using an add-on card to the already existing avr ethernet board we build a weather station. That is: A weather station with a build-in webserver. The related articles which describe how to build the AVR web server are here: An AVR microcontroller based Ethernet device



HTTP/TCP with an atmega88 microcontroller (AVR web server)



The components for building this weather station can be ordered from http://shop.tuxgraphics.org



The system is modular. You can either build a pure Ethenet weather station or an Ethenet weather station with an additional local LCD display.

_________________ _________________ _________________



Sensors

For temperature measurements: LM335. This sensor is cheap and has a linear curve over a wide temperature range. This will give us very accurate temperature readings over a wide range. The accuracy will be almost constant over the whole range.





A Motorola/Freescale MPX4115A absolute air pressure sensor. This sensor is already calibrated at production time. The MPX4115A is not made for out-door use but that is not a problem. The circuit can be in a save and dry location inside the house as the air pressure is exactly the same inside and outside the house.



The Ethenet Weather Station as seen from a Mobile Phone





What's the weather at home?

The analog to digital converter (ADC) of the AVR

ADCreading U= ---------- * 1.1V 1024



Mapping of a voltage range into the ADC input range from 0-1.1V





Differential amplifiers









A differential amplifier with adjustable gain based on an operational amplifier.





The weather station circuit diagram (add-on board)



Click on the picture to get a high resolution PDF drawing.





Power supply requirements



Click on the picture to get a high resolution PDF drawing.





Use a big capacitor (1000uF or more) in power circuit

Avoid ground loops.

Keep the wires short.

Converting voltages into "weather" readings

10mV/K * 91K/68K * 1024/1100mv = 12.4 ADCsteps/K

Poffset=1013hPa * (1-(1- 0.0065 * h/288)^5.255) h=height above sea level. The formula can be derived from the Barometric formula. See http://en.wikipedia.org/wiki/Atmospheric_pressure and http://en.wikipedia.org/wiki/Barometric_formula





Your hight above sea level in meter: = SEALEVELOFFSET



Refvoltage=5V * 5.6K/( 5.6K + 1/(1/R27 + 1/2.7K))





R27 in KOhm: = op-amp reference voltage



Vout=5V* ((0.0009*P/hPa)-0.095)+Error Vout= output voltage in V at the MPX4115A pressure sensor P=air pressure in hPa Error=an error term caused by tolerances during the manufacturing of the MPX4115A. Therefore P is: P=((Vout+Error)/5V+0.095)1111.11 hPa P=(Vout+Error)*1/V*222.222 hPa +105.555 hPa If we convert Vout into ADC steps and included also the error term there then we get: P=(adc/1024*1.1/Gain +Refvoltage/V)*222.222 hPa +105.555 hPa The gain of the differential amplifier is 100/47=2.1 We insert this into the equation: adc *1.1 * 222.222 hPa P = ------------------------ + (222.222 *Refvoltage)hPa/V + 105.555hPa 1024 * 2.1 adc *10 P = --------- hPa + (222.222 *Refvoltage)hPa/V + 105.555hPa 87.8 In the config.h file I have included a REFTERM_A parameter which is this term to the right of the above equation: adc *10 P = --------- hPa + (REFTERM_A/10) hPa 87.8





op-amp reference voltage

(voltage over R23 in Volt): = REFTERM_A



The software

avrdude -p m88 -c stk500v2 -e -B 2 -U flash:w:eth_rem_dev_weather.hex

Mounting the out door sensor



The out-door sensor. Protected by a felt-tip cap.





The weather station as seen from firefox



A screen shot of mozilla firefox





The final circuit without LCD



The bare Ethernet weather station circuit without LCD



Adding a LCD display



Click on the picture to get a high resolution PDF drawing.







Ethernet weather station circuit without LCD





Ethernet weather station circuit with LCD, top view



Feed a database

w3m -dump "http://10.0.0.25/"

Download and links

Download page for this article: software and updates





page for this article: software and updates http://www.city-netz.com/staedte/, a list of towns in Germany and their height above sea level.





http://en.wikipedia.org/wiki/Atmospheric_pressure, wikipedia page about atmospheric pressure.





The tuxgraphics shop: shop.tuxgraphics.org

Here you can get all the components needed to build the small web-server and the add-on sensor card.





Here you can get all the components needed to build the small web-server and the add-on sensor card. RS componentshttp://www.rs-components.com/full.html

RS is one of the few distributors who sells the Honeywell HIH-4000 humidity sensor.