基于单片机的智能宠物投喂系统的设计
Design of intelligent pet feeding system based on MCU
内容摘要
随着人们现在生活和工作的压力加大,相互间可以进行沟通交流的次数减少,难以缓解压力和诉苦的人们,选择饲养宠物,但是由于工作场所和公共地区的限制,平时只能将宠物寄放在家中,由于宠物也需要进食,且如果不能得到合理的进食,会影响宠物的身体健康和情绪,导致一些不可预计的事情发生。
针对于此,本设计研究一个可以实现智能投喂功能的宠物投喂系统。解决了宠物主人出现外出旅行、过节或者在外工作的情况下,宠物不能够自己寻找自己的粮食进食,避免了宠物进食时间不规律导致宠物身体可能出现状况的问题。该系统由单片机+DS1302时钟功能模块+称重功能模块+继电器功能模块+LCD显示功能模块+蜂鸣器+步进电机等进行组合的设计,实现如下功能:宠物饲料放入容器当中,宠物主人通过设定多个宠物进食时间点,时间一到,系统蜂鸣器发出声响,宠物听到这个声响之后,知道该进食了。本设计主要研究如何设定进食时间点并发出提醒声音。智能宠物投喂系统主要包括单片机控制、宠物自身手动开关和声音提醒、设计倒计时。可以通过键盘设定宠物的进食时间,当依次到达这进食时间,发光二极管会照明,蜂鸣器发出响声,食品会投放出来,宠物便知道可以进行食用。通过LCD1602显示出来宠物进食时间的倒计时。通过单片机读取键盘设定的宠物进食时间,当达到设定的宠物进食的时间,系统将进行自动投喂按指定重量进行食物投喂,当达到指定重量后自动关闭。与此同时,系统还设置了手动控制按钮功能,饲主通过教会宠物自主按下按钮,宠物在饿的时候可以自己进行按下进食。
关键词:智能投喂 定时控制 宠物喂食 重量控制
Abstract
With the increasing pressure of people's life and work, the number of times that people can communicate with each other is reduced. People who are difficult to relieve the pressure and complain choose to keep pets. However, due to the limitations of the workplace and public areas, pets can only be placed at home at ordinary times, and they also need to eat. If they can't get a reasonable diet, it will affect their health Kanghe mood leads to some unexpected things.
In view of this, this design studies a pet feeding system which can realize intelligent feeding function. It solves the problem that pet owners can't find their own food to eat when they are traveling, having holidays or working outside, and avoids the problem that pet's body may be in a state due to irregular feeding time. The system is designed by SCM + DS1302 clock function module + weighing function module + relay function module + LCD display function module + buzzer + stepper motor, etc. it realizes the following functions: pet feed is put into the container, pet owner sets multiple feeding time points, when the time arrives, the system buzzer makes a sound, and the pet knows after hearing the sound It's time for Tao to eat. This design mainly studies how to set the eating time point and make a warning sound. The intelligent pet feeding system mainly includes single-chip microcomputer control, pet's own manual switch and voice reminder, design countdown. The feeding time of pets can be set through the keyboard. When the feeding time is reached in turn, the LED will illuminate, the buzzer will make a sound, the food will be put out, and the pets will know that they can eat. LCD1602 shows the countdown of pet feeding time. Read the feeding time of the pet set by the keyboard through the single-chip microcomputer. When the set feeding time of the pet is reached, the system will automatically feed the pet according to the specified weight. When the specified weight is reached, the system will automatically shut down. At the same time, the system also sets the function of manual control button. The owner can press the button by teaching the pet to eat when he is hungry.
Key words:intelligent feeding timing control pet feeding weight control
3.9报警电路
报警电路主要是达到了设定的宠物进食时间,开始发出声音,产生提示音,并提醒宠物来进食。本系统设计采用的是无源蜂鸣器,使用单片机的直流信号就能够驱动。报警电路设计图如图3-9所示,电路由无源蜂鸣器、三极管和2K电阻组成。
图3-9 报警电路
3.10按键电路设计
按键电路实现参数的时间设置和手动功能。按键电路如图3-10所示。独立按键模式进行操作按键,各个按键不会相互影响状态,S2对应单片机的P2.3,依次按顺序连接起来,并对其进行控制。
图3-10 按键电路
3.11步进电机设计
步进电机控制设计图如图3-11所示,由ULN2003芯片来进行主控设计,芯片的9-13引脚与选用的5线制步进电机进行连接,芯片的1-7引脚与单片机的P1.0-P1.6口进行连接,由单片机输出控制信号执行控制。