Inversing Float Sensor Readings

Hey everyone,

I have my system up and running, but my float sensor is reading reversed. When it is full it reads 0 bool and shows red, and when it is empty it reads 1 bool and shows green. I know somewhere it says that you can reverse them, but for the life of me I cannot find where to do it.

Thanks in advance,

How you modify the circuit depends on whether your switch is normally open or normally closed and its orientation in the tank. However, you will have to provide this information as well as your circuit to be able to determine what needs to be changed.

It is this switch -Amazon.com

Normally it will be under water - it is a last resort thing to tell me when the water is dangerously low.

Can you provide the circuit you’re using?

Raspberry Pi 4B into a breadboard

That’s not a circuit or enough information to help. I need to know how specifically the sensor/switch is connected to the Pi.

It looks like this - is there supposed to be something between the breadboard and the sensor?

No, that is all that’s needed to measure the state of a switch.

So if you wanted to modify that circuit, you would need to pull your sensing pin high (3.3 v) instead of low (ground).

Perhaps I misunderstood what you’re wanting to do. Simply making 0 be green and 1 red is easy enough, there’s no real reason to need to change the circuit. Just open the Gauge Widget settings and change the colors of 0 and 1.