Non-Contact Liquid Level Sensing with the XKC-Y25
Share
The XKC-Y25 detects liquid without ever touching it: clamp the sensor to the outside wall of a plastic or glass tank, and it measures the local dielectric constant through that wall using capacitive sensing. Liquid sitting behind the wall raises the dielectric reading enough for the sensor to flip its digital output; an empty section of wall does not. The result is a simple high or low signal on one wire that tells an Arduino "liquid present" or "no liquid," with no probe, float, or electrode ever entering the fluid.
How does a non-contact liquid sensor work through a container wall?
Capacitive sensing is the mechanism. The XKC-Y25 forms one plate of a capacitor against the container wall; the material behind that wall — air or liquid — acts as the dielectric. Water and most liquids have a much higher dielectric constant than air, so when liquid rises to the sensor's height, the sensor's internal circuit detects the shift in capacitance and switches its digital output state. Because the sensing field passes through the wall itself, the electronics stay completely outside the container, with nothing exposed to moisture, corrosion, or fouling from whatever is inside.
What containers and materials does this actually work with?
This only works through non-metallic walls. Plastic tanks, glass containers, and other thin, non-conductive walls let the sensor's capacitive field pass through to reach the liquid. Metal tanks or metal-lined containers block that field entirely, because a conductive wall short-circuits the capacitive measurement before it ever reaches the liquid — so the XKC-Y25 is not a fit for steel or aluminum vessels. Compoden's own build data on this exact part specifies detection through non-metallic walls in roughly the 2-12mm thickness range, which covers most household and lab-scale plastic tanks, bottles, and pipe sections, but rules out very thick-walled containers along with anything metal.
How do you mount it and wire it to an Arduino Uno?
There is no drilling and no contact with the liquid. The sensor body clamps or straps onto the outside of the container at whatever height you want to detect — near the bottom for a low-level alarm, near the top for an overflow warning. Wiring to an Arduino Uno is a three-wire job: the sensor's VCC goes to the Uno's 5V pin, GND goes to GND, and the digital output signal goes to a spare digital input pin. In the firmware generated for this exact build, that signal line lands on digital pin 2, and the sketch reads it as a simple HIGH/LOW state with no external library required.
What can you build with contact-free liquid detection?
Because the sensor never touches what it's measuring, it suits builds where a submerged probe would be inconvenient or risky: an auto-shutoff for a water pump that cuts power once a tank runs dry, a low-water alarm for an overhead tank or sump, an aquarium or hydroponic reservoir monitor where you don't want electrodes sitting in the water, or an overflow warning mounted near the top of a container. Stacking two or three XKC-Y25 units at different heights on the same tank turns single-point detection into a coarse multi-level gauge, still with zero wetted electronics.
Watch it built live
To see this end to end, we gave Compoden's AI build assistant an outcome, not a part number: "I want to build a project that detects liquid level inside a tank without touching the liquid, using an Arduino Uno." It came back with the correct non-contact sensor on its own, plus a matched Arduino Uno, wiring hardware, and power supply — no product name was fed to it.
From the assistant's actual reply: "This build detects if liquid is present in a tank without touching the liquid. It uses a sensor to check for liquid and an Arduino Uno R3 CH340G ATmega328P Board to process this information." On the sensor specifically: "The XKC-Y25-V Non-Contact Liquid Level Sensor is designed to detect the presence of liquid without making physical contact with it. It uses a GPIO interface, which means it sends a simple high or low signal to indicate if liquid is detected." It also flagged a real installation risk worth repeating: "the sensor needs to be placed correctly on the tank wall to accurately detect the liquid level; improper placement is a frequent cause of false readings."
Watch the firmware get generated
Separately, we asked Compoden's PWA firmware tool (Soldr): "I'm using an XKC-Y25 non-contact liquid level sensor with an Arduino Uno. Write the full firmware to read its digital output and print 'Liquid detected' or 'No liquid' to the serial monitor." The generated sketch defines the sensor's signal pin as SENSOR_PIN 2, comments the remaining two wires directly in the code ("Connect VCC of the sensor to Arduino 5V" and "Connect GND of the sensor to Arduino GND"), opens serial communication with Serial.begin(115200), and names the project "Liquid Level Monitor" internally. The build log confirmed the wiring choice in plain language: "The XKC-Y25-V sensor will be connected to digital pin 2, and output will be printed to Serial at 115200 baud."
Get everything in this build
Every part below is what the AI assistant actually selected for this exact prompt, at current Compoden stock and pricing — not a hand-picked list.
| Part | Role | Price | Add to cart |
|---|---|---|---|
| Arduino Uno R3 CH340G ATmega328P Board | Microcontroller | Rs.230 | Add to cart |
| XKC-Y25-V Non-Contact Liquid Level Sensor | Liquid level sensor | Rs.630 | Add to cart |
| 5V 2A Micro-USB Power Adapter | Power supply | Rs.140 | Add to cart |
| Male-to-Male Breadboard Jumper Wires (20 cm, 24 AWG) | Wiring | Rs.40 | Add to cart |
| SYB-170 Mini Breadboard | Prototyping area | Rs.20 | Add to cart |
| Total (5 parts) | Rs.1,060 | Add all 5 to cart | |
Built and Backed by Compoden
Compoden ships this exact parts tray from real, tracked stock in India, and the same assistant that specced it out also generates the wiring diagram, firmware, and troubleshooting steps so the build doesn't stall between "parts arrived" and "sensor working." Every part above stays linked to the assistant's own reasoning for choosing it, not a generic bundle assembled after the fact.
Frequently asked questions
Does the XKC-Y25 touch the liquid it measures?
No. It mounts on the outside of the tank or pipe and detects liquid through the wall using capacitive sensing, so nothing in the sensor ever contacts the fluid.
Will the XKC-Y25 work on a metal tank?
No. Capacitive sensing needs a non-conductive path to reach the liquid, and a metal or metal-lined wall blocks that field. This sensor is built for non-metallic walls — plastic and glass — in roughly the 2-12mm thickness range.
Which Arduino pin does the sensor connect to?
In the firmware generated for this build, the sensor's digital output lands on Arduino digital pin 2, with VCC wired to the Uno's 5V pin and GND to GND.
Can one XKC-Y25 track a continuously changing liquid level?
No. A single unit reports presence or absence at the one height where it's mounted. To read several levels, mount multiple sensors at different heights on the same tank and read each on its own digital pin.