AC Cycle and Duration Counter
YouTuber Soat Mon's ESP8266-based device tracks usage via AC relay.
YouTuber Soat Mon (i.e. student of all things, master of none) had an issue where his water pump was coming on intermittently, indicating a leak of some sort. While no leak is good, there is a huge difference between a tiny leak (that can perhaps be ignored) and a big leak that is wasting a copious amount of water and potentially causing significant damage.
To diagnose the severity of this problem, he implemented a duration/counter with an ESP8266 board and an OLED screen. The unit features a pair of screw terminals that connect to an input pin and ground. An external AC relay is set up to close this connection when the pump control output turns on, and the ESP keeps track of the number of device starts and the total running duration.
Stats are displayed on the OLED. A button provides the only user input, resetting the number of starts and duration to zero when it pulls the input pin low.
Soat Mon has also employed this device to track the heater in his pump house, using a 120VAC relay instead of the 220V relay needed to track the pump itself. The good news is that his pump was only coming on a few times per week for just a few minutes, so it seems he doesn’t have a serious plumbing issue.
Code and print files for the enclosure can be found here. It’s a nice simple setup that should be applicable to a wide variety of situations. At the same time, given the ESP8266’s Wi-Fi capabilities, one could see this project expanded for remote monitoring or alarm duties.