Connecting a Water Pump Float Switch to ESP8266 GPIO

Hi Team,

I have hopefully a simple elect. engineering question. I have a float switch in my water tank that prevents my water pump from pumping when the water is low.

I would like to tap into this and connect it to a GPIO pin on one of my nearby ESP8266 based devices so I can use this sensor in my automations.

Given the pump controller is sensing for basic continuity across the float switch, I suspect when I tap into it in parallel and connect it to the GPIO and ground pins, that continuity will be present even when the tank is empty (float switch disengaged). Is that right?

If so, what’s the best way to prevent this, and stop the pump from thinking there is water in the tank due to continuity between the GPIO and ground pins?


What about using something like a OPTOCOUPLER

check out “the hook up”

this one