NodeMCU With Simple Water Sensor

D8 = GPIO15, which isn’t a great choice if pins:

Your float switch is just a simple on/off device. One side is connected to D8, where is the other side connected to?

This sketch builder example would be a good starting point…

Pete.

2 Likes