Pet Water Reminder

by ErelBiran in Circuits > Arduino

290 Views, 1 Favorites, 0 Comments

Pet Water Reminder

WhatsApp Image 2021-08-26 at 16.03.59 (2).jpeg
WhatsApp Image 2021-08-26 at 16.03.59 (1).jpeg
WhatsApp Image 2021-08-26 at 16.03.59.jpeg

So in the hot summer days our dog water bowl can be empty real quick when our pets drink all day to stay cold and drinking all day long.

Personally I thought to my self, what kind of IoT tech we can build in order to do some good in the day to day life problems, so the script we build run once an hour and checking over water level in the bowl, if its empty or low you will get an email to refill your pet water bowl, simple as that.

This DIY build is real easy and quick, under the hood, our pc will be the server and the Arduino will be our MQTTT broker, we will use Node-Red to handle the logic.

  1. Any board with WiFi, in our case its Adafruit Circuit playground.
  2. MH-Sensor-Series, this will be our driver for the sensor.
  3. The sensor it self, this will be the sensor that will tell us if the level of the water are low.

Install Node-Red and Configure It

Node-red-Flow.png
Handle Data payload.png
Switch-Conditions.png
  1. So first we will need to install Node-Red, this will be our server that will handle all the logic behind our sensors and email sending.
  2. Now we need to configure our Node-Red components.
  • First component (SpectorHacked/feeds/water-level) - This is out MQTTT server, it listen to the IP address that our adafruit sending data to.
  • Second component (Handle Email content function) - This function handle our payload and edit as we need it, It takes the string from our sensor and make it as Integer and add some info to our email.
  • Third component (switch) - This is the logic handler, it will be the switch between our water level, the first output will be the refill indicator.

  • Forth component (Send email component) - This component will be the email sending, make sure you enter your right smtp and username&pass, if your using Gmail, make sure to enable "Less secure app access".

    Last but not least, run the command "node-red" in any CMD\Powershell, and go to the link:
    http://127.0.0.1:1880/

Configure Our Sensor and Our Cirucit

Adafruit_3333_30129221-01.jpg
Diagram.png

We are using Circuit playground you got the connections overlay.

We need to connect like the diagram also overlay.
Ground:

Ground - From circuit to driver then from driver to sensor.
Power - From circuit 3.3v to Driver, then from driver to sensor.
Data - From circuit A0 to A0 on the driver.

Code Part

Code Sample.png

Here is the fun part, the code, if you just want the complete code then just change the info as below:

/// How much time between check bowl

const int delayInMiliseconds = 3600000; // 1 hour

// Your WiFi connection credentials, if applicable
const char wifiSSID[] = "Biran-Deco";
const char wifiPass[] = "a1b2c3d4e5";

// MQTT details (Computer IP)

const char* broker = "192.168.68.118";

Change to your info to your own info, and lets get to the building the "hardware".

Build DIY Cup With Sensor

WhatsApp Image 2021-08-27 at 15.39.26 (1).jpeg
WhatsApp Image 2021-08-27 at 15.39.26.jpeg

So we gonna need a bowl, every bowl that the height of the bowl is longer then the sensor length.

Now you can use any two-sided duct tape, make sure our connection are out bowl like the picture above.


And well that's it, very easy to build and help us take care of our hairy love ones