Features of the the ESP32
The nice thing about the ESP32 is that it has lots of useful features that make it ideal for measuring and reacting to outside events and yet consume very little power. The board itself draws quite a bit more power than say an ESP8266 but because it can be put to sleep and wake up from outside events, net net is almost no drain on the boat battery. Here are the features I will be using:
- Wake up on time
- Wake up on external event in this case the large pump
- Read 12 volt inputs as On or Off
- Measure multiple battery voltages up to 16 volts.
- Control relays to turn on or off the fan or small bilge pump
Wake up on timeThe fundamental idea is that the unit will wake up every 30 minutes, check everything out, and do one of three things. 1) Go back to sleep. 2) Send the daily email. 3) Send an unscheduled email to alert me of a problem. Every 30 minutes seems like often enough and the unit seems to fail if you ask for more time which makes this the obvious choice. The only thing I would want to know sooner would be if the large pump went off.
Wake on external eventThe 12 volt line to the main pump is controlled by a float switch. If that line has 12 volts on it, the ESP32 wakes up, turns the small pump into automatic mode, and sends an email so that I can take corrective action. The unit is capable of waking up from a large number of external events but I have not taken advantage of that.
Read external inputsI use transistors (see next page) to take the 12 volt inputs and set input pins either high or low. This allows me to read if the main power switch is on which of course means I am on the boat. I could also use it to measure shore power but I infer shore power by the voltage on one of my batteries. When shore power is on, that battery sits at 14 volts. When shore power is off, it goes down to 12.6 volts. If my boat had shore power outlets I would just use a 5 volt wall wart and measure shore power directly but I don't. I just have an extension cord with a battery charger plugged into it. But the capability is there and would be simple to implement. There is also an input from the small pump that is 12 volts when the pump is running.
Read battery voltageOne really nice feature of the ESP32 is that it has a large number of analog to digital converters so a corresponding large number of things can be measured. I measure the battery voltage on each of my two batteries. My Dutch friend is going to measure a water sender to look for water in the boat. He does not have a bilge so no place for a float switch.
Control thingsAs I mentioned, I have a high capacity 12 volt fan to get air flow in the boat. I don't want to run that fan if shore power is off or if the battery voltage gets low. The fan and small pump run off one battery and the large pump runs off the one I measure to deduce shore power. The relays turn the fan off when I want and also turn the pump on per its schedule. When I command the pump to turn on, I monitor its line to make sure it goes on. If it doesn't, I will send an email. I measure the amount of time it is on and use that to adjust the schedule. As I write this, the schedule is once a day and the run time is 5 seconds. If the pump runs for over 60 seconds, I reset the schedule and the pump will start to run every half hour and adjust as needed. The goal is for the pump to run less than 15 seconds. I expect this to greatly extend the life of the pump. I have been replacing them every 4 years under the extended 5 year warranty so all it costs me is the cost of a new extended warranty. But it is a pain and I hope to avoid doing it in the future.
I do not sell or share any user data or anything else for that matter. The only personal information I save is in the site log which has a line for each page view which includes the IP address your browser sends in the header as well as which page you requested. I use this to block hackers and other bad actors. I do not use this raw data to create profiles on users. I periodically delete the log files. Google supplies the ads on this site. Because I do not track who you are, I cannot customize how these ads are served. They may be personalized to improve the ad experience. If you do not want personalized ads, please adjust the settings on the Google site HERE. NOTE: The best I can determine, this site is not subject to CCPA but I am doing my best to comply anyway.
The information on this web site has not been checked for accuracy. It is for entertainment purposes only and should be independently verified before using for any other reason. There are five sources. 1) Documents and manuals from a variety of sources. These have not been checked for accuracy and in many cases have not even been read by anyone associated with L-36.com. I have no idea of they are useful or accurate, I leave that to the reader. 2) Articles others have written and submitted. If you have questions on these, please contact the author. 3) Articles that represent my personal opinions. These are intended to promote thought and for entertainment. These are not intended to be fact, they are my opinions. 4) Small programs that generate result presented on a web page. Like any computer program, these may and in some cases do have errors. Almost all of these also make simplifying assumptions so they are not totally accurate even if there are no errors. Please verify all results. 5) Weather information is from numerous of sources and is presented automatically. It is not checked for accuracy either by anyone at L-36.com or by the source which is typically the US Government. See the NOAA web site for their disclaimer. Finally, tide and current data on this site is from 2007 and 2008 data bases, which may contain even older data. Changes in harbors due to building or dredging change tides and currents and for that reason many of the locations presented are no longer supported by newer data bases. For example, there is very little tidal current data in newer data bases so current data is likely wrong to some extent. This data is NOT FOR NAVIGATION. See the XTide disclaimer for details. In addition, tide and current are influenced by storms, river flow, and other factors beyond the ability of any predictive program.