Doggo DayCare - Smart Home

by tamarassabi3 in Circuits > Arduino

65 Views, 0 Favorites, 0 Comments

Doggo DayCare - Smart Home

aaron martinez.png
IMG_7215.jpg
Doggo DayCare - Smart Home

Welcome to our Instructables project, where we’ll guide you through the creation of an innovative smart dog house with an Internet of Things (IoT) twist. Imagine ensuring your dog’s comfort and well-being, all from the convenience of your smartphone. Have you ever felt that extreme guilt of leaving your dog home alone, not knowing when you'll be back? We have too! That’s what made us create our “Doggo DayCare - Smart Home" IoT Project, allowing you to continue through your day, guilt and worry free!


In this project, we’ll show you how to build a system that monitors and controls various aspects of your dog’s environment using an ESP32 board, Arduino IDE, Blynk, and make.com. Picture this: you’ve had a long day at work, and you want to make sure your dog is comfortable at home. With just a few taps on your phone, you can check the temperature inside the dog house, ensure the water bowl is full, control the lighting, and even dispense food.


As you connect these smart features, your ESP32 becomes the brain of the operation, sensing your dog’s needs and automating responses to keep them happy and healthy. This smart dog house project leverages IoT technology to add a touch of care and convenience to your dog’s living space.


Now, let’s dive into the step-by-step instructions and build your very own smart dog house!

Supplies

IMG_7218.jpg
IMG_7219.jpg
IMG_7220.jpg
IMG_7221.jpg
IMG_7222.jpg
IMG_7223.jpg
IMG_7224.jpg

Hardware:

  • ESP32
  • Air Temperature and Humidity Sensor
  • Water Sensor
  • Servo Motor
  • LED Strip
  • Sensor Extension Wires
  • Female-Female connection wires

Additional Materials:

  • Large container to use for food dispenser (we used a plastic bottle)
  • Piece of cardboard/ plastic for food dispenser cover


Platforms used:


Software Components:

  • Arduino IDE

Setting Up the Software

Arduino IDE:

• Install the necessary libraries: WiFi, DHT, BlynkSimpleEsp32, Adafruit_NeoPixel, WiFiClientSecure, HTTPClient, ESP32Servo.

• Load the provided code into the Arduino IDE and upload it to your ESP32.


Downloads

Setting Up the Hardware

Temperature Sensor:

• Connect the DHT22 sensor to the ESP32.

• VCC to 3.3V

• GND to GND

• Data pin to GPIO 4

Water Sensor:

• Connect the water sensor to the ESP32.

• VCC to 3.3V

• GND to GND

• Analog output to GPIO 35

LED Strip:

• Connect the NeoPixel LED strip to the ESP32.

• DIN to GPIO 15

• VCC to 5V

• GND to GND

Servo Motor:

• Connect the MG90S servo motor to the ESP32.

• Signal to GPIO 22

• VCC to 5V

• GND to GND

Blynk Setup

Screenshot 2024-07-28 at 12.48.58.png
Screenshot 2024-07-28 at 13.10.30.png

Go to Blynk and create an account if you don't have one already.

Once logged in, navigate to the "Templates" section.


Click on "Create New Template" and give it a name

  • Choose "Hardware" as "Arduino" and "Connection Type" as "Wi-Fi."
  • Add a description that best fits your project.


Create Virtual Pins:

Under template, Go to "DataStreams" and add the following:

V0

  • Name: Doggo Food Dispenser
  • Pin: V0
  • Data Type: Integer
  • Units: None
  • Min: 0
  • Max: 12
  • Default Value: 0

V1:

  • Name: Internal Temperature
  • Pin: V1
  • Data Type: Double
  • Units: Celsius
  • Min: -30
  • Max: 100
  • Decimals: #.#
  • Default Value:

V2:

  • Name: Doggo Light
  • Pin: V2
  • Data Type: Integer
  • Units: None
  • Min: 0
  • Max: 1
  • Default Value: 0

V3:

  • Name: Ideal Walking Time
  • Pin: V3
  • Data Type: String
  • Default Value: Not Ideal

V4:

  • Name: Dogs Water Level
  • Pin: V4
  • Data Type: String
  • Default Value:


