Tuis » Optiese (Infrarooi) Water Level Sensor Wiring Diagram

Optiese (Infrarooi) Water Level Sensor Wiring Diagram

Junie 8, 2026

Die optical level sensor wiring diagram for a typical 3-wire optical/IR water level sensor is simple: connect VCC to a 5V supply, GND to the common ground, en OUT to the digital input, Relêmodule-inset, or control-switch signal terminal. For an NPN oopversamelaar-uitset, the OUT wire does not always generate a voltage by itself; it usually needs a pull-up so the controller can read a clear HIGH/LOW signal.

In praktiese terme: power the sensor, share the ground, pull the signal up, then let the OUT wire switch the controller input or relay interface. Do not start by guessing wire colors—confirm the pinout from the datasheet or supplier documentation before applying power.

Quick Wiring Diagram in Words

For a common 3-wire optical water level sensor:

VCC → 5V DC
Connect the sensor’s positive supply wire to the controller’s 5V output or a regulated 5V power supply.

GND → 0V / Grond
Connect the sensor ground to the power supply ground and the controller ground. Arduino, Raspberry Pi interface boards, PLC inputs, Relêmodules, and sensor power must share a reference ground.

OUT → Digital input or relay control input
Connect OUT to the input pin that needs to detect liquid presence. If the sensor is NPN open-collector, OUT works like a sinking switch. It pulls the signal down when active, so the input normally needs a pull-up to 5V.

Pull-up → OUT to VCC
The pull-up makes the signal readable when the NPN transistor is not pulling it low. Some microcontrollers can use an internal pull-up; industrial controllers or relay modules may require the correct input wiring according to their circuit design.

Relay or control switch → use an interface
If you are switching a pump, Klep, Alarm, or relay, use a relay module or transistor/driver circuit. Do not assume the sensor OUT wire can power a relay coil directly.

For deeper board-level examples, sien die Arduino-gids en Raspberry Pi guide.

3-Wire Optical / IR Water Level Sensor Pinout Table

Wire colors are common examples only. Always confirm the actual pinout before wiring, especially for OEM/ODM sensors, panel-mount versions, en pasgemaakte kabelsamestellings.

Sensor Pin / WireTipiese FunksieConnect ToWiring Notes
VCC / +VSensor power input5V DC supply in a typical test setupUse the voltage specified for your sensor model. For this guide, the basic wiring example uses 5V.
GND / 0VPower returnController ground and power supply negativeThe ground must be shared between the sensor and the device reading the signal.
UIT / SeinSwitching outputDigitale inset, Relêmodule-inset, control switch input, PLC input interfaceFor NPN open-collector output, use a pull-up so the input can read HIGH when the output is not sinking.
Pull-up connectionSignal referenceOUT to VCCNeeded when the input does not already provide a pull-up.
Relay/control interfaceLoad controlAflos module, Transistordrywer, of beheerderinvoerUse an interface stage for pumps, kleedke, Alarms, or higher-current loads.

How the NPN Open-Collector Output Works

Many 3-wire optical/IR water level sensors use an NPN open-collector Uitset. This means the sensor output behaves like a switch to ground, not like a powered voltage output.

When the sensor output is inactive, the OUT wire may float unless a pull-up is present. With a pull-up, the input reads HIGH. When the sensor output becomes active, the internal transistor pulls OUT toward ground, so the input reads LOW.

This is why many users think the sensor is “not giving voltage.” In reality, the output may be working correctly, but the circuit is missing a pull-up or the controller input is not configured correctly.

For a microcontroller, OUT usually connects to a digital input. For an industrial controller, OUT may connect to a compatible digital input channel. For a relay module, OUT should connect to the signal input only when the module input type is compatible with a sinking NPN signal.

Wet vs Dry Logic: NO and NC Behavior

Optical water level sensors detect whether the sensing tip is in air or covered by liquid. Binne-in die sensor, an IR LED sends light into a prism tip, and a phototransistor detects the returned light. Wanneer die punt droog is, light reflects differently inside the prism. Wanneer vloeistof die punt bedek, Die brekingstoestand verander, so the receiver sees a different signal.

