Schematic Of The Liquid Level Optical Sensor

Aug 02, 2026

Leave a message

Schematic of the Liquid Level Optical Sensor - Inside the Circuit

A complete guide to the schematic of a liquid level optical sensor (TIR type): the block diagram, every component and its role with typical values, how the light path becomes an electrical state, the comparator-with-hysteresis threshold circuit, the output stage variants (NPN open collector, PNP, push-pull), the external wiring schematic with pull-up and relay drive, why built-in hysteresis means no software debounce, the failure-mode-to-schematic-node troubleshooting map, the FAQ, and the bottom line.


Schematic of the Liquid Level Optical Sensor - Quick Answer

The schematic of a TIR optical liquid level sensor contains three functional blocks: an optical head (IR LED + phototransistor facing each other behind the cone tip), a conditioning stage (a comparator with built-in hysteresis that turns the phototransistor's analog signal into a clean logic level), and a digital output stage (typically an NPN open-collector transistor). In the dry state, the tip's total internal reflection guides the LED's light back to the phototransistor, which conducts and drives one comparator input past its threshold; when liquid covers the tip, refraction steals the light, the phototransistor stops conducting, the comparator input crosses the opposite threshold, and the output flips. Hysteresis (two different thresholds for rising and falling) prevents chatter at the liquid surface - which is why these sensors need no software debounce. The external schematic is a three-wire hookup - V+, GND, and an open-collector OUT that needs a pull-up resistor (e.g., 10 kΩ) - and loads are driven through a relay or MOSFET, never directly from the logic pin. (The physics is the cluster's verified optical principle: How Optical Level Sensors Work; the output logic: Digital Output Level Sensor - OS2.)


The Block Diagram

Three Blocks, One Function

The internal architecture:

Block Function Contents
1. Optical head Turn liquid state into light state IR LED + phototransistor
2. Conditioning Turn light state into logic level Comparator + threshold + hysteresis
3. Output Drive the outside world NPN open-collector / PNP / push-pull

Sense → condition → output: The schematic is the same signal chain every sensor in this cluster uses - sense, transduce, condition, output - compressed into three blocks. The optical head is the sensing element: an IR LED (850–950 nm typical) and a phototransistor arranged so the tip's TIR behavior routes light from one to the other. The conditioning block is a comparator that compares the phototransistor's signal against an internal threshold - with hysteresis so the output is stable at the wet/dry transition. The output block is a transistor stage that switches the load. There is no microcontroller inside a point-level optical sensor, no ADC, and no calibration - the entire "intelligence" is the comparator threshold. (The same chain, applied to temperature: Basic Components of a Temperature Sensor.)


Component by Component

Every Part and Its Job

The bill of materials:

Component Role Typical Value
IR LED Light source 850–950 nm
Phototransistor Light detector NPN phototransistor
LED current-limit resistor Set LED drive ~10–15 mA drive
Load resistor (photo) Convert current to voltage 10 kΩ class
Comparator Threshold + hysteresis Dual-threshold
Output transistor Switch the load NPN open collector
Decoupling capacitor Supply noise 0.1 µF

Seven parts, one job: The IR LED emits in the near-infrared (850–950 nm), invisible to the eye but perfectly suited to the plastic tip's TIR geometry. The phototransistor conducts proportionally to the light it receives. A current-limit resistor sets the LED drive (about 10–15 mA), and a load resistor converts the phototransistor's collector current into a voltage the comparator can read. The comparator compares that voltage against an internal reference - with hysteresis, two thresholds for rising and falling signals. The output transistor (NPN open collector) sinks the load current when active. A decoupling capacitor (0.1 µF) filters supply noise. That is the entire schematic: no exotic parts, no firmware, no calibration circuit. (Component-thinking across the cluster: What Are the Basic Components of a Temperature Sensor?)


The Light Path → Electrical State

How the Schematic Reads Wet or Dry

The state table:

State Light at tip Phototransistor Comparator Output
Dry TIR reflects to detector Conducts (on) One threshold crossed State A
Wet Refraction steals light Off Opposite threshold State B

