DIY Smart Home for Pet

by VietnamReviews in Circuits > Audio

1648 Views, 4 Favorites, 0 Comments

DIY Smart Home for Pet

20190706_173744.jpg
20190706_173754.jpg
20190706_173811.jpg
20190706_173913.jpg
20190706_173922.jpg
20190706_173929.jpg
20190706_173937.jpg
20190706_174015.jpg
20190706_174048.jpg
20190706_174130.jpg
DIY Smart Home For Pet - P1

Hello friends. We meet here because we have in common are people who love animals.

Today I share with you the project takes up a lot of my time. Hope you enjoy it.

- Automatic feeding in real time. Automatically turn on the fan and LED warning when the temperature exceeds the allowed threshold. Update parameters from the pet's home to your phone continuously. Automatically switch to battery when power off.

My project has 2 parts: Designing a house + Smart system for the house.

- Designing a house: It is not difficult but it will take a lot of time if you do not have professional tools like me.

- Smart system for the house: This is an extremely interesting part. I believe it will be useful for your IoT projects later. For shared source code on the Internet you will often see the command placed in the " loop () ". This is extremely bad. It will cause your IoT project to hang.

The opening is probably like that. Let's get started

Designing a House

20190703_172307.jpg
20190703_174056.jpg
20190703_174803.jpg
20190703_174812.jpg
20190703_174823.jpg
20190703_174851.jpg

- I will give you my house size. Please select your favorite materials and cut them to the size as in the picture. I really hope to see more amazing designs from you.

- The house is divided into 4 main parts. 1st floor, 2nd floor, ceiling and roof.

- The ceiling is because I don't have enough materials to make it so I send the image for you to refer to the size.

- It's easy for made. You can see video on my YouTube channel for easy visualization.

- Some useful tools will help a lot for you. They are very cheap but really great.

1. https://www.banggood.com/Double-Head-YT-180A-Wood-...

2. https://www.banggood.com/6pcs-HSS-14-Inch-Hex-Shan...

3. https://www.banggood.com/6pcs-6-19mm-Chamfer-Cutte...

4. https://www.banggood.com/Woodwork-Guide-Oblique-Ho...

5. https://www.banggood.com/90-Degree-Right-Angle-Cor...

Smart System for the House - P1

Screenshot_20190702-113811.png
Screenshot_20190702-124705.png
Screenshot_20190702-143706.png
Screenshot_20190703-025920.png

- This part is extremely interesting. There are code that takes me a few days. At first I chose Arduino and rtc module. But it's a bit more components. I have switched to using esp8266. The project components consist of only 3 main components.

1. NodeMcu Lua ESP8266 ESP-12F WIFI Development Board

https://www.banggood.com/Geekcreit-Doit-NodeMcu-Lu...

2. DHT22

https://www.banggood.com/AM2302-DHT22-Temperature-...

3. 5V 4 Channel Relay Module

https://www.banggood.com/5V-4-Channel-Relay-Module...

Of course you will need the power cord, docking device, fan, signal light, sevor or Dc gear motor as I am using.

Using sevor is the optimal solution. Unfortunately my order has not been delivered. I temporarily use Dc gear motor.

In the next part, I will talk about how to use esp8266 and provide the code for you.

Smart System for the House - P2

1.png
2.jpg
3.png
4.png

1. To start you will need to download Arduino IDE from here. And install it.

https://www.arduino.cc/en/Main/Software

2. To enter: File→ Preferences, textbox Additional Board Manager URLs then add link:

http://arduino.esp8266.com/stable/package_esp8266c...

3. Tool→Board→Node MCU 0.9 Select the COM port corresponding to the corresponding NodeMCU module.

4. Installing NTP Client Library

Tools > Manage Libraries…

typing ‘ntpclient’. Look for NTPClientby Fabrice Weinberg. Click on that entry, and then select Install.

5. Installing DHT Client Library

Tools > Manage Libraries…

typing ‘dht’. Look for DHT sensor library by Adafruit.. Click on that entry, and then select Install.

Smart System for the House - P3

5.PNG

- Time zone you can see here:

