Close
0%
0%

A Discrete Transistor Approach to Liquid Detection

A simple multi-stage water level indicator built with NPN transistors, LEDs, resistors, and the natural conductivity of water.

Similar projects worth following
0 followers
Forget microcontrollers for simple sensing tasks!

This project demonstrates how to build a reliable multi-stage water level indicator using only discrete electronic components. Instead of relying on an Arduino, ESP32, or other microcontroller, this circuit uses general-purpose NPN transistors as electronic switches to detect rising water levels and activate LEDs sequentially.

The circuit takes advantage of the electrical conductivity of water. As the water level rises, it connects a common positive probe to sensor probes positioned at different heights inside a container. Each sensor activates a transistor stage, which turns on its corresponding LED.

The result is a simple, low-cost, educational liquid detection system that can be assembled on a solderless breadboard.

This project is ideal for beginners learning about transistors, electronic switching, sensor circuits, and basic analog electronics.

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.

  • 4 × 2N2222 Discrete Semiconductors / Transistors, MOSFETs, FETs, IGBTs
  • 4 × 2. 330 Ω Resistors
  • 4 × 3. 5 mm LEDs
  • 1 × 4. DC Power Supply or Battery.
  • 1 × 5. Solderless Breadboard

View all 6 components

  • 1
    1. Step 1 – Connect the Power Supply:

    Connect a 5 V DC power supply to the breadboard.

    • Positive (+) → positive rail
    • Negative (–) → negative rail

    Verify the voltage and polarity before continuing.

  • 2
    2. Step 2 – Install the Transistors:

    Place four 2N2222 NPN transistors on the breadboard.

    For each transistor:

    • Emitter → negative (–) rail
    • Base → corresponding sensor probe
    • Collector → LED/resistor circuit

    Note: Check the manufacturer's datasheet for the correct transistor pinout.

  • 3
    3.Step 3 – Connect the LEDs:

    For each stage:

    1. Connect a 330 Ω resistor to the transistor collector.
    2. Connect the resistor to the LED cathode (–).
    3. Connect the LED anode (+) to the positive rail.

View all 7 instructions

Enjoy this project?

Share

Discussions

Does this project spark your interest?

Become a member to follow this project and never miss any updates