Skip to content

Temperature Humidity Rain sensors

bonjour81 edited this page Apr 17, 2019 · 9 revisions

Temperature, Humidity & Rain are handled by a single ESP8266, supplied by Li-ion battery & Solar panel

1.Architecture

TH rain bloc diagram

The code for this sensor is available here: https://github.com/bonjour81/station_meteo/tree/master/sensors/MQTT_TH_UV_rain

2.ESP8266

A Wemos D1 mini pro is used as ESP8266 wifi. I will periodically get T&H values from HDC1010 and read the count of tipping bucket from PCF8583.

D0 (GPIO16) has to be connected to RST to use the energy saving 'deepsleep' mode.

3.PCF8583 & Davis 7852M rain gauge

The rain gauge is a Davis 7852M The tipping counter is a PCF8583 RTC IC from NXP.
It can be used as a counter by removing the crystal and use crystal pin as counter input.
A great Arduino library exists to read and clear the counter.

Connexion of the rain gauge to PCF8583 and ESP8266:

rain_details

Read the count can be done by RTC.getCount(); re-init can be done by RTC.setCount(0);

4.HDC1010.

HDC1010 is a high accuracy T & H sensor from TI. It is similar to HDC1080 except dust protection has been improved.

5.LIPO Rider

This board integrated a special lithium batteries charger for solar panel.
It integrate a so called "MPPT" function (maximum power point tracking). This function is made to deal with solar panel: it will take as much power as possible from solar panel to charge the battery.
The LIPO rider also integrate a boost to deliver 5V from the 3.7V battery.

Some improvement are possible here by replacing the 5V boost by a 3.3V powersupply (buck boost?) that can handle battery voltage as input. The efficiency would be improved compared to boost to 5V then LDO from 5 to 3.3V (on the wemos board).

6.INA219 Current measurement (optional)

It is not really necessary, but I have added a couple of INA219 to monitor battery & solar panel. Those modules mesures both voltage and current.

7. FOTA upgrade

At each wake-up, the ESP8266 will check for new firmware at a specified location. To update your software, proceed the following:

  • For you first flashing, you will have to proceed by USB. Check fwImageURL & fwVersionURL in source file and update with a network location you like. Don't forget to update FW_VERSION too. Your ESP8266 is ready for OTA.
  • For OTA: put your new firmware.bin at the location you specified in fwImageURL Create or modify a text file matching the URL you defined in fwVersionURL. This file is basically a txt file with a single line which is the version number. The files must be reachable by http (check with your browser).

The ESP8266 will check version number in the txt file and compare with its own hardcoded value FW_VERSION for example, if FW_VERSION value is 127 (standing for v1.27), and if your firmware.version file contains 128 or higher number, the ESP8266 will proceed the OTA with the provided firmware.bin. You may leave the files on the server, at next check, if version number is same, no OTA will occur

Datasheets

PCF8583 counter
HDC1010 T/H sensor INA219 current/voltage sensor

Links

PCF8583 Arduino lib including event counter function
Some useful information about rain gauge
LiPo Rider informations