I have a watering system control (Hunter X Core) and I need to activate a pump when the watering starts. The control system has a wire that change 5v to 24v when the system is actived. I want to control this voltage change and then, activate a wifi switch that powered the pump. The problem is that I cant find any hardware that detects this voltage change.
Can anyone help me?
Like the ADC on the ESP8266 can you not proto a voltage divider circuit ?
and make it to sence 24 volts.
That way when it’s 5 volts it won’t be high enough to show up ?
The ESP is a good plan. You dont even need to use the ADC. An 18K Ohm resistor in series with a 2K resistor will drop 24V to 2.4V and 5V to 0.5V i.e. right in the LVTTL logic level sweet spot of the ESP, so you can use a digital GPIO pin. Wire one end of the the 18K to your signal the other to the 2K resistor. The other end of the 2K goes to ground. The junction of the two resistors is your LVTTL signal out to the ESP.
Or if you already have a wifi switch and assuming the 24V/5V signal has enough current, a 24V relay will most likely de-energise when the signal switches to 5V giving you nice voltage free contacts you can use.
Here’s the voltage divider circuit. The diodes and 3.3V connection aren’t necessary but will protect the ESP if there are voltage spikes induced on the line. Probably wise if the connections are longer than a couple of meters outside and you live in a lightning prone area. Otherwise leave them out.