Blogs
XKC-Y25-V Non-Contact Water Liquid Level Sensor
XKC-Y25-V Non-Contact Water Liquid Level Sensor
Capacitive Detection Without Physical Contact
Introduction
The XKC-Y25-V is a non-contact liquid level sensor that detects water presence through capacitive sensing without direct contact with the liquid. This makes it ideal for applications requiring hygienic measurement or where sensor corrosion is a concern.
Key Features
Non-Contact
Detects through container walls without liquid contact
Digital Output
Simple HIGH/LOW signal for water detection
Low Power
Operates at 3.3V-5V with minimal current draw
Adjustable
Sensitivity control via potentiometer
Technical Specifications
Operating Voltage | 3.3V – 5V DC |
---|---|
Output Type | Digital (TTL) |
Detection Method | Capacitive (non-contact) |
Max Container Thickness | 5mm (plastic/glass) |
Current Consumption | <15mA |
Response Time | <100ms |
Operating Temperature | -10°C to +50°C |
Protection Rating | IP65 (sensor only) |
Pin Configuration

Pin | Label | Description | Arduino Connection |
---|---|---|---|
1 | VCC | Power (3.3V-5V) | 5V |
2 | GND | Ground | GND |
3 | OUT | Digital output | D2 |
4 | EN | Enable pin (optional) | D3 (or leave unconnected) |
Note: The sensor must be mounted flush against the container’s outer surface for proper operation
Wiring with Arduino
1 2 3 4 5 6 7 8 9 10 |
// Basic Connections: // VCC → 5V // GND → GND // OUT → D2 (digital input) // Optional: // EN → D3 (digital output for enable/disable) // Mount sensor against container wall // Adjust sensitivity potentiometer as needed |
Important: Container material must be non-metallic (plastic/glass) for proper detection
Basic Water Detection Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
// XKC-Y25-V Water Level Sensor Basic Example const int sensorPin = 2; void setup() { Serial.begin(9600); pinMode(sensorPin, INPUT); } void loop() { int waterDetected = digitalRead(sensorPin); if (waterDetected == HIGH) { Serial.println("Water detected!"); } else { Serial.println("No water detected"); } delay(500); } |
Advanced Features
Sensitivity Adjustment
1 2 3 4 |
// Physical adjustment via potentiometer: // 1. Apply water to desired detection level // 2. Slowly rotate potentiometer until LED changes state // 3. Test with varying water levels |
Enable Control
1 2 3 4 5 6 7 8 9 10 11 12 |
// Power saving with enable pin void setup() { pinMode(EN_PIN, OUTPUT); } void takeMeasurement() { digitalWrite(EN_PIN, HIGH); delay(50); // Allow stabilization bool waterPresent = digitalRead(SENSOR_PIN); digitalWrite(EN_PIN, LOW); return waterPresent; } |
Multiple Sensors
1 2 3 4 5 6 7 8 9 |
// Monitor multiple levels void checkLevels() { bool lowLevel = readSensor(LOW_SENSOR); bool highLevel = readSensor(HIGH_SENSOR); if (highLevel) Serial.println("Tank full"); else if (lowLevel) Serial.println("Tank half full"); else Serial.println("Tank empty"); } |
Debounce Logic
1 2 3 4 5 |
// Prevent rapid state changes bool stableRead(int pin) { int count = 0; for (int i = 0; i < 5; i++) { if (digitalRead(pin)) count++; delay(10); } return count >= 3; } |
Troubleshooting
No Detection
- Check container material is non-metallic
- Adjust sensitivity potentiometer
- Ensure sensor is flush against container
False Positives
- Reduce sensitivity
- Check for condensation on container
- Move away from electrical noise sources
Inconsistent Readings
- Clean sensor surface
- Ensure stable power supply
- Implement software debouncing