张三叔

[Tuya Smart] Hamster Smart Home

 
Overview

Using two circuit boards, connected through copper pillars and pin headers, it can realize the functions of heating the hamster nest in winter, fan cooling in summer, lighting, bedding replacement reminder, and recording the number of running wheels, etc., providing a smart home for mice at home.

The hamster version of the smart home provides a more comfortable living environment for hamsters and a more convenient control method for the poop collector. With this device, you no longer have to worry about the life problems of rats and mice at home.

The main control chips of this project are atmega328p and wb3s, which are connected to the Tuya server and combined with the Tuya APP and various sensors and actuators to achieve:

  • View real-time temperature and humidity remotely. The scavenger can judge whether it is necessary to remotely turn on the electric blanket or fan for the rat based on the temperature.
  • The number of laps the hamster runs on the wheel tells you whether the hamster has exercised today.
  • How many days have passed since the last change of the hamster's bedding.
  • Add water to your hamster remotely.
  • LED lighting is provided for the poop scooper to facilitate observation of the rat's status and poop scooping.

    If you don’t want to open the APP to check at home, this device also provides two 4-digit digital tubes and control buttons. The digital tube switches in turn to display real-time temperature, humidity, the number of laps of the running wheel and the number of days for litter replacement. The buttons can control the corresponding functions locally.

In order to complete this project, I also transformed into a new shit shoveler. This is the new member of my family - Tutu. After all, it was because of the activities of Tuya and Lichuang that she came to my house.qq_pic_merged_1616581288090.jpg

Hardware parts

1. Main control part

The main control chip uses atmega328p-au minimum system:Snipaste_2021-03-24_18-27-45.jpg

2. Networking part

The networking module uses WB3S, which cooperates with the serial port level conversion circuit and MCU main control communication. Through this training camp, I discovered that there is such a convenient networking module. The bottom layer and server part are all written by Tuya’s official website. You don’t have to worry about it at all. You can just follow the instructions step by step. Tuya APP also provides public version and graphical creation. Anyone who uses the platform will know it. It has no threshold for beginners and is super convenient. I love it.

Snipaste_2021-03-24_18-31-36.jpg

3. Fan and water pump

Both the fan and water pump are driven by RZ7899 and cooperate with PWM to achieve speed adjustment function.

Snipaste_2021-03-24_18-44-28.jpg

4. Sensor part

  • The temperature and humidity sensor is SHT30, which comes from Switzerland's Shengshi Ruian Company. It has high precision and low power consumption.
  • The running wheel detection is a Hall sensor module from Jixiaoxin, which cooperates with the magnet on the running wheel to realize the function of counting circles.
  • The electric blanket is composed of a 5V PTC heating plate, which can provide a temperature of 60°C. In order to avoid burns, a feedback circuit is formed through the DS18B20 temperature sensor. The heating temperature can be set through the APP. When the set temperature is reached, the heating stops. The temperature forms a dynamic equilibrium.

5. Display part

Through two 4-digit digital tubes. It can cycle through to display real-time temperature, humidity, the number of laps of the running wheel, and the time since the last litter change. If the excavator is at home, he can control the corresponding functions directly through various buttons on the operation panel without opening the mobile APP.Snipaste_2021-03-24_18-57-37.jpg

software part

Tuya's engineers can be said to be the most conscientious in the industry. They not only provide library transplants for various platforms, but also thoughtfully mark the areas that need attention and changes:Snipaste_2021-03-24_19-04-44.jpg

For a software novice, it can be said that there is no threshold to get started. There is no need to worry about not understanding the underlying library, because there is no need for complicated operations at all. Combining the routines and error reporting guidance on the official website, I successfully uploaded the data to the Tuya APP. Tuya's work order function is also great. If you have a problem, you can directly submit a work order. After a while, a Tuya engineer will solve it one-on-one remotely. He is very patient and likes it! Screenshot_20210324_191033_com.tuya.smart.jpgThe specific code can be obtained by visiting the github link at the bottom.

production part

The production part is a series of smooth operations, such as drawing the schematic diagram, converting it to sorting out the position and wiring of the PCB, and finally presenting the finished picture of the control board.Snipaste_2021-03-29_10-37-00.jpg

Finally, attach all the parts to the hamster cage and secure it. Attached is a global picture and a detailed video below.QQ picture 20210329184147.jpg

Controller photo

IMG_20210329_184054.jpg

Hall sensor with running wheel

IMG_20210329_184104.jpg

Interesting experience

Because hamsters are nocturnal animals, they usually sleep during the day. Initially, I set the maximum value for the number of running laps to 9999 laps, because the running wheel records will be cleared at 12 noon every day, and for a hamster with a small body, it should be enough to record the amount of exercise for one night.

As a result, I woke up the next morning and opened the Tuya Smart APP. I was stunned. The APP displayed 9999, which was directly beyond the counting range. In the end, I had to change the counting unit to x10 and the upper limit to 99990 circles. Never underestimate little hamsters again. Attached pictures:Screenshot_20210325_083526_com.tuya.smart.jpg

Summarize

  • I am very grateful to Tuya Smart and Lichuang EDA for providing this platform. I learned a lot. It was the first time that I completed the entire project by myself, which was very satisfying.
  • I am also very grateful to the various libraries provided by various open source platforms. The predecessors planted trees for future generations to enjoy the shade, which provided great help to the functions of the project. Like it.
  • The friends in the group are also very enthusiastic, helping each other and cheering together.

last of the last

Attached is the video address (this is my first time cutting a video, I can’t bear to watch it, sorry): https://www.bilibili.com/video/BV1AZ4y1A7Fi/
Attached is the GITHUB address: https://github.com/baymax1500466550/hamster_smart_home

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-05 22:10:13

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号