Weather Station

Index

  1. Index
  2. MCP3428E I2C 4 channel A/D converter
  3. Weather Station
  4. SW

MCP3428E I2C 4 channel A/D converter

MCP3428.png

Here is the full Datasheet of the MCP3428 family. The bigest housing SOIC is used.

Weather Station

Temperature

For temperature measurement the NTC thermistor TTC05103 is used. It has a nominal resistance of 10 kΩ at 25℃ and a B constant of 4050 K. The resistance is calculated with the formula RT=RN*e^(B*(1/T-1/TN). T and TN (the nominal temperature) must be given as absolute temperature in K. To be able to measure the temperature range from -30℃ to 50℃ a series resistor of 150 kΩ is needed to ensure no higher voltages as 2048 mV as specified for the inputs of the MCP3428. The following table shows the relation between temperature, resistance of the NTC and the voltage on the A/D converter, if a 3.3 V source voltage is used.
Temerature [℃]-30-25-20-15-10-5051015 20253035404550
Resistance [Ω]21598415440711185982054609034570934669 265572053616023126071000079936435521742573496
Voltage [V]1.9471.6741.4101.1670.9530.7710.6200.496 0.3970.3180.2560.2060.1670.1360.1110.0910.075

TemperatureMeasurement.png

Rain

The rain is measured with an old pluviometer as shown in the pictures below. The seesaw changes with every 2 ml of water. The area of the rain collector is about 10 x 3.5 cm². As result 1 impulse means 0.002 l / (0.1 m x 0.035 m) = 0.57 l/m² or 0.57 mm.
pluviometer1.png pluviometer2.png

In the pluviometer a magnet and a read contact is used in which close in the middle position (not stable). To measure, if a pulse occured, a voltage divider (680 kΩ and 1 MΩ) and a capcacitor is used to generate a analog input signal.

RainMeasurement.png

Humidity

The humidity is measured with a hih-5030-0001 from honeywell Datasheet It can be used also with 3.3 V and has a voltage output which is highly linear to the humidity. Because the maximum voltage on the output is higher as the 2048 mV, which is defined for the input of the A/D converter, a voltage divider must be used. I used one with 33 kΩ and 100 kΩ.
hih_5030.png _5030.png Humidity_measuremet.png"

Brightness

The brightness is measured with the LUNA Optoelectronics PDV-P8104 Fotowiderstand LDR THT. Because a good relation between brightness and resistance is not given in the datasheet, no conversion table can be made now.

BrigthnessMeasurement.png

I2C pegel shifting and protection

Because the I2C levels of 3.3 V and 5 V don't allow long distances a level shifting to 12 V is done. The following layout shows this shifting circuit and a protection for voltage pulses higher than 20 V.

PegelShifting.png

Voltage supply

For the voltage supply the LM2575T-ADJ is used. There is also a LM2575 with fixed 3.3 V but I wanted to try the adjustable version to learn for other projects. The full datasheet is here. The output voltage can be adjusted with R1 and R2 with the formula Vout = Vref*(1+R2/R1) with Vref = 1.23 V and R1 between 1 kΩ and 5 kΩ. The circuit is designed as shown in the picture:

PowerSupply.png

SW

The SW for reading the values is running in the background program "TS_HomeServer" on my Raspberry Pi 2. This program is running as daemon and provides a task system with different cycle times and a init part. This daemon is described here.
All own written SW is stored in the files OwnI2C.cc and OwnI2C.h and is divided in different classes.

Class ComI2C

This class summarises all function needed for the I2C communication using the "wiringPI" library.

home.png