Rain Gauge with Data Logger and more...

Features of “Rain_Gauge_Two.ino”. Version 2.0

New in this version: All customizing edits are now in file; located in “variableInput.h.”
Additional comments in the “variableInput.h” file.

  1. NTP Time; used for 15 minute time interval and date-time stamping;
    "LOG. file gets created daily. File name is in the format “LOGxxyyzzzz” xx being the DATE and yy
    beining the MONTH and zzzz being the YEAR; a new log file is created after every file renaming.

  2. Dynamic web page of current observations showing Last update time and date, humidity,
    temperature, barometric pressure, rainfall by five minutes, hour, and day.

  3. Only LOG files are listed as web links; for download.

  4. LOGXXYYZZZZ file is appended every 15 minutes with the latest update; storing data to Dynamic,
    web page.

  5. URL file names other than ones defined in the Sketch produce “404 Page not found.” Methods
    other than “GET,” produce “405” message and exits current request.

  6. Optional; Audible alert from Piezo electric buzzer when there is Barometric Pressure difference
    of.020 inches of Mercury. I am interested in sudden drop of Barometric Pressure in a 15 minute
    interval. Serve weather more likely with a sudden drop. Difference of .020 inches of Mercury
    point is set for my observations to log and sound audible alert; not based on any known value
    to be associated with serve weather.

  7. Optional; two-line LCD Display of Barometric Pressure, in both inches of Mercury and millibars.

  8. Temperature, Humidity, Barometric Pressure, and Dew Point have four embedded “ThinkSpeak.com
    graphs on one web page. Graphs are created from Iframes provided by “ThingSpeak.com

  9. HTTPClient library is used to POST data to the Domain, hosted website. Function
    “webInterface” function sends data to Domain website.

  10. Free, “000webhost powered by HOSTINGER” may be used for Domain, hosted website.

  11. “dataCollector.php” needs to be uploaded to your Domain, Hosted web site.

12 Simple FTP file transfer; allows for easy file maintenance, preventing too many log log files.
Tested with Filezilla client.

  1. Built-in OTA update; remote sketch update by web interface; ota function.

  2. Two websites,one sketch: “Rain_Gauge_Two.ino”

ESP32 Dynamic web server, with file browser (selected file can be viewed), and graphs. Note this project is in development; maybe offline or log files may be affected. Server is online 24/7; except during periods of testing. Sensor is currently located inside of house.


Server is an “Adafruit, Espressif ESP32 Development Board - Developer Edition,” PRODUCT ID: 3269.
Development board, GY-BME280 breakout board, purchased from “Ebay.com,” NEO m8n GPS Module,and a “tipping bucket” rain gauge are required for project.

Development board is “Arduino” friendly; can be programed using the Arduino IDE.

“Rain_Gauge_Two.zip” includes files related to Sketch.

William

Weather_View_Timezone.zip (18.7 KB)

Serial Monitor.txt (10.5 KB)

Rain_Gauge_Two.zip (425 KB)

04/04/2019

Found “LOGxxyyzzzz.TXT” was ending at 20:00:00 instead of 23:45:00 and starting “LOGxxyyzzzz.TXT” at 20:15:00 instead of 00:15:00. xxyyzzzz being DATE, MONTH, and YEAR of filename.

6v6gt explained the issue to me with corrected code for the getDate_Time function…

Corrected project code is attached.

William

Weather_View_Timezone.zip (18.7 KB)

Update 6/8/2019

Current version has rain5min, rainHour, and rainDay working correctly. rain5min “bucket” dumps are counted during 5 minutes period; rainHour and rainDay both update at 5 minute period. rainHour resets to zero every hour. rainDay resets to zero at Midnight.

Project includes the previous “Internet Weather Data Logger and Dynamic Web server,” two web sites in one sketch; now with “Tipping Bucket” Rain Gauge functionality!

Attachment includes sketch, dataCollector.php, and readme file,

There is a print statement; easily commented out, that was used for seeing each interrupt as it is triggered.

Project was developed using an “Adafruit,” Espressif ESP32 Development Board - Developer Edition, PRODUCT ID: 3269

William

Rain_Gauge_One.zip (54.3 KB)

Update 6/16/2019, Version 1.3

No new features; fixed unixtime time setting of the DS3231. Thank you for the fix Haroon552, of the “Arduino.cc Community.”

Formated sketch, made a few minor changes, Credited Haroon552 with fixing unixtime setting of the RTC.

ESP32 Project web site

William

Rain_Gauge_One.zip (17.2 KB)

Version 1.4

