Introduction: Smart Pet Bowl

If you are a pet owner then the Smart Pet Bowl is for you!

As busy people and pet owners we tend to worry about our pets, whether they eat regularly when we aren't there and whether we are doing the best we can. Constructing the Smart Pet Bowl is a great way to calm your worries.

The Smart Pet Bowl makes sure your pet's food bowl is placed in an appropriate location, alerts you when your pet is eating, and offers calming music for your pet during their meals!

You can keep track of the temperature and humidity of where the food is located through Adafruit IO. There, you can also see whenever your pet is eating.

In addition, you can use the Blynk app in order to play your pet music whenever you want!

Supplies

Hardware:

  • 1 x Arduino Uno
  • 1 x WeMOS D1 Mini
  • 1 x Piezo Sensor
  • 1 x Mini speaker
  • 6-8 x Jumper wires
  • 1 x Breadboard
  • 1 x LED
  • 1 x Micro USB cable
  • 1 x USB printer cable
  • 1 x DHT 22 Shield

  • Ultrasonic Sensor (HC-SR04)

Construction:

  • 1 x shallow cardboard box
  • 1 x extra piece of cardboard

Software:

  • Install Arduino IDE and ESP8266 add-on here
  • Sign-up to Adafruit here
  • Install the Blynk app here and create an account

Step 1: The Flow

In this step we will describe each element of the Smart Pet Bowl. You can click on each link to receive a more in-depth explanation of the hardware.

Detection

We use two sensors in order to detect when your pet approaches their bowl.

  1. Piezo Sensor - which is placed under a piece of cardboard right in front of the food bowl. Whenever your pet approaches the bowl, they will unknowingly step on the mat which will trigger the piezo.
  2. Ultrasonic Sensor - this senses when an object is in front of it.

When both of these sensors are triggered we take that to mean the pet has approached.

Placement

We want to make sure the food bowl is placed in appropriate conditions temperature-wise and humidity-wise. This is where theDHT22 Sensor comes in, it detects the temperature and humidity. If the temperature is over 25 or the humidity is over 50, we will alert you to change the bowl's location by turning on the LED on the breadboard.

Ambiance

Whenever your pet is (detected) eating there will be soft music playing through the Speaker automatically. You can also manually turn on the music through the Blynk app.

Data and Alerts

You will be able to see the recent temperature and humidity readings in the Adafruit IO dashboard and the Blynk app. In addition, the dashboard will display an indication whether the placement is appropriate and if your pet is near the bowl (indicating they are eating).

Step 2: Hardware Assembly and Wiring

  • WeMOS D1 Mini Board
    1. Place the WeMOS D1 Mini on the breadboard.
    2. Connect the Micro USB cable to the WeMOS D1 Mini.
    3. Connect the Micro USB cable to a power source.
  • Arduino Uno
    1. Connect the USB printer cable to Arduino Uno.
    2. Connect the USB printer cable to a power source.
  • DHT22 Shield
    1. Place the DHT22 Shield on top of the WeMOS D1 Mini board.
    2. Make sure the pins on both boards are aligned.
  • Piezo Sensor
    1. Place the sensor on the breadboard.
    2. Connect the black cable to GND on the Ardunio Uno using a jumper wire.
    3. Connect the red cable to A0 on the WeMOS D1 Mini board using a jumper wire.
  • Ultrasonic Sensor
    1. Place the sensor on the breadboard.
    2. Connect VCC to 5v on the Ardunio Uno using a jumper wire.
    3. Connect Trig to D7 on the WeMOS D1 Mini board using a jumper wire.
    4. Connect Echo to D8 on the WeMOS D1 Mini board using a jumper wire.
    5. Connect GND to GND on the Ardunio Uno using a jumper wire.
  • LED
    1. Place the LED on the breadboard.
    2. Connect the longer pin to D3 on the WeMOS D1 Mini using a jumper wire.
    3. Connect the shorter pin to GND on the Ardunio Uno using a jumper wire.
  • Speaker
    1. Connect one of the speaker's wires to D1 on the WeMOS D1 Mini board.
    2. Connect the other wire to GND on the Arduino Uno.

Step 3: Code

Open the attached code

Libraries

  • Note the included libraries at the beginning of the code
  • Install the libraries you don't already have here

Modifications

  • Internet connection

#define WIFI_SSID "Insert network name here"
#define WIFI_PASSPHRASE "Insert password here"

  • Blynk

char auth[] = "Insert Blynk authentication here";

  • Adafruit IO

#define AIO_USERNAME "Insert username here"

#define AIO_KEY "Insert key here"

Step 4: Blynk Setup

Open the Blynk app on your phone and sign in with the user you created.

New Project

  • Press the '+' sign.
  • Project Name: Smart Pet Bowl
  • Choose Device: ESP8266
  • Copy the authentication token that was sent to your email and paste it in the appropriate place in the code

Widgets

To add a widget press '+' sign. Create the following widgets

  • Notification - will push a notification whenever your pet is eating
  • Labeled Value
    • Name: Temperature
    • Input: Virtual Pin V1
    • Reading Rate: 5 sec
  • Labeled Value
    • Name: Humidity
    • Input: Virtual Pin V2
    • Reading Rate: 5 sec
  • Button
    • Name: Play Music
    • Output: Virtual Pin V0
    • Mode: Push

Step 5: Adafruit IO Setup

Go to Adafruit and sign in with the user you created.

Feeds

Go to the Feeds section and create the following feeds:

    1. Temperature
    2. Humidity
    3. Meals

Dashboards

Go to the dashboards sections and create the following blocks:

  1. Temperature Stream - shows us the recent temperature where the food is positioned
    • Block: Stream
    • Feed: Temperature
    • Block Title: Temperature
  2. Humidity Stream - shows us the recent humidity where the food is positioned
    • Block: Stream
    • Feed: Temperature
    • Block Title: Humidity
  3. Temperature Indicator - indicates whether current temperature is appropriate
    • Block: Indicator
    • Feed: Temperature
    • Block Title: Temperature Status
    • Conditions: <= 25
  4. Humidity Indicator - indicates whether current humidity is appropriate
    • Block: Indicator
    • Feed: Humidity
    • Block Title: Humidity Status
    • Conditions: <= 50
  5. Meal Time Indicator - indicates whether your pet is currently eating
    • Block: Indicator
    • Feed: Meals
    • Block Title: Meal Time
    • Conditions: = 1

Step 6: Putting It All Together

  1. Place your pet's bowl in the cardboard box
  2. Place the hardware beside the box
  3. Place the extra piece of cardboard in front of the cardboard box, slightly tucked under it
  4. Slide the piezo under the piece of cardboard
  5. Connect Arduino Uno and WeMOS Mini to power source

You're all set!

When your pet will pass the hardware in order to get to their food they will trigger the Ultrasonic sensor. When they approach the bowl itself they will step on the extra piece of cardboard and trigger the Piezo sensor. Thus, alerting you!

From us to your beloved pet - Bon Appetit!