One optical event, one electrical flip: In the dry state, air (refractive index ≈ 1.00) at the tip keeps the LED's light in total internal reflection, so the beam returns to the phototransistor; the phototransistor conducts, its load resistor develops a high voltage, and the comparator output sits in one state. When liquid covers the tip - water ≈ 1.33, oil ≈ 1.46 - the higher refractive index breaks TIR and the light refracts out into the liquid; the phototransistor stops conducting, the comparator input voltage collapses past the opposite threshold, and the output flips. The schematic's beauty is that the entire liquid-sensing decision reduces to one resistor voltage crossing a threshold. The output's exact logic state (HIGH or LOW when wet) depends on the output stage and the wiring, but the internal event is always the same. (The physics, from the top: Optical Liquid Point Level Sensors.)


The Comparator: Thresholds and Hysteresis

Why Two Thresholds Beat One

The hysteresis circuit behavior:

Condition Comparator Action
Rising signal (dry→wet) Crosses the high threshold, output flips
Falling signal (wet→dry) Crosses the low threshold, output flips back
Between thresholds Output holds last state (no chatter)

Stability at the liquid surface: A single-threshold comparator would chatter - the liquid surface ripples, the phototransistor signal wiggles around the threshold, and the output oscillates. The schematic solves this with hysteresis: two thresholds, a higher one for the rising (dry→wet) direction and a lower one for the falling (wet→dry) direction. Between the two thresholds, the comparator holds its last state, so the output snaps cleanly once per transition instead of buzzing. This is why optical level sensors need no software debounce - the debounce is built into the silicon. Hysteresis width is a datasheet property of the specific part; a wider band is more immune to ripples and foam, a narrower band responds to finer level changes. (Datasheet reading: Sensor Data Sheet: How to Read and Use One.)


Output Stage Variants

How the Schematic Drives the World

Three output topologies:

Type Behavior External Need
NPN open collector Sinks to ground when active Pull-up resistor
PNP (source) Sources supply when active Pull-down resistor
Push-pull Drives both high and low None

Sink, source, or both: The output stage is the schematic's interface to the outside world. NPN open collector - the most common in the optical level family - is a transistor that can only pull the output line to ground; it needs an external pull-up resistor (10 kΩ class) to define the high state, and the logic reads HIGH when dry / LOW when wet (or the inverse, per part). PNP variants source supply when active and need a pull-down. Push-pull stages drive both high and low with no resistor - convenient for PLC inputs, at the cost of a slightly more complex output stage. The choice matters for polarity, wiring, and which controllers the sensor mates with. (Full topology comparison: Digital Output Level Sensor - OS2.)


The External Wiring Schematic

Three Wires and a Relay

The practical hookup:

Node Connection
V+ Supply (per part, e.g., 8–30 VDC family)
GND Common ground
OUT Pull-up (10 kΩ) to V+, then to controller input
Load Relay/MOSFET driven by OUT, with flyback diode

The classic three-wire circuit: In the standard schematic, V+ and GND power the sensor, and OUT is the open-collector node. A 10 kΩ pull-up resistor between OUT and V+ produces a clean logic level for the controller's input. If the sensor drives a pump, alarm, or valve, the load goes through a relay or MOSFET - the sensor's output transistor switches the relay coil, and a flyback diode across the coil absorbs the inductive kick. Never draw the load current directly through the logic pin: the output is rated for a specific sink/source current, and an inductive load without the diode can destroy the output transistor on power-down. This exact three-wire pattern appears across the entire optical level family. (Hookup practice: Photoelectric Water / Liquid Level Sensor for Arduino; pump control: OS2 Application Note.)


Failure Mode → Schematic Node

Troubleshooting by Circuit Position

Which part, which symptom:

Symptom Schematic Node Likely Cause
Stuck in one state Optical head Fouled/dirty tip, failed LED
Chatter/oscillation Comparator Failed hysteresis (rare), marginal supply
No output at all Output stage Dead transistor, bad solder joint
False wet reading Phototransistor Leakage, contamination, LED drift
Intermittent Supply/decoupling Noise, loose connector, low voltage

Every failure maps to a node: The schematic doubles as a fault map. A sensor stuck in one state points to the optical head - a dirty or coated tip holding the light path fixed, or a failed LED. Chatter points to the comparator's hysteresis or a marginal supply. No output points to the output stage - a dead transistor or a cold solder joint. A false wet reading points to the phototransistor - leakage current or optical contamination. Intermittent behavior points to the supply and decoupling - noise, a loose connector, or undervoltage. Cleaning the tip fixes the most common failure; everything else is electronics. (The same diagnostic logic, full article: Level Sensor, Optical, Version 2 - Troubleshooting.)


