Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›XKC-Y25 and XKC-Y26 Non-Contact Liquid Level Sensor

Component guide · Beginner · 4 min read

XKC-Y25 and XKC-Y26 Non-Contact Liquid Level Sensor

NPN, PNP and Wiring

By Geekobot Learning Team · Updated 29 Oct 2026

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerWhat the XKC-Y25 non-contact liquid level sensor isXKC-Y25 non-contact liquid level sensor pinoutWiring the XKC-Y25 non-contact liquid level sensorExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Short answer

The XKC-Y25 and XKC-Y26 detect liquid through the wall of a plastic or glass container, up to about 20 mm thick, using capacitance. Stick one on the outside of a tank at the level you want to detect and it switches when liquid reaches it. No hole, no corrosion and no contact with the liquid. NPN, PNP, logic (V) and RS485 versions suit microcontrollers and PLCs.

Key specs at a glance

Principle
Capacitive, through non-metallic walls
Wall
Up to about 20 mm plastic or glass (not metal)
Supply
5 to 12 V (Y25/Y26), 24 V versions available
Outputs
NPN, PNP, high/low logic (V), RS485
Response
About 500 ms
Tube sensors
DFRobot versions clip onto tubes under or over 10 to 11 mm OD

Models in this guide

These are alternatives. Pick the one that fits your project; you only need one.

  • Option 1XKC-Y25 NPN Intelligent Non-Contact Liquid Water Level Sensor – IP67 ABS₹565
  • Option 2XKC-Y25 PNP Intelligent Non-Contact Water Level Sensor – 50cm Cable₹589
  • Option 3XKC-Y25-V Intelligent Non-Contact Liquid Water Level Sensor – RS485, IP67₹649
  • Option 4XKC-Y26 NPN 24V Intelligent Non-Contact Liquid Level Sensor 50CM₹994
  • Option 5XKC-Y26 NPN Intelligent Non-Contact Liquid Level Sensor 50CM Cable – 5-12V DC₹819
  • Option 6XKC-Y26 PNP Intelligent Non-Contact Liquid Level Sensor 50CM₹769
01

What the XKC-Y25 non-contact liquid level sensor is

The sensor learns the empty state at power-up, so power it on with the tank at its empty point or recalibrate with the adjust wire if your version has one. Thick walls, metal tanks and foam reduce reliability.

NPN outputs pull low when liquid is present (add a pull-up to 3.3 or 5 V); PNP outputs drive high, suited to PLC inputs. The V version gives a direct logic level, the easiest for Arduino.

02

XKC-Y25 non-contact liquid level sensor pinout

The pins on the XKC-Y25 non-contact liquid level sensor and what each one does.

PinFunction
Brown+ supply (5 to 12 V or 24 V)
BlueGround
YellowOutput (NPN, PNP or logic)
BlackMode select on some versions (output polarity)
PinFunction
Brown
+ supply (5 to 12 V or 24 V)
Blue
Ground
Yellow
Output (NPN, PNP or logic)
Black
Mode select on some versions (output polarity)
03

Wiring the XKC-Y25 non-contact liquid level sensor

An NPN output with a pull-up to 3.3 V is safe for an ESP32. A PNP output from a 12 V supply needs a divider or optocoupler before a microcontroller pin.

XKC-Y25 non-contact liquid level sensor pinArduino UnoESP32
Brown (+)5V5V (VIN)
Blue (GND)GNDGND
Yellow (OUT)D2 (with 10k pull-up for NPN)GPIO 27 (NPN with 10k pull-up to 3V3)
Brown (+)
Arduino Uno:
5V
ESP32:
5V (VIN)
Blue (GND)
Arduino Uno:
GND
ESP32:
GND
Yellow (OUT)
Arduino Uno:
D2 (with 10k pull-up for NPN)
ESP32:
GPIO 27 (NPN with 10k pull-up to 3V3)
04

Example code

Swap the logic for PNP or V versions, which go HIGH when liquid is present. Use two sensors for low and high levels to avoid rapid switching.

Pump stop at full level (Uno) · Arduino C++Verify & upload in Electrolark
const int LEVEL = 2, PUMP = 7;

