When building automation and monitoring systems, it is common to immediately reach for a microcontroller such as an Arduino or ESP32.
However, not every sensing application requires a programmable device.
For a basic water level indicator, discrete electronics can provide a simple and educational alternative. This project shows how NPN transistors can be used as electronic switches to create a four-stage liquid level detector.
The main advantages of this approach are:
• No microcontroller or programming required.
• Simple and inexpensive components.
• Easy to understand and troubleshoot.
• Suitable for breadboard prototyping.
• Provides visual feedback through LEDs.
• Demonstrates real-world transistor switching.
• Makes use of the conductive properties of water.
The circuit uses four independent transistor switching stages.
A common positive probe is placed at the bottom of the container. Four additional sensor probes are positioned at different heights.
When water reaches a sensor probe, the water provides an electrical path between the common positive probe and that sensor.
The resulting current provides base bias to the corresponding NPN transistor. The transistor switches on and allows current to flow through the LED circuit.
As the water continues to rise, the higher sensor probes are reached one by one, activating additional transistor stages.
The LEDs therefore provide a visual indication of the approximate liquid level:
Stage 1 → Red LED → Low level
Stage 2 → Yellow LED → Intermediate level
Stage 3 → Blue LED → High level
Stage 4 → Green LED → Full level
The circuit does not require software, firmware, or digital communication.
Water Conductivity
Tap water is not a perfect electrical conductor, but it normally contains dissolved minerals and ions that allow a small electrical current to flow.
This property makes it possible to use water as part of the sensing path.
Transistor Switching
The project uses general-purpose NPN transistors as electronic switches.
Each transistor has three terminals:
• Emitter
• Base
• Collector
When sufficient current flows into the transistor's base, the transistor switches on and allows current to flow between the collector and emitter.
In this project, the water provides the electrical path that activates the transistor's base. Once the transistor switches on, the corresponding LED illuminates.
The exact pin arrangement of a 2N2222 can vary depending on the manufacturer and package, so the datasheet for the specific transistor being used should always be checked before wiring the circuit.
MATEO GARCIA