I am developing this controller for my pump room. It will monitor the level of my rainwater tank (pressure sensor), the conductivity of my pool water (copper ion disinfection) etc. It displays data on a TFT, shows it on a web page and sends an email, when certain boundary levels are reached. Oh, and it also gets NTP time quite often, as Covid-19 has my RTC shield in its grip…
This is the current scope. Once I have the bugs out, it will monitor several other parameters and it will also include routines to calibrate the various sensors (pH, EC, pressure, ORP, temp etc) and grab environmental data from my Davis Instruments meteorological station, to manage all of my water needs, controlling valves etc. (if you feel that this might be too much for the Mega and I should be looking to something else(RPi?), now would be a good time to speak up too…)
Using a mega 2560, ethernet shield, a 3.5"kuman tft screen with touch, and a little EXO stamp by Atlas Scientific to condition the EC probe.
Overall, the sketch seems to work, displaying data on the screen and webserver, sending emails and getting time . However, when observing the tftscreen while moving the potentiometer simulating the pressure sensor, I notice that it seems to stop sampling/updating, temporarily, when:
1- the unit is supposed to send a email and/or
2- a client is connected to the server.
I realize that there are 3 competing items accessing the internet, webserver, email and NTP. Since I’m new to this, I’m guessing there might be some redundancies in the code and/or incompatible calls.
Feel free to critique any and all parts of this code. I’m eager to learn.
The sketch is divided in Tabs. the tab names are commented in the first line of code… its exceeds the 9000 character limit for the forum, so its attached as a ZIP file.
Thanks for your help.
Pump_Room_Server.zip (9.86 KB)