设计说明书
总字数:18000+
基于单片机的宠物投喂器设计
摘要
随着宠物饲养率的提升,科学喂养成为宠物主关注的核心需求。传统人工投喂方式受时间限制大,易出现 “过度投喂导致肥胖”“漏喂引发宠物焦虑” 等问题;而市面上部分宠物投喂器功能单一,仅支持固定时间投喂,无法根据宠物食量调整投喂重量,也缺乏远程交互与状态反馈功能,难以满足宠物主精细化喂养与外出时的监护需求。因此,研发一款集成定时定量、多场景提醒、远程控制与数据显示的基于单片机的宠物投喂器,对提升宠物喂养便利性、保障宠物健康具有重要现实意义。
本设计提出了一种基于 STC89C52 单片机的宠物投喂器。系统主要功能包括:通过 HX711 称重模块实时测量食物重量,定时时间到达后,由 ULN2003A 驱动步进电机自动投放食物,直至重量达到设定值,同时支持按键手动开启 / 关闭投食;借助 DS1302 实时时钟模块获取时间,白天(9:00-18:00)通过 DY-SV17F MP3 模块播放音乐提醒宠物吃食,夜间则通过 LED 灯闪烁提醒;支持通过按键添加或删除最多 5 组喂食时间及对应重量;通过 LCD1602 显示屏实时显示当前时间、剩余食物重量、预设投喂计划;搭配 ECBO2 蓝牙模块,手机端可远程获取当前食物重量、添加 / 删除投喂时间、设置食物重量,还能远程控制投食,实现双向交互。
该宠物投喂器的作用在于,为宠物主提供了一种智能化、便捷化的喂养工具。通过定时定量投喂,帮助宠物养成规律饮食习惯;多场景提醒功能适配昼夜不同环境,避免打扰宠物主与邻居;远程控制与数据反馈功能,让宠物主外出时也能实时掌握宠物喂养状态,及时调整喂养计划,有效保障宠物健康,减轻喂养负担,提升宠物饲养体验。
关键词:单片机;宠物投喂器;定时定量投喂;称重检测;蓝牙远程控制
Design of Pet Feeding Device Based on Single Chip Microcomputer
Abstract
With the increase in pet ownership rates, scientific feeding has become a core requirement of concern for pet owners. The traditional manual feeding method is greatly limited by time and is prone to problems such as “excessive feeding leading to obesity” and “pet anxiety caused by missed feeding”; However, some pet feeders on the market have a single function, only supporting fixed time feeding and unable to adjust feeding weight according to pet food intake. They also lack remote interaction and status feedback functions, making it difficult to meet the refined feeding and monitoring needs of pet owners when going out. Therefore, developing a pet feeder based on a microcontroller that integrates timing and quantity, multi scenario reminders, remote control, and data display is of great practical significance for improving the convenience of pet feeding and ensuring pet health.
This design proposes a pet feeder based on STC89C52 microcontroller. The main functions of the system include: real-time measurement of food weight through the HX711 weighing module. After the scheduled time, the ULN2003A drives the stepper motor to automatically dispense food until the weight reaches the set value. At the same time, it supports manual button on/off feeding; Using the DS1302 real-time clock module to obtain time, during the day (9:00-18:00), music is played through the DY-SV17F MP3 module to remind pets to eat, and at night, LED lights flash to remind them; Support adding or deleting up to 5 feeding times and corresponding weights through buttons; Real time display of current time, remaining food weight, and preset feeding plan through LCD1602 display screen; Paired with ECBO2 Bluetooth module, the mobile phone can remotely obtain the current food weight, add/delete feeding time, set food weight, and also remotely control feeding, achieving two-way interaction.
The function of this pet feeder is to provide pet owners with an intelligent and convenient feeding tool. By regularly and quantitatively feeding, help pets develop regular eating habits; Multi scene reminder function adapts to different environments day and night, avoiding disturbing pet owners and neighbors; The remote control and data feedback function allows pet owners to monitor their pet feeding status in real time even when they are away, adjust their feeding plan in a timely manner, effectively ensure pet health, reduce feeding burden, and enhance the pet feeding experience.
Keywords:microcontroller; Pet feeders; Timely and quantitative feeding; Weighing and testing; bluetooth remote control
目 录
1 绪论
1.1 研究背景及意义
1.2 国内外研究现状
1.3 主要内容
2 系统总体方案设计
2.1系统总体设计
2.2 主要模块方案选择
3 系统硬件设计
3.1 总体硬件框架
3.2 主控模块电路设计
3.3 称重模块电路设计
3.4 定时模块电路设计
3.5 投食驱动模块电路设计
3.6 提醒模块电路设计
3.7 显示模块电路设计
3.8 按键模块电路设计
3.9 蓝牙通信模块电路设计
4 系统程序设计
4.1 编程软件介绍
4.2 系统主流程设计
4.3 独立按键
4.4 称重模块HX711模块子流程
4.5 LCD1602液晶显示子流程
4.6 蓝牙模块子流程
4.7 时钟模块子流程设计
4.8 MP3音乐播放模块子流程设计
5 实物制作与功能测试
5.1 实物制作
5.2 阈值设置实物测试
5.3 定时时间设置实物测试
5.4 定时投喂实物测试
5.5 蓝牙实物测试
6 总结
参考文献
致谢
附录A 原理图
附录B PCB
附录C 主程序