GPIO as Input: Always same Value

Dear Radical DIY Forum :slight_smile:
since a few days i’m trying to get my GPIO Pin as a Input for the Water Level Sensor working.

Unfortunately all the time the value of the pin is “1”.
I tried three different water level sensors but the value is on everything the same. I measured the sensors with a multimeter and everything seems okay.
My Breadboard is exactly build up like on Kyles tutorial:

My configurations on mycodo are as the following:

I’m running out of ideas what I’m doing wrong.

Is it possible that the Raspberry is defect?

Does somebody know what the could be the reason, that the value of the GPIO never changes?
I’m very thankful for every help.


You are using a pull down resistor, I believe you need to change Pin Mode to pull down.


Do your connections as per this drawing and your problem will be solved

1 Like

It works!!!
Thank you both so much!

Can you explain me, why I have to use this specific GPIO and why the others won’t work?
Also why do i need to change the pinmode to pull-down? Is the external 10k Resistor not already enough?

This setup works with any GPIO.

1 Like

It is my understanding that an RPi needs a pull up or pull down resistor when connecting a switch as the circuit will be susceptible to electrical noise. You need to state which configuration you are using.

1 Like

Thanks to you all!
I don’t know what I was doing wrong at all the previous attempts. Maybe the port numbering was incorrect (GPIO numbering vs “global” pin numbering).