I'm creating a water level indicator so I can turn on a pump when the water level gets too low. I have NPN transistors, but I would like the transistor to act as a switch that closes when the water level drops below a certain height. The NPN transistor I used for the experiment seems to do the opposite (close the switch when the water level is high enough), so I figured I need to use a PNP transistor instead. However, after following this SO suggestion and flipping the connection to the battery terminal as well as the LED, the LED did not turn on as expected when the water level gets too low. I would appreciate your advice.
The circuit below lit the LED when the water level closed the circuit. How do I get the LED to turn on when the circuit is open?