ESP-01S with relay and state input

I have an ESP-01S set up and connected to a relay. I can control the NC/NO of the relay using the ESP-01S after setup. The valve I am trying to connect to the relay has a signal that is sent when it is open or closed. It sends .4v when it is closed and 0 when it is open.

I was hoping I could use a pin on the ESP-01S to read this signal and pass along so I can use in HA. This way I can tell the system how to handle things in case a manual switch opens/closes the valve or the manual override option is used. I don’t want to think the valve is open when it is actually closed and vice versa. Since the signal is already there, I was hoping I could use it as just an input signal on one of the GPIOs so I could pass along to HA. But this is my first project and trying to understand these devices and of course the limited GPIOs that the ESP-01S has.

This is the setup I have:

You can use GPIO03 as a digital input. It will go high at boot time though - not sure if that will cause an issue.

You will probably also need to turn logging off.

0.4 volt is not enough to measure on the ESP01.
You need an ESP with analog pin

1 Like

Or switch a transistor maybe.

@zoogara and @Hellis81 thanks for the information. I hadn’t put the input thought into this when I had ordered the ESP01 combo.