void setup() {
  pinMode(LEVEL, INPUT_PULLUP);      // NPN: LOW when liquid present
  pinMode(PUMP, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  bool full = digitalRead(LEVEL) == LOW;
  digitalWrite(PUMP, full ? LOW : HIGH);
  Serial.println(full ? "FULL, pump off" : "Filling");
  delay(500);
}
05

Setup and tuning

Mounting

press flat against a clean wall using the supplied pad and strap.

Calibration

power on with no liquid at the sensor height.

Metal tanks

will not work through metal; use a float switch instead.

RS485 version

reads status over Modbus for long cable runs.

06

What you need

Shop this list17 of 18 found in our store · ₹12,742

  • XKC-Y25 NPN Intelligent Non-Contact Liquid Water Level Sensor – IP67 ABS: the part this guide coversXKC-Y25 NPN Intelligent Non-Contact Liquid Water Level Sensor – IP67 ABS₹565
  • XKC-Y25 PNP Intelligent Non-Contact Water Level Sensor – 50cm Cable: another version this guide coversXKC-Y25 PNP Intelligent Non-Contact Water Level Sensor – 50cm Cable₹589
  • XKC-Y25-V Intelligent Non-Contact Liquid Water Level Sensor – RS485, IP67: another version this guide coversXKC-Y25-V Intelligent Non-Contact Liquid Water Level Sensor – RS485, IP67₹649
  • XKC-Y26 NPN 24V Intelligent Non-Contact Liquid Level Sensor 50CM: another version this guide coversXKC-Y26 NPN 24V Intelligent Non-Contact Liquid Level Sensor 50CM₹994
  • XKC-Y26 NPN Intelligent Non-Contact Liquid Level Sensor 50CM Cable – 5-12V DC: another version this guide coversXKC-Y26 NPN Intelligent Non-Contact Liquid Level Sensor 50CM Cable – 5-12V DC₹819
  • XKC-Y26 PNP Intelligent Non-Contact Liquid Level Sensor 50CM: another version this guide coversXKC-Y26 PNP Intelligent Non-Contact Liquid Level Sensor 50CM₹769
  • XKC-Y26 PNP Intelligent Non-Contact Liquid Level Sensor 50CM Cable: another version this guide coversXKC-Y26 PNP Intelligent Non-Contact Liquid Level Sensor 50CM₹769
  • XKC-Y26-V Non-contact Water Liquid Level Induction Switch Detector Sensor 5-12V DC: another version this guide coversXKC-Y26-V Non-contact Water Liquid Level Induction Switch Detector Sensor 5-12V DC₹859
  • DFRobot Gravity Non-contact Digital Water / Liquid Level Sensor for Arduino – XKC-Y25-T12V Chip: another version this guide coversDFRobot Gravity Non-contact Digital Water / Liquid Level Sensor for Arduino – XKC-Y25-T12V Chip₹1,469
  • DFRobot Gravity Capacitive Non-contact Liquid Level Sensor (3mm TR, IP67): another version this guide coversDFRobot Gravity Capacitive Non-contact Liquid Level Sensor (3mm TR, IP67)₹1,153
  • DFRobot Non-contact Capacitive Liquid Level Sensor for Container OD > 11mm – Digital Switch Output: another version this guide coversDFRobot Non-contact Capacitive Liquid Level Sensor for Container OD > 11mm – Digital Switch Output₹1,489
  • DFRobot Non-contact Capacitive Liquid Level Sensor for Tube OD≤10mm – Digital Switch Output: another version this guide coversDFRobot Non-contact Capacitive Liquid Level Sensor for Tube OD≤10mm – Digital Switch Output₹1,489
  • Generic 24V Capacitive Contactless Externally Liquid Level Sensor – 35cm Cable: another version this guide covers24V Capacitive Contactless Externally Liquid Level Sensor – 35cm Cable₹419
  • Uno R3 development board: the controller used in the wiring tableFind this part
  • ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
  • 5V relay module with optocoupler: to switch a pump or valve5V Relay Module with Optocoupler₹74
  • R385 diaphragm water pump 12V: a pump to controlR385 / R365 Diaphragm Water Pump 12V₹220
  • Buzzer module 3.3-5 V: for an audible alarmBuzzer Module 3.3–5V₹27
07

Alternatives and when to choose them

  • ✓Float level switch: mechanical switch inside the tank.
  • ✓Liquid level sensors: all level methods compared.
  • ✓Photoelectric level sensor: optical point level.
08

Common mistakes to avoid

  • !Mounting on a metal tank.
  • !Power-up with liquid already at the sensor, so it learns the wrong state.
  • !PNP 12 V output straight into a GPIO.
  • !Thick or foam-insulated walls.
09

Frequently asked questions

Does it work through glass?

Yes, glass and plastic up to about 20 mm.

NPN or PNP?

NPN with a pull-up for Arduino; PNP for most PLC inputs.

Can it measure continuous level?

No, it detects a single point; use several for steps.

Will water vapour trigger it?

Usually not; heavy condensation can.

What about thin tubes?

Use the DFRobot tube versions sized for the tube diameter.

Parts for this guide

  • XKC-Y25 NPN Intelligent Non-Contact Liquid Water Level Sensor – IP67 ABS
    ₹565View
  • XKC-Y25 PNP Intelligent Non-Contact Water Level Sensor – 50cm Cable
    ₹589View
  • XKC-Y25-V Intelligent Non-Contact Liquid Water Level Sensor – RS485, IP67
    ₹649View
  • XKC-Y26 NPN 24V Intelligent Non-Contact Liquid Level Sensor 50CM
    ₹994View
  • XKC-Y26 NPN Intelligent Non-Contact Liquid Level Sensor 50CM Cable – 5-12V DC
    ₹819View
  • XKC-Y26 PNP Intelligent Non-Contact Liquid Level Sensor 50CM
    ₹769View
  • XKC-Y26 PNP Intelligent Non-Contact Liquid Level Sensor 50CM Cable
    ₹799View
  • XKC-Y26-V Non-contact Water Liquid Level Induction Switch Detector Sensor 5-12V DC
    ₹859View
  • DFRobot Gravity Non-contact Digital Water / Liquid Level Sensor for Arduino – XKC-Y25-T12V Chip
    ₹1,469View
  • DFRobot Gravity Capacitive Non-contact Liquid Level Sensor (3mm TR, IP67)
    ₹1,153View
  • DFRobot Non-contact Capacitive Liquid Level Sensor for Container OD > 11mm – Digital Switch Output
    ₹1,489View
  • DFRobot Non-contact Capacitive Liquid Level Sensor for Tube OD≤10mm – Digital Switch Output
    ₹1,489View
  • 24V Capacitive Contactless Externally Liquid Level Sensor – 35cm Cable
    ₹419View
  • Uno R3 Development Board (No Cable)
    ₹359View
  • ESP32-WROOM-32 38-Pin Development Board
    ₹389View
  • 5V Relay Module with Optocoupler
    ₹74View
  • R385 / R365 Diaphragm Water Pump 12V
    ₹220View
  • Buzzer Module 3.3–5V
    ₹27View
Shop Water, Liquid Level & Flow Sensors

Projects that use it

Put this into practice: 9 step-by-step builds in our project library use parts from this guide.

Beginner · 1 hourContactless tank full alarmView projectBeginner · 1 hourContactless tank low alarmView projectBeginner · 1 hourCoolant reservoir low alarmView project
Browse all 9 projects

Keep learning

Buying guideIntermediateLiquid Level SensorsThe right liquid level sensor depends on whether you need a single trip point or a continuous reading.3 min read · SensorsComponent guideBeginnerFloat Level Switch (Small Vertical, Side-Mount and Cable Float)A float switch has a float that rises with the liquid and moves a magnet past a reed switch (small floats) or tilts a switch inside the cable float (tank floats).5 min read · SensorsHow-toBeginnerMini Water Pumps for Arduino ProjectsA mini submersible pump is a small DC motor that pushes water when it sits underwater.3 min read · Motors & Motion

Sources

  • XKC-Y25 and XKC-Y26 datasheets
  • DFRobot non-contact liquid level sensor wiki

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWhat the XKC-Y25 non-contact liquid level sensor isXKC-Y25 non-contact liquid level sensor pinoutWiring the XKC-Y25 non-contact liquid level sensorExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide8 items · ₹7,553

XKC-Y25 NPN Intelligent Non-Contact Liquid Water Level Sensor – IP67 ABS · XKC-Y25 PNP Intelligent Non-Contact Water Level Sensor – 50cm Cable · XKC-Y26 NPN 24V Intelligent Non-Contact Liquid Level Sensor 50CM · XKC-Y26 NPN Intelligent Non-Contact Liquid Level Sensor 50CM Cable – 5-12V DC · XKC-Y26 PNP Intelligent Non-Contact Liquid Level Sensor 50CM · XKC-Y26-V Non-contact Water Liquid Level Induction Switch Detector Sensor 5-12V DC · DFRobot Gravity Non-contact Digital Water / Liquid Level Sensor for Arduino – XKC-Y25-T12V Chip · DFRobot Non-contact Capacitive Liquid Level Sensor for Container OD > 11mm – Digital Switch Output

Run itChange the inputs and watch the output

Senses water through a plastic wall up to about 20 mm thick. Output goes LOW when liquid is level with it.

Pump ON
Serial monitor9600 baud
Filling

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question