The output logic depends on the sensor design:

  • NO logic may switch ON only when liquid reaches the sensing tip.
  • NC logic may switch OFF when liquid reaches the sensing tip.
  • Some products are available in different output versions.
  • Some control systems invert the logic in software instead of changing hardware.

Because wet/dry behavior can vary by model, do not rely only on the label “optical water level sensor.” Confirm whether your required safe state is wet = active, dry = active, wet = LOW, of dry = LOW.

For pump dry-run protection, many engineers prefer a logic arrangement where a broken wire or lost signal can be treated as a fault. For overflow alarms, the priority is often fast detection when the liquid reaches the high-level point.

Connecting to a Relay or Control Switch

If the optical sensor is used as a control switch, the OUT signal should normally drive a control input, not the load directly.

A safe wiring concept is:

Sensor VCC → 5V
Sensor GND → common ground
Sensor OUT → relay module input or controller input
Relay contacts → pump, Klep, Buzzer, Alarm, or control circuit

The relay contacts do the load switching. The sensor only provides the level signal.

For a bare relay coil, use a proper driver stage. The sensor output is not intended to replace a relay driver unless the current rating and circuit design are confirmed. Inductive loads also need protection such as suppression across the coil or load circuit. In OEM equipment, this is usually handled on the control PCB or relay module.

If you are building a simple prototype, a relay module with a signal input is easier than a loose relay coil. If you are designing a product, confirm the input type, trigger polarity, Lasstroom, Isolasiebehoeftes, and fault behavior before finalizing the wiring.

Testing the Sensor Before Installation

Test the wiring on the bench before installing the sensor in a tank.

Eerste, connect VCC and GND to the correct 5V supply and verify polarity. Then connect OUT to a digital input or meter test point with the correct pull-up. Keep the sensing tip dry and observe the output state. Volgende, cover the prism tip with water and observe whether OUT changes.

If the signal changes when the tip is wetted, the sensor is switching. If the signal does not change, check the power, Grond, pull-up, and logic mode before blaming the sensor.

A multimeter can help, but remember that an open-collector output may not show a clean voltage unless the pull-up and common ground are correct. For microcontroller testing, print the input state in software. For relay testing, watch the relay module indicator and listen for the relay action only after confirming the module is wired correctly.

For more technical product notes, sien die IR-sensor dokumentasie.

Common Wiring Faults and Fixes

No shared ground
The sensor has power, but the controller cannot read OUT correctly. Connect sensor GND and controller GND together.

No pull-up on NPN OUT
The output floats and gives unstable readings. Add or enable a pull-up according to the controller input design.

Wrong wire color assumption
Not every supplier uses the same cable colors. Bevestig VCC, GND, and OUT before applying power.

Reversed wet/dry logic
The sensor works, but the software or relay action is opposite. Confirm NO/NC logic and invert the input in software or select the correct output version.

Trying to drive a relay coil directly
The output may fail or the relay may not switch. Use a relay module, Transistordrywer, or controller input stage.

Dirty prism tip
Oliefilm, Skaal, foam residue, or adhesive contamination can prevent reliable optical switching. Clean the prism and check chemical compatibility.

Reflective or tight mounting area
Tank wall reflections, Borrels, or poor positioning may cause unstable detection. Mount the sensor so the prism tip contacts the target liquid cleanly.

Wrong sensor material
Water, Olie, Chemikalieë, food-grade fluids, Brandstowwe, and corrosive liquids require different wetted materials. Confirm compatibility before ordering.

Materiaal, Montering, and Output Options Buyers Should Check

A wiring diagram solves the electrical connection, but the right sensor selection depends on the liquid, Tenkontwerp, and controller.

