Project - Water sensor with wifi - Should be simple?

Hi!

This is my first arduino project - I think it should be a simple enough thing to do but I’m very lost.
I have very basic coding knowledge in python & basic electronics (I’ve made analogue guitar pedals for years), so I think this should be a project I can tackle head on!

I’ve ordered myself a beginner kit so I can play around, but the project I’m wanting to do:

I have a feeding/drinking station for my dog, its a little stand thingo I made - I want to put in a water sensor (or possibly alternatively a weight sensor for the bowl rims of the bowl?) so that basically when my dogs water bowl is near empty (below a certain level / under a certain weight) - it sends an alert to me.

I thought maybe I’d need to get a weight sensor for the bowl and program to measure when its < x grams and send a note from there, however found:

Either way - I need some advice / guidance on this. I can see there’s example code in the link above which will help me.

I basically at this stage need some advice as to what components I’ll need and if there might be some basic coding advice/suggestions? eg I would assume that drinking this would play around with the sensors so would need to have the reading be < x for > 30 seconds before sending altert or I’ll be getting notifications every time they drink etc

I’m gathering:- a sensor, Arduino (wifi capable?) and some form of power source.

Ideally I would love to be able to have it powered with a little solar board but assuming maybe a battery? I’m really not too sure where to start as to what board I’ll need and a power source.

I’d love to keep the cost down obviously - mostly lost with what board will be suitable

Thanks in advance.

1 Like

Hi Jarrod
Would not have suited the dog I used to have, cross Cattle/Kelpie. We once used to give him water in a disused stainless saucepan. When it was nearly empty he would pick it up and throw it against the brick wall.
My fix ?? Get a concrete water trough. Pick that up and play fair.

Seriously though. I found the easiest way to do this was with a timer on the tap. Reduce water flow to a point where the water did not splash out again and run it for 10 or so minutes each day or whatever period you need. The actual on time and repetition would depend on how much water the dog needs which is going to change with weather conditions. If the bowl overflows a bit it should not matter, as long as he (or she) has enough.

Measuring is going to be your biggest problem. A level sensor won’t be much good while the dog is drinking. A tube or something alongside the bowl might work as any splashing effect could be smoothed out by making the connecting pipe small so restricting the flow back and forth between tube and bowl so smoothing out splashing effects. In this case measure the water level in the tube so if the tube is plastic or PVC one or more of the sensor type that attach to the outside of a non metallic container might work.

The weighing idea has merit as long as the dog keeps its feet and any other part of its anatomy out of the container. My dog (bless him) had the knack of emptying the concrete trough by paddling the water out with his feet. Would not be beaten that dog.
Cheers Bob

3 Likes

Hi Jarrod, welcome to the forum, cool project idea!

Robert’s tube idea seems excellent for getting cleaner data out of that sensor. Perhaps you could have a PIR sensor detect your dog and disable logging/serving to website until it hasn’t seen the dog for a while, and the water is assumed still.

As for what you’ll need, Arduino definitely do make boards with Wifi, such as the MKR series:

To connect the MKR to this Grove sensor, you’ll need a special cable:

As for power, you could hook a LiPo up to the MKR board, and charge it with a solar panel regulated to 5V:

Personally, I’d run an extension cord if I were you though.

1 Like

Hi Jarrod, if you just want to test if it’s below a certain level then might a switch do? Something like this Water level switch (Seeed Studio) | SS311120001 | Core Electronics Australia or this https://www.makerstore.com.au/product/elec-sensor-wls/ . Slightly more expensive is Gravity: 5V Non-contact Liquid Level Sensor | DFRobot SEN0485 | Core Electronics Australia , alternatively you could probably make one up with Tilt Switch | Core Electronics Australia, just make a hinged float with it inside

In each case it’s just reading a GPIO pin. I mocked something up with raspberry pi pico w

from machine import Pin
from time import sleep

sensor = Pin(13, Pin.IN, Pin.PULL_UP)

while True:
    print(sensor.value())
    sleep(1)

The hardest part will be sending you a message, but this might be worth a look GitHub - shawwwn/uMail: A lightweight, scalable SMTP client for sending email in MicroPython

2 Likes

Hi Jarrod
Just a bit of an experience I had turning this water on and off. Has nothing to do with level sensing or electronics but can have a large effect anyway.

The valve in the timer I used had what I think is a ball valve for water control. This was a small sphere on a shaft in a spherical chamber. It had a hole so when it was rotated it opened up a matching pipe and allowed water to pass. No problem there. This was driven by a small motor with some (4 I think) AA batteries to power the whole thing. Now, particularly in the morning, the water pressure was just too great for the motor/battery combination to operate the valve so it just sat there stalled which wasn’t a good scenario.

This tap was part of the back yard water system and used PVC underground pipes for distribution. I was always a bit nervous about this pipe bursting and had a plumber fit an isolating valve so I could turn off the back yard and still have house water. While he was at it I had him fit a pressure control device in the line. Pressure problem solved. Valve works.

This probably has nothing to do with your present problem but could be something to consider if a control valve does not operate as expected.
Cheers Bob

1 Like

I recently purchased one of these and managed to get it working very well for automatically filling a small tank.
However when there is a loss of power the device defaults to zero no matter what the level.
I went on to their forum and found this Grove Capacitive Water Sensor fails to work after power cycle
This is a known bug which has still not been fixed for 3 years!!!
Hope you guys can put some pressure on the company to resolve this.
Thanks
Mike