Set up the Dashboard for Testing Purposes:

Under Web Dashboard, add the following:

Switch 1:

  • Title: Food dispenser
  • DataStream: Doggo Food Dispenser [V0]
  • On Value: 1
  • Off Value: 0
  • Show on/off labels : Turned on
  • On Label: Feed
  • Off Label: Close

Gauge:

  • Title: Internal Temperature
  • DataStream: Internal Temperature [V1]
  • Change color based on value: Turned on

Switch 2:

  • Title: Doggo Light
  • DataStream: Doggo Light [V2]
  • On Value: 1
  • Off Value: 0
  • Show on/off labels : Turned on
  • On Label: On
  • Off Label: Off

Label 1:

  • Title: Ideal Walking Time
  • DataStream: Ideal Walking Time [V3]

Label 2:

  • Title: Dog's Water Level
  • DataStream: Dog's Water Level [V4]


Set up the Devices:

  • Go to the "Search" section and click on "New Device".
  • Choose "From Template" and select the template you just created
  • Create the device
  • Copy the generated code snippet and store safely for later use.

Make.com Setup

Screenshot 2024-07-28 at 13.28.31.png
WhatsApp Image 2024-07-28 at 14.10.37.jpeg
Screenshot 2024-07-28 at 14.20.24.png

Go to Make.com and create an account if you don't have one already.


Click on "Create New Scenario." In our project, we used two scenarios, so you'll need to create two.


First Scenario:

Title: External Weather, rain

Add Weather, with your relevant city

Connected to that, add Router module

Split into 2 cases:

  • Add to router an HTTP module -> choose "Make a request", add the URL of V3 in blynk (*Explained below where to find relevant link), where after 'v3=' in the URL, add 'Not Ideal time' (example: https://sgp1.blynk.cloud/external/api/update?token=7rwAJzAPITh92XxxmGBFGzzNT1QrNPN-&v3=Not Ideal time)

and then add an Apple IOS notification module, select relevant device,

  • Title: Rain Warning!
  • Body: High chance of rain, consider rethinking when to take out the dog
  • Priority: Deliver immediately
  • Add Filter for HTTP Request: Temperature >= 27 or Temperature <= 16
  • Add Filter for push notification: Code <= 800
  • Add to router an HTTP module -> choose "Make a request", add the URL of V3 in blynk, where after 'v3=' in the URL, add 'Good time to walk the dog'

and then add Google Calendar Module, add relevant connection (connect your google account)

  • Event Name: Consider walking the dog
  • All Day event: No
  • Start Date: now
  • End Date: {{addHours(now; 1)}}
  • Duration: 60
  • Add Filter for HTTP Request: Temperature <= 27 and Temperature >= 16



Second Scenario:

Title: Doggo Water

Add Webhooks, give it relevant name and copy address to clipboard (and store somewhere)

Add to that, Apple IOS push notification module, select relevant device

  • Title: Water Level is Low
  • Body: Refill doggo's water!
  • Priority: Deliver Immediately


How to take relevant URL out of blynk:

Under Web Dashboard, when changes are saved (not in edit mode), click on developer tools -> Move to Testing tab.

Change to Update value, select relevant pin and change to HTTP

Click on the link to copy


By following these steps, you will create the necessary modules to handle events and actions within the Doggo DayCare - Smart Home.

And hopefully, it'll look something like this!


Configure Code to Your Accounts

WhatsApp Image 2024-07-28 at 14.42.59.jpeg

In this section, you will need to replace every row in the provided code which contains a "TODO"


Replace BLYNK details:

Go to Blynk

Select Project Template

Find auth-token under relevant device

Find template name and id under Firmware Configuration


Replace Wifi details:

Insert your wifi name and wifi password


Replace Webhook URL from make.com:

Add address of your webhook URL

Set Up Overall Project

IMG_7218.jpg

Attach all of the relevant sensors to the place you want them,

  • Attach the water sensor to the dog's water bowl
  • Attach the temperature sensor somewhere indoors
  • Attach the servo motor to the dispenser container you chose, and the plastic/cardboard to the servo motor's handle and then attach above dog's food bowl
  • Attach the LED strip where you want it