For optical/photoelectric point-level detection, the sensing tip is often made from a transparent prism material. Depending on the application, buyers may need PSU, PTFE, 316 Vlekvrye staal behuising, or glass-contact designs. Water tanks and appliances may use compact plastic-bodied sensors. Chemical tanks may require PTFE or stainless construction. Oil and fuel applications need careful material review because swelling, Vlekke, or residue can affect long-term reliability.

Montering maak ook saak. Some sensors are installed through a threaded port, while others use panel mounting, custom flanges, compact probe shapes, or cable-mounted assemblies. The prism tip must sit at the real switching height, not above a dead zone or inside a pocket where liquid does not reach cleanly.

Output type is another purchasing decision. NPN is common for sinking digital inputs. PNP may be preferred by some industrial control systems. For continuous level measurement, buyers may consider analog output such as 4–20 mA instead of a simple point switch. This article focuses on the 3-wire point-level wiring because that is the most common need behind the wiring diagram search.

HojellyTek manufactures photoelectric optical sensing products in Shenzhen with in-house R&D, OEM/ODM-ondersteuning, and export experience for the US, ONS, en Indië. For the broader sensor category, visit the optiese vlaksensor Bladsy.

Wat om te bevestig voordat jy bestel

Before buying a 3-wire optical/IR water level sensor, Bevestig:

  • Supply voltage required by your control board
  • Uitsettipe: NPN, PNP, analoog, of pasgemaakte sein
  • Nat/droë logika: NO or NC behavior
  • Pull-up or input circuit requirement
  • Liquid type and wetted-material compatibility
  • Monteringsdraad, panel hole, Flens, or custom installation method
  • Kabellengte, Konnektor, and wire color definition
  • Whether the sensor will drive a controller input, Relaismodule, Pompbeheer, Alarm, or IoT board
  • Required housing material for water, Olie, Brandstof, Chemiese, or appliance use
  • Whether OEM labeling, Kabelaanpassing, or module integration is needed

For smart home or connected equipment, Tuya/Smart Life integration may be relevant at the system level, but the sensor wiring itself still begins with the same basic rule: Krag, Grond, Sein, and correct input logic.

Vrae

What is the basic optical level sensor wiring diagram?

The basic wiring is VCC to 5V, GND to common ground, and OUT to the input pin or relay module signal input. For an NPN open-collector output, add or enable a pull-up so the signal can switch cleanly between HIGH and LOW.

Does a 3-wire optical water level sensor need a pull-up resistor?

If the output is NPN open-collector, Ja, the signal usually needs a pull-up. Sonder dit, OUT may float and the controller may read unstable or incorrect states. Some boards provide internal pull-ups, but this must be confirmed in the input circuit.

Can I connect the sensor directly to a relay?

Connect the sensor to a relay module input or driver circuit, not directly to a high-current relay coil unless the sensor rating and circuit design confirm it is safe. For pumps, kleedke, en alarms, use the relay contacts to switch the load.

Why does the output stay HIGH or LOW all the time?

Common causes include missing common ground, no pull-up, reversed supply polarity, wrong input logic, incorrect NO/NC assumption, dirty prism tip, or using the wrong output type for the controller. Test the sensor dry and wet before installing it.

Is wet detection normally open or normally closed?

Dit hang van die model af. Some sensors activate when liquid covers the tip; others deactivate. Confirm wet/dry logic before ordering, especially for overflow protection, Droogloopbeskerming, and alarm circuits where fail-safe behavior matters.

Can I use the same sensor with Arduino and Raspberry Pi?

Ja, but the wiring details differ because the input voltage and pull-up arrangement may differ by board. Use the dedicated Arduino and Raspberry Pi wiring guides before connecting the sensor to a development board.

Need Help Matching the Wiring to Your Control Board?

Share your supply voltage, Beheerdertipe, Uitsetvereiste, Vloeibare, Monteringsmetode, and wet/dry logic preference with HojellyTek. Our team can help you confirm the correct 3-wire optical/IR water level sensor wiring, NPN or PNP output choice, material option, and OEM/ODM configuration. Request a quote via WhatsApp or email for samples, datasheets, or custom sensor support.