Fixed issue with WiFi reconnects --every time “Five Minute Routine” executed; caused entries in WIFI.txt file.

Included files related to project in attached file.

William

Rain_Gauge_One.zip (53.6 KB)

Looks like a super cool project. You should, though, use GitHub to host/version control your project code. It would make it a little easier than constantly reposting zip files.

Thank you Power_Broker! Already have a presence on Github.com. How does Github track the number downloads? This is a feature of Github.com I find missing.

William

You can track it by going to your repo, click the "Insights" tab, then click on the "Traffic" button on the left hand side. There will be a number on the screen associated with "Clones". That will be the total number of clones of your repo. I'm not sure if this counts zip downloads, though.

Can you post a link to the repo for this project? You seem to have several repos whose names closely resemble each other and this project.

Features of “Rain_Gauge_One.ino”. Version 1.4

  1. RTC with GPS update; used for 15 minute time interval, date-time stamping, and dayofweek;
    "LOG. file gets created daily. File name is in the format “LOGxxyyzzzz” xx being the DATE and yy
    beining the MONTH and zzzz being the YEAR; a new log file is created after every file renaming.

  2. Dynamic web page of current observations showing Last update time and date, humidity, dew
    point, temperature, heat index, barometric pressure, rainfall by five minutes, hour, and day…

  3. Files on server are listed as web links; clicking link prompts for: “FAVICON.ICO”, and “ACCESS.TXT”
    are listed; however, they are for internal use and are restricted; result of clicking link produces
    “404 Page not found.”

  4. LOGXXYYZZZZ file is appended every 15 minutes with the latest update; storing data from Dynamic
    web page.

  5. URL file names other than ones defined in the Sketch produce “404 Page not found.” Methods
    other than “GET,” produce “405” message and exits current request.

  6. Optional; Audible alert from Piezo electric buzzer when there is Barometric Pressure difference
    of.020 inches of Mercury. I am interested in sudden drop of Barometric Pressure in a 15 minute
    interval. Serve weather more likely with a sudden drop. Difference of .020 inches of Mercury
    point is set for my observations to log and sound audible alert; not based on any known value
    to be associated with serve weather.

  7. Optional; two-line LCD Display of Barometric Pressure, in both inches of Mercury and millibars.

  8. Temperature, Humidity, Barometric Pressure, and Dew Point have four embedded “ThinkSpeak.com
    graphs on one web page. Graphs are created from Iframes provided by “ThingSpeak.com

  9. HTTPClient library is used to POST data to the hosted, Domain website. Function
    “webInterface” function sends data.

  10. Free, “000webhost powered by HOSTINGER” may be used for “Domain hosted” website.

  11. “dataCollector.php” needs to be uploaded to your Hosted web site.

12 Simple FTP file transfer; allows for easy file maintenance, preventing too many log log files.
Works with Filezilla client.

  1. Built-in OTA update; remote sketch update by web interface. Used with “webInterface” function.

  2. Two websites,one sketch: “Rain_Gauge_One.ino”

ESP32 Project, ESPAsyncWebServer based

ESP32 Project; ESPAsyncWebServer, Domain Hosted web site

ESPAsyncWebServer based; Dynamic web page has file browser (selected file can be viewed), and graphs displayed. Note this project is in development; maybe offline or log files may be affected. Server is online 24/7; except during periods of testing.


Server is an “Adafruit, Espressif ESP32 Development Board - Developer Edition,” PRODUCT ID: 3269.
Development board, GY-BME280 breakout board, purchased from “Ebay.com,” NEO m8n GPS Module,and a “tipping bucket” rain gauge are required for project.

Development board is “Arduino” friendly; can be programed using the Arduino IDE.

William

Rain_Gauge_One.zip (53.6 KB)

Project repo link (to download latest project software).

is it possible to confirm data upload when using HTTP POST or GET to post data to cloud?

all other sensors are unimportant when some data is lost because there are graph line that shows what is happened

but in rain data is important that all "tip" s are counted and uploaded..

DataCollector.php file on Domain server echoes back what get sent by POST method.

If you watch Serial Monitor; you will see what gets echoed back from Domain server.

Thank you for your interest in the project.

William

9/24/2019

Version 2.0 of project is online for testing. "Rain Gauge Two.ino," takes Weather observations of Temperature, Humidity, Barometric Pressure and measures rainfall using a tipping bucket rain gauge. NTP time is used to record data at 15 minute intervals. Watchdog timer has been added. Also added Server restart; which, re establish WiFi connection. Events of Watchdog restart, Server restart are logged to SPIFFS.

