Build it step by step
0 of 7 doneStick the sensor on the bowl
At the low mark on a flat wall, on the outside.
Wire the sensor
5V, GND and OUT to D2.
Wire the light, buzzer and button
LED through 220 ohms to D6, buzzer to D8, button to D3.
Upload and check the serial monitor
It says the bowl watch started.
Pour water above the mark
Nothing happens.
Lower the water below the mark
After ten seconds the light flashes.
Press the button
The light stops until you refill.
How do you build a pet water bowl reminder?
A non-contact sensor stuck to the outside of a pet's water bowl flashes a light when the water is low and beeps once if it stays low for an hour. It does not replace checking the bowl. Keep the electronics beside the bowl and away from splashes. You need Arduino Nano, Water level sensor (non-contact, XKC-Y25), LED 5 mm red, Resistor 220 Ω, Passive buzzer, Tactile push button 6 mm, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 50 minutes.
- Level
- Beginner
- Time
- About 50 min
- Parts
- 8
Parts list
- Development BoardsBuyArduino Nano × 1
- SensorsBuy
- SemiconductorsBuyLED 5 mm red × 1
- PassivesBuyResistor 220 Ω × 1
- Motors & ActuatorsBuyPassive buzzer × 1
- SwitchesBuy
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Sensor VCC and GND | Nano 5V and GND | Sensor power |
| Sensor OUT | Nano D2 | High or low depending on the water |
| LED long leg | Nano D6 through a 220 ohm resistor, short leg to GND | Low water light |
| Passive buzzer + and - | Nano D8 and GND | One reminder beep |
| Silence button | Nano D3 and GND | Silences the light and beep until you refill |
Code
The non-contact sensor sticks to the outside of the bowl and senses whether there is water on the other side of the wall, so nothing gets wet. Put it at the level you call low. Many of these modules give a high signal when they sense water and a low signal when they do not, and some give the opposite, so if the light does the wrong thing change WET_IS_HIGH. The sensor works through thin plastic or glass, and works best on a flat wall, so check it with the bowl full and with the water below the mark. A low reading must last ten seconds before it counts, so a pet knocking the bowl or the water sloshing does not set it off. When the water is low the light flashes, and if it is still low after an hour the buzzer gives a single beep. The silence button stops the light until the sensor sees water again. This is a reminder only and never a substitute for looking at the bowl every day, especially in hot weather. Keep the Nano, buzzer and wiring out of reach of pets and away from splashes, and keep wires tidy so they cannot be chewed.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
const uint8_t SENSOR = 2;
const uint8_t BTN = 3;
const uint8_t LED = 6;
const uint8_t BUZZ = 8;
const bool WET_IS_HIGH = true; // change if your module gives the opposite
const unsigned long LOW_CONFIRM_MS = 10000UL; // water must read low this long (stops sloshing false alarms)
const unsigned long BEEP_AFTER_MS = 3600000UL; // one beep after an hour
bool lowWater = false;
bool silenced = false;
bool beeped = false;
unsigned long lowSince = 0;
unsigned long lowCandidateSince = 0;
bool candidate = false;
bool isWet() {
bool level = digitalRead(SENSOR);
return WET_IS_HIGH ? level : !level;
}
void setup() {
pinMode(SENSOR, INPUT);
pinMode(BTN, INPUT_PULLUP);
pinMode(LED, OUTPUT);
pinMode(BUZZ, OUTPUT);
Serial.begin(9600);
Serial.println(F("Bowl watch started."));
}
void loop() {
unsigned long now = millis();
bool wet = isWet();
if (wet) { // refilled: clear everything
if (lowWater) Serial.println(F("Water is back."));
lowWater = false; candidate = false; silenced = false; beeped = false;
digitalWrite(LED, LOW);
} else {
if (!candidate) { candidate = true; lowCandidateSince = now; }
if (!lowWater && now - lowCandidateSince >= LOW_CONFIRM_MS) {
lowWater = true;
lowSince = now;
Serial.println(F("Water is low."));
}
}
if (lowWater && !silenced) {
digitalWrite(LED, (now / 500) % 2); // flash the light
if (!beeped && now - lowSince >= BEEP_AFTER_MS) {
tone(BUZZ, 1500, 400); // one reminder beep, not a continuous alarm
beeped = true;
}
} else if (lowWater) {
digitalWrite(LED, LOW);
}
if (digitalRead(BTN) == LOW) { silenced = true; delay(200); }
delay(50);
}What the serial monitor should show
Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.
Bowl watch started.
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Water above the mark | Light off |
| Water below for ten seconds | Light flashes |
| Low for an hour | One beep |
| Silence button | Light stops |
| Refill | Everything resets |
If it does not work
Light flashes with a full bowl
Change WET_IS_HIGH to false.
Never notices the water level
Press the sensor flat against the wall and move it to the mark.
False alarms
Increase LOW_CONFIRM_MS.
No beep
Wait a full hour, or shorten BEEP_AFTER_MS to test.
LED stays dark
Check its direction and the 220 ohm resistor.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the pet water bowl reminder?
Arduino Nano, Water level sensor (non-contact, XKC-Y25), LED 5 mm red, Resistor 220 Ω, Passive buzzer, Tactile push button 6 mm, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
How long does the pet water bowl reminder take to build?
About 50 minutes for a beginner maker, in 7 steps.
How do I know the pet water bowl reminder works?
Water above the mark: Light off. Water below for ten seconds: Light flashes. Low for an hour: One beep.
Light flashes with a full bowl: what should I check?
Change WET_IS_HIGH to false.
Never notices the water level: what should I check?
Press the sensor flat against the wall and move it to the mark.
False alarms: what should I check?
Increase LOW_CONFIRM_MS.
No beep: what should I check?
Wait a full hour, or shorten BEEP_AFTER_MS to test.