https://www.ntppool.org/en/

- You need to adjust the UTC offset for your timezone in milliseconds.

Ex: For UTC -5.00 : -5 * 60 * 60 : -18000

For UTC +7.00 : 7 * 60 * 60 : 25200 as my code

For UTC +0.00 : 0 * 60 * 60 : 0

Time is very important. Because we feed our pet in real time.

Smart System for the House - P4

6.PNG
7.png

Code for my friends:

- In this example I set the time to automatically feed 3 times. 5:38 - 11.38 - 17:38. Please change to suit your needs.

- If you have additional features. Please keep void loop () clean as mine. It is extremely important. By otherwise your system will be suspended.

- In the code I also describe in detail. You can change the notification color as you like. Just fix it

- There is a simple way to find your favorite color. Just paste the color code into the google search page

- You may get an error when updating the code. Please unplug the relay and select update again

Smart System for the House - P5

20190706_214010.jpg
DIY Smart Home For Pet - P2 - Demo

Connecting components:

- DHT 22:

+ NodeMCU --- DHT 22

+ D4 --- D0

+ GND --- GND

+ VCC --- 5V

You can see more here:

https://learn.adafruit.com/adafruit-io-basics-temp...

- Relay:

+ NodeMCU --- Relay

+ VCC --- 5V

+ GND --- GND

+ D5 --- In2 ---> Automatic Feeder

+ D6 --- In1 ---> Cooling Fan

+ D7 --- In3 ---> Led

+ D8 --- In4 ---> Heater Fan

You can see more here:

https://www.instructables.com/id/NODEMCU-10-ESP826...

You can view my attached clip for easier visualization of the automatic feeding system. And how to connect components.

Smart System for the House - P6

8.jpg
HTB1G448SFXXXXa2aXXXq6xXFXXXK.jpg
HTB1DpnyyLuSBuNkHFqDq6xfhVXaK.jpg

Our systems feed pets in real time. And time is taken from the internet so we need solutions to keep power 24/24.

- I use Automatic Switching Board. It is very cheap and works great. You may need at least two. 1 for smart home system and 1 for your wifi.

https://www.aliexpress.com/item/32850710046.html?s...

- Some other necessary components

1. LM2596 DC-DC Voltage Regulator Adjustable Step Down

https://www.banggood.com/LM2596-DC-DC-Voltage-Regu...

2. Create your own 3s battery pack. I created my 3s4p battery pack

https://www.banggood.com/3S-20A-Li-ion-Lithium-Bat...

Smart System for the House - P7

Screenshot_20190707-043118.png
Screenshot_20190707-043128.png
Screenshot_20190707-043134.png
Screenshot_20190707-043146.png
Screenshot_20190707-043152.png
Screenshot_20190707-043204.png
Screenshot_20190707-043210.png
Screenshot_20190707-043217.png
Screenshot_20190707-043222.png
Screenshot_20190707-043230.png
Screenshot_20190707-043235.png
Screenshot_20190707-043245.png
Screenshot_20190707-043249.png
Screenshot_20190707-043258.png
Screenshot_20190707-043302.png
Screenshot_20190707-043309.png
Screenshot_20190707-043322.png

1. You will need blynk application for this project. Link:

https://blynk.io/

2. Let's start a new project.

- Download Blynk app

- Create New Account in Blynk app

- Create New Project

- Get Auth Token

Check your inbox to see if you get an email from Blynk with the Auth Token. You will need it later.

- Install Blynk Library

http://help.blynk.cc/en/articles/512105-how-to-ins...

- More about blynk here:

3. Please set the parameters as my photo. So you've completed a great project for your pet.

Future Plans

I plan to upgrade the system with a few details in the future.

1. Automatically pump drinking water when pet stands in the right position.

- Update: Available

But I don't have enough time to use it for my system

2. Check the status of food and water. Our pet will not be hungry when we forget to give up food.

3. Thank you for reading. I really need your suggestions to improve.

I have more than 300 subscriptions on my YouTube channel. Please subscribe to support me. I need 700 more subscribe to enable making money. Google will pay more to help me complete more interesting projects. Best regards.