-
Notifications
You must be signed in to change notification settings - Fork 3
Temperature Humidity Rain sensors
Temperature, Humidity & Rain are handled by a single ESP8266, supplied by Li-ion battery & Solar panel
The code for this sensor is available here: https://github.com/bonjour81/station_meteo/tree/master/sensors/MQTT_TH_UV_rain
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.
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:
Read the count can be done by RTC.getCount(); re-init can be done by RTC.setCount(0);
HDC1010 is a high accuracy T & H sensor from TI. It is similar to HDC1080 except dust protection has been improved.
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).
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.
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
PCF8583 counter
HDC1010 T/H sensor
INA219 current/voltage sensor
PCF8583 Arduino lib including event counter function
Some useful information about rain gauge
LiPo Rider informations
If you like to re-use my work, please add credit to my github folder!