Building Your Own Smart Dog Keeper System With ESP32 and IoT Integration

by MatanYanivShaharHahami in Workshop > Home Improvement

343 Views, 3 Favorites, 0 Comments

Building Your Own Smart Dog Keeper System With ESP32 and IoT Integration

WhatsApp Image 2024-02-27 at 14.42.22_99ae0ea4.jpg

Have you ever wished you could ensure your furry friend's comfort and well-being even when you're away?

With the power of technology and a little DIY spirit, you can create a custom smart dog keeper system that monitors your pet's environment and responds to their needs in real-time.

In this Instructable, we'll guide you through the process of building your own smart dog keeper system, using Arduino, an ESP32 controller, and integrating it with Blynk, make.com, and adafruit.io services.

With this project, you'll be able to monitor and manage your pet's environment remotely, ensuring their comfort and well-being even when you're away.

Our project focuses on integrating hardware components like servo motors, temperature and humidity sensors, and water level sensors with software automation to create an interactive system. We also used the services of make.com and Adafruit to enable a real-time data exchange of the environmental data coming from ESP32, and outdoor weather to determine how to control our dog's environment.

Whether you're a dog owner looking to enhance your dog's living space or an IoT fan who's eager to explore the intersection of technology and pet care, this Instructable is for you!

Sound interesting? check out a brief DEMO VIDEO

Supplies

components.jpg


Our project relies on the services provided by make.com, Adafruit, and the Blynk Interface.

Before diving into the project, please ensure you have an existing account for each of the services mentioned above.

Additionally, please download the following software tools:

For seamless operation, we recommend installing the Blynk app on your smartphone.

Now, let's gather the necessary hardware components:

  • ESP32 controller
  • 4 x AAA Batteries
  • DHT22 - Temperature and humidity sensor
  • Water sensor
  • Servo motor (for controlling the AC remote)
  • Cables
  • Double-sided adhesive glue


Once everything is set up, you're ready to embark on our project journey!

Preparing the Sensors

WhatsApp Image 2024-02-27 at 15.09.01_938ec659.jpg


  • Connect the servo motor to PIN 23.
  • Connect the water sensor to PIN 34.
  • Connect the temperature and humidity sensor to PIN 15.
  • Connect the ESP32 controller to your computer using the micro USB cable.


Install Required Libraries


  • Download the attached IoT_Smart_Dog_Keeper.ino file and open it on the Arduino IDE.
  • Open the provided code file.
  • Navigate to Sketch > Include Library > Manage Libraries.
  • Search for and install the following libraries: ESP32Servo, WiFi, WiFiClient, BlynkSimpleEsp32, Adafruit_Sensor, DHT, DHT_U, PubSubClient, and SPIFFS

Set Up WiFi Connection

wifi.png


In the Arduino IDE, fill in your WiFi credentials in the designated fields (ssid and pass).

Customize MQTT and Blynk Credentials

BLYNK and ADAFRUIT .png


In the Arduino IDE, input your credentials for ADAFRUIT and Blynk.

  • For Blynk (BLYNK_TEMPLATE_ID, BLYNK_TEMPLATE_NAME, and BLYNK_AUTH_TOKEN), navigate to your user settings, then go to "Devices" > "Device Info" and copy the provided credentials.
  • For ADAFRUIT:
  • Log in to your ADAFRUIT account.
  • Click on the yellow key icon located in the top right corner of the page.
  • Copy the "Arduino" credentials and paste them into the Arduino IDE.


Upload the Code to ESP32

  • Make sure your ESP32 is connected to your computer via the micro USB cable.
  • Select the correct board and port in the Arduino IDE.
  • Click on the "Upload" button to compile and upload the code to your ESP32.

Create Custom Dashboard in Your ADAFRUIT and Customized Notifications

adafruit actions.png
adafruit dashboard example.png
adafruit dashboard.png
adafruit feeds.png


  • Utilize your ADAFRUIT dashboard to establish custom graphs and statistics aimed to tracking environmental conditions such as room temperature and humidity, along with the water levels in your dog's bowl. 
  • For each sensor, set up a new feed within your ADAFRUIT account to ease data logging.
  • Design a personalized dashboard within ADAFRUIT and customize it according to your preferences. You have the flexibility to display current values, statistical trends, and any other relevant data points.
  • Configure custom notifications within ADAFRUIT to alert you in case of low water levels or high room temperatures. These notifications can be set up using Adafruit's notification services, ensuring that you stay informed about critical changes in your dog's environment.

Create Custom Blynk App and Web Dashboard and Connect to the Data Streams

blynk web.png
blynk app.jpg


  • Develop a personalized Blynk application that monitors and manages the functionalities of your smart dog keeper system.
  • For each sensor integrated into your system, establish a dedicated datastream within the Blynk application.
  • Integrate the Blynk application with the data streams generated by your sensors to showcase real-time updates regarding water levels, room temperature, and AC status.
  • This integration allows you to effectively monitor and control the several aspects of your smart dog guard system directly from the Blynk app interface.

Integrating Outdoor Weather Services From Make.com

make1.jpg
make2.jpg
make3.jpg


Explore weather services on make.com and select one that provides accurate weather information for your location.

  • Utilize the HTTP module to integrate weather data into your system.
  • Within the HTTP request, input the following link:
https://sgp1.blynk.cloud/external/api/update?{YOUR BLYNKS TOKEN}&{PIN NUM}=temperature


NOTICE: fill in your Blynk application token in the placeholder, and the relevant PIN NUM in the Blynk application

Test the System

Water bowl.jpg
AC Remote.jpeg


  • Place the water sensor in your dog's water bowl.
  • Connect the servo motor to the AC remote. Test the servo motor to verify that it can effectively toggle the AC remote's ON/OFF button without any obstructions or issues.
  • Ensure that the connections are secure and properly configured.
  • Additionally, consider calibrating both the water sensor and the servo motor to ensure accurate readings and reliable operation within your smart dog keeper system. Calibration may involve adjusting sensor sensitivity or servo motor rotation angles to achieve optimal performance.


Running Your Smart Dog Keeper System


Once you completed all the setup steps and verified the connections and configurations, it's time to run the system and enjoy the peace of mind knowing that your furry friend is taken care of even when you're not around.

Ensure that all components are powered on and functioning correctly.

Monitor the Blynk app, make.com dashboard, and Adafruit dashboard to observe real-time data from your sensors, including water levels, room temperature, and AC status.

As you go about your day, rest assured that you will receive notifications via email or through the Blynk app in case of any abnormal conditions such as low water levels or high room temperatures. With these notifications in place, you can take prompt action to ensure your dog's comfort and well-being, even from a distance.

Now, go outside with peace of mind, knowing that your smart dog keeper system is diligently monitoring and managing your pet's environment, allowing you to focus on other tasks with confidence and ease.