FAQ

Q1: What is inside an optical liquid level sensor?

Three functional blocks: an optical head (an IR LED around 850–950 nm and a phototransistor arranged behind the cone tip), a conditioning stage (a comparator with built-in hysteresis that converts the phototransistor's analog signal into a clean logic level), and a digital output stage (typically an NPN open-collector transistor). Supporting parts are an LED current-limit resistor, a phototransistor load resistor, and a decoupling capacitor. There is no microcontroller, no ADC, and no calibration circuit.

Q2: How does the schematic detect wet versus dry?

The tip's total internal reflection routes the LED's light to the phototransistor when dry (air, refractive index ≈ 1.00), so the phototransistor conducts and the comparator sits in one state. When liquid covers the tip (water ≈ 1.33, oil ≈ 1.46), the higher refractive index breaks TIR, the light refracts out into the liquid, the phototransistor stops conducting, the comparator input crosses the opposite threshold, and the output flips. The entire wet/dry decision is one resistor voltage crossing a threshold.

Q3: Why does the sensor not need software debounce?

Because the comparator has built-in hysteresis - two thresholds instead of one. A single threshold would chatter as the liquid surface ripples around it. With hysteresis, the rising signal (dry→wet) crosses the high threshold and the falling signal (wet→dry) crosses the low threshold; between the thresholds the output holds its last state. The output snaps once per transition, so no software debounce is needed - the debounce is in the silicon.

Q4: How do I wire the open-collector output?

The standard three-wire hookup is V+ to supply, GND to common ground, and OUT to the controller input with a 10 kΩ pull-up resistor between OUT and V+ to define the high state. With the pull-up, the output reads HIGH when dry and LOW when wet (or the inverse, per part). Drive loads like pumps or alarms through a relay or MOSFET - with a flyback diode across the relay coil - never directly from the logic pin, because the output has a rated sink/source current.

Q5: What fails first in these sensors, mechanically or electrically?

Almost always optically: the tip. A fouled, scaled, or coated tip holds the light path in one state and the sensor appears "stuck" - this is the most common failure and the fix is cleaning. Electrically, the parts are solid-state with no moving components, so failures are rare; when they happen they map to the schematic - a failed LED, a leaky phototransistor, a dead output transistor, or supply/connector problems. The failure-mode-to-schematic-node map covers all of them.


The Bottom Line

The schematic of a TIR optical liquid level sensor is three blocks - optical head (IR LED + phototransistor behind the cone tip), conditioning (comparator with built-in hysteresis), and output (NPN open collector, PNP, or push-pull) - plus a handful of support parts (LED current-limit resistor, phototransistor load resistor, 0.1 µF decoupling). Dry air at the tip keeps the LED's light in total internal reflection back to the phototransistor; liquid's higher refractive index breaks TIR, steals the light, and flips the comparator - so the entire wet/dry decision is one resistor voltage crossing a threshold. Hysteresis gives two thresholds and clean snap transitions, which is why no software debounce is needed. The external wiring is three wires - V+, GND, and open-collector OUT with a 10 kΩ pull-up - with loads driven through a relay or MOSFET and a flyback diode. And every common failure maps to a schematic node: a stuck sensor is a dirty tip, chatter is the comparator or supply, a false wet reading is the phototransistor, no output is the output stage. Read the schematic and you can read the sensor - and every sensor in the optical family is this same circuit in a different package.


Last updated: August 2026

Disclaimer: This article is an educational guide to the internal schematic of a TIR optical liquid level sensor for general reference. The block architecture (optical head, conditioning, output), component roles, and typical values (IR LED 850–950 nm, LED drive ~10–15 mA, phototransistor load 10 kΩ class, 0.1 µF decoupling, 10 kΩ external pull-up, comparator with hysteresis) reflect the standard circuit architecture of the optical level sensor family; specific values, output topologies, hysteresis widths, supply ranges, and logic polarity vary by manufacturer and part number and must be confirmed on the official data sheet for the specific sensor. This guide is not affiliated with any manufacturer.

Send Inquiry