Internet http://www.ralfnuetzel.deEMail info@ralfnuetzel.de

title_project_froggy

Weather Station Froggy 1.0

I was always keen on doing a little electronics project. The project was to built a weather station with its own microcontroller and data logging with little effort in mastering electronics but lots of opportunities to program. My choice fell on the Arduino microcontrollers and an Arduino Ethernet controller using an Atmel microprocessor. The Arduino Ethernet board has the following possibilities: The project was named Froggy.

Specifications

The weather station should be able to measure the following weather parameters:

Principal working with Arduino Ethernet

USB Connection

The Arduino Ethernet does not come with an included USB connector as the Arduino Uno does. There are only 6 pins on the right hand side of the board, that have top be used to program the Arduino Ethernet, as the RJ45 jack is not active in the initial condition.
In order to connect to the Arduino Ethernet an FTDI compatible USB cable is neccesary. I used a DeLOCK USB Cable with 5 V. The cable was soldered to a small plug, that fits the pins with the following layout:
pinmeaningcolour
1GNDblack
2CTSbrown
3+5Vred
4TXDorange
5RXDyellow
6RTSgreen
The Arduino Ethernet has pin 1 (GND) on the upper right corner of the board, which is also named BLK. After connecting the Arduino Ethernet to the USB plug of the PC it started working, and uploading new schemes was possible.

Measuring analog values

The Arduino family of controllers provide analog input on pins A0 to A6 with a 10-bit digital to analog conversion (DAC). In order to measure an analog voltage one needs to connect the voltage to one of the analog pins. When executing the function i=analogRead(pin); it returns a value between 0 = 0.0 V and 210-1 = 1023 = 5.0 V.

In order to measure resisitivity, one needs to build up a voltage divider as given in the picture. The voltage divider measures the voltage, that drops at the resistor Rvar, with R2 being a constant resistor (e.g. 1 kΩ) and Us being the source voltage, normally 5.0 V or 3.3 V.
Rvar⋅Uvar=R2⋅U2
U2=(210-i)⋅Us
Uvar=i⋅Us
Rvar=R2⋅(210-i)/i
The resistivity is measured in ohms Ω.

To measure an electric current, just let the current flow through one resistor R with predefined resisitivity. By measuring the voltage that drops at the resistor one can calculate the electric current I:
I=U/R=(i/1024)⋅Us/R

When reading analog signals it can be a good advice to average the readings over a certain period of time. In my case, I read the values ten times after another, wait a short period of time (here 10 ms) and wait return the value devided by 10. As the values range in between 0 and 1023, the sum, 10⋅1023 still fits into an integer variable. This method reduces scatter and enhances the confidence limit of the reading.

Measuring with Froggy

Brightness

By measuring the brightness it is easy to tell, if the day is sunny or cloudy and when the sun rises or sets during the day. However, the sensor should be placed in such a way, that no direct sunshine can be measured. The measurement is quite easy. I use a photo resistor A905013 from PerkinElmer which has a reasonable resolution, also in the dark.

According to the above explanations I use a resistor R2=1 kΩ and Us=5.0 V. From the datasheet and from measurements the following equation was fitted:
E = 9588520 ⋅ Rvar-1.24238

Here a direct value of the brightness E in lux lx can be calculated from the resistivity in ohms Ω. The brightness E just has to be correlated with the cloud status and the time to estimate weather conditions and sunrise or sunset. This, of course, is highly dependent on the positioning of the light sensor and should be calibrated at first by calibration measurements and comparison with cloud status, etc. The reading and sensitivity of the photo resistor can be adjusted by changing the value of R2.

Air Pressure

A change in air pressure can indicate a change in the weather conditions, e.g. when a cold or warm front arrive. To measure the pressure I used the Motorola/Freescale MPX4115A sensor. It is an absolute pressure sensor with a range from 150 hPa to 1150 hPa. The air pressure normally lies in the range of 950 hPa to 1100 hPa, so the measurement range is sufficient. I use the 5 V power supply, that Arduino provides. The sensor has the following pin layout:
pinmeaning
1Vout
2GND
3+5V
4not connected
5not connected
6not connected
Pin 1 is marked with a small notch. The output is given as a voltage, that can directly be measured with Arduino. From the datasheet the following equation is given:
p=1000.0 ⋅ Vout/1024 ⋅ 5.0/45.0 + 105.556

The result is given in Pascal Pa. The output voltage depends on the input voltage. In case the input voltage differs a little (e.g. battery), the output voltage may vary so much, that faulty values are given. Therefore I recommend to measure the input voltage and correct the readings of the pressure sensor.

Programming Schemes

Setup

Links

Additional data for the whole project is provided here: