Tuya Smart Pet Feeder

Last Updated onInvalid dateZhanmin
This page contains content


pet_feeder, a pet feeder, developed based on Tuya IoT platform and sandwich development board. The communication board, power board, driver board, Tuya Smart APP and IoT cloud platform of this project are supported by Tuya Smart.


Complete home automation

Thread time_sys_thread: Time system thread, which provides the current time for the scheduled feeding function, and calibrates the time through the Tuya IoT platform; wifi_usart_service_thread: serial communication service thread, used to process the communication data between MCU and classmate's module; granary_weight_thread: surplus grain detection thread, which detects the current surplus grain situation of the grain bucket, and reports to the cloud every 50g change; export_weight_thread: The grain output detection thread, which detects the remaining weight of the current grain, and reports it to the cloud every 50g; quick_feed_thread: Quick feeding thread, provides quick feeding service, supports local button control and mobile APP control, one feed is fed once or once; key_scan_thread: key detection thread to detect whether the fast feeding control button is pressed; Device semaphore Quick_feed_sem: Record the number of button presses or APP clicks, provide a signal for fast feeding, and realize multiple consecutive fast feedings; Edit Code Product creation Creating Zigbee locks

For more information, see https://developer.tuya.com/en/docs/iot/device-intelligentize-in-5-minutes/device-intelligentize-in-5-minutes?id=K914joxbogkm6 MCU SDK migration tutorial: https://developer.tuya.com/en/docs/iot/device-development/embedded-software-development/mcu-development-access/wifi-mcu-sdk-solution/overview-of-migrating-tuyas-mcu-sdk?id=K9hhi0xr5vll9

  1. Time system implementation The time system mainly serves the function of planning feeding, and the feeding plan is composed of week, hour, minute, and feeding amount. Therefore, the time system does not need to be too detailed, and can provide the required data. If necessary, it can be updated and calibrated through the Tuya cloud platform. The time second hand is realized through the ms-level delay function rt_thread_mdeay() provided by rt-thread, and then the time system function is realized. Check the feeding plan every minute and calibrate the time every hour. See the following tables:


The Content you are browsing is publicized by registered users of Tuya DeveloperPlatform, and the copyright of which belongs to the original author. Tuya DeveloperPlatform does not own the copyright of the Content, nor undertake any liability. Tuya Developer Platform makes no representations or warranties that the Content is not in violation or infringement of any right. You should acknowledge and understand that your reproduction, adaptation, transmission, or other action with respect to the Contentshall conform to all applicable laws and regulations and shall acquire the requiredlicense of the related licensor. All the consequences (including but not limited to infringement, breach of contract, damage, disputes with a third party, etc.) resulted therefrom shall be borne by yourself. You can refer to the Tuya Developer Platform User Agreementfor the terms and conditions relating to the intellectual property rights of Content. If you find any suspected infringing content, please contact the Platform immediately to report and send relevant evidence. Once verified, the Platform will immediately delete the suspected infringing content.

This page contains content