Project supports OTA (over-the-air) firmware updates and FTP (tested using "Filezilla.")

Files for Download; directly from the ESP32 Webserver are limited to only listing filenames with the first four character "/LOG."

ESP32 Project, ESPAsyncWebServer based

ESP32 Project; ESPAsyncWebServer, Domain Hosted web site

William

is it possible to download and try this 2.0 version?

Hope to have it completed soon. Will post it here; planning to add a config file to simplify setup, currently requires several edits prior to use, after downloading.

Thank you for your interest. Please, continue testing website...

William

9/30.2019

Finished “variableInput.h;” which is a new include file with options requiring editing are available in one file! No more hunting occurrences throughout the code. Be sure to copy “variableInput” folder to your library folder!

Upload “Rain_Gauge_Two.zip” contains: Sketch “Rain_Gauge_Two.ino,” library folder, “variableInput”, PHP file for use on a Domain hosted website “dataCollector.php,” and “README.TXT.”

ESP32 Project; ESPAsyncWebServer based

ESP32 Project; ESPAsyncWebServer, Domain Hosted web site

William

Rain_Gauge_Two.zip (375 KB)

Hello William,

you can put variableInput.h in the sketch folder, I believe that it's more simple since you can edit the file inside the IDE.

Hello William,

I notice on your rain gauge two project a few things I thought to comment on.
On the main page, you have temperature in degrees Celsius, whereas on the graph it is something else with no units.

The Humidity should be stated as Relative Humidity and again on the graph as well together with % as units.
Generally and typically, relative humidity sensors are not so accurate to less than ±1%, within the typical operating band, and worse outside than band. So little point in showing fractional parts for % rh.

On the main page, you have barometric pressure as metric, well sort of, it is hPa, not hpa, but not on the graph page. Generally, with barometric pressure in hPa, you only need to represent whole units. Check the resolution of the sensor being used as a guide.

For the rain, you should express it as mm per unit time, so for example, it should read 5mm/day, not 5 day/mm.

With your latitude and longitude, is it north or south and east or west ?
I notice your elevation changes with updates, that's interesting. I imagine that should be fixed.

The link you provide in post #8 does not work: ESP32 Server
And again in your post #12: Website for ESP32 project

Will be looking forward to seeing the project progress.

Hello William,

I notice on your rain gauge two project a few things I thought to comment on.
On the main page, you have temperature in degrees Celsius, whereas on the graph it is something else with no units.

On main page temperature now reads in degrees Fahrenheit. Graphs have been re-labeled to match units on main page.

The Humidity should be stated as Relative Humidity and again on the graph as well together with % as units.
Generally and typically, relative humidity sensors are not so accurate to less than ±1%, within the typical operating band, and worse outside than band. So little point in showing fractional parts for % rh.

Did not like the graphing with whole units.

On the main page, you have barometric pressure as metric, well sort of, it is hPa, not hpa, but not on the graph page. Generally, with barometric pressure in hPa, you only need to represent whole units. Check the resolution of the sensor being used as a guide.

Change Barometric Pressure units to inches of Mercury (inHg.). Corresponding units on BP graph are inHg. Graphing is for visualization of observer weather data; not intended for precise measurements. Data only gets updated every fifthteen minutes; using few digits to left of decimal produced an undesirable graph IMHO.

For the rain, you should express it as mm per unit time, so for example, it should read 5mm/day, not 5 day/mm.

Rain measurement readings are taken for Day, Minute, and Five Minute interval.

With your latitude and longitude, is it north or south and east or west ?
I notice your elevation changes with updates, that’s interesting. I imagine that should be fixed.

GPS Data is presented the same as it comes off the NEO m8n module. Decimal coordinates may be used directly in “Google Maps”

The link you provide in post #8 does not work: ESP32 Server
And again in your post #12: Website for ESP32 project

Links have been corrected:

ESP32 Project, ESPAsyncWebServer based

ESP32 Project, Domain Hosted web site

Appreciate the feedback rockwallaby.

William

Rain_Gauge_Two.zip (17.7 KB)

Will soon be posting a new, version of "Rain_Gauge_Two_.zip." ESP32, Open Source project.

I am in the testing stage of my project. Would like to see how it responds to visitors, before posting the code.

ESP32 Project, ESPAsyncWebServer based

ESP32 Project, Domain Hosted web site

Project is a conversion of "Rain_Gauge_Two.zip"; WiFi Client/ Server, to an Async Web Server using:

GitHub - me-no-dev/ESPAsyncWebServer: Async Web Server for ESP8266 and ESP32.

William