Arduino with Non Contact Liquid Sensor Circuit is useful to detect water or any liquid without touching it.
It is called contactless sensor.
It works on capacitance change near container wall.
Sensor sense water inside plastic or glass without direct contact.
It is safe, easy and clean project one should give it a try for.
Circuit Coding:
int sensorPin = 8;
int sensorValue = 0;
void setup() {
pinMode(sensorPin, INPUT);
Serial.begin(9600);
}
void loop() {
sensorValue = digitalRead(sensorPin);
if(sensorValue == HIGH) {
Serial.println("Liquid Detected");
} else {
Serial.println("No Liquid");
}
delay(500);
}
Code Explanation:
- Sensor pin is set as input.
- Arduino read signal using digitalRead.
- If sensor output HIGH then it means liquid is present.
- Serial monitor show “Liquid Detected”.
- If LOW then “No Liquid” will be shown.
- Delay is added for slow print.
Circuit Working:

Parts List:
Component | Quantity |
---|---|
Arduino UNO | 1 |
XKC-Y26-V Sensor | 1 |
Multimeter | 1 |
Container like Plastic or Glass | 1 |
- Put plastic or glass water container on table as per circuit diagram.
- Clean outer wall where sensor will sit.
- Place XKC-Y26-V sensor on outside wall with flat side near water line.
- Fix sensor with tape or clip but not too hard.
- Connect Red wire to Arduino 5V.
- Black wire to Arduino GND.
- Green wire to Arduino pin D8 or multimeter +
- If using a multimeter then black probe to GND and red probe to signal wire.
- Start with empty container.
- Sensor will see air only.
- Output will be LOW to 0V.
- Multimeter will show 0V.
- Arduino will read LOW.
- No buzzer or pump.
- Pour water slowly.
- Water rise to sensor level.
- When water is near sensor then dielectric will change.
- Capacitance increase inside sensor.
- Circuit detects the change.
- Output will go HIGH to 5V.
- Multimeter will show 5V.
- Arduino will read HIGH.
- Now buzzer, LED, pump can turn ON.
- If water keep rising then output will stay HIGH.
- Sensor changes only when level crosses.
- When water goes down then dielectric back to air.
- Capacitance will drop.
- Output will go back to LOW with 0V.
- Multimeter will show 0V.
- Arduino will read LOW.
- Pump or alarm will stop.
Formula:
Sensor work on capacitance formula.
C = ε × A / d
where,
- C is capacitance
- ε is permittivity of material
- A is plate area
- d is distance between sensor and liquid.
When liquid level rises effective permittivity ε increase.
So capacitance change.
Sensor detect this change and give digital output.
How to Build:
To build a Arduino with Non Contact Liquid Sensor Circuit follow the below connections steps:
- Gather all the components as shown in circuit diagram
- Sensor Red wire goes to 5V pin of Arduino.
- Black wire goes to GND pin.
- Green wire is signal output pin and is connected to Arduino digital pin D8.
- multimeter connect its black probe to GND
- And red probe to sensor signal output of sensor
Conclusion:
Arduino with Non Contact Liquid Sensor Circuit is very simple.
It is safe because no direct touch with liquid.
It uses capacitance principle.
With Arduino we can detect level and make alarms, motor control or auto cut off.
It is cheap, useful and easy for projects.
Leave a Reply