智能药盒设计:基于单片机控制,LCD1602显示,定时用药提醒实现。

版权申诉
0 下载量 141 浏览量 更新于2024-03-28 4 收藏 3.75MB DOC 举报
Based on the increasing demand for a higher quality of health in people's lives, especially among the elderly, the design of a smart pillbox based on a single-chip microcontroller is introduced in this paper. The system incorporates hardware components such as the STC90C51 microcontroller, LCD1602 display, and a timer/counter module for automated medication reminders. The modular design and software programming principles are discussed in detail, followed by the results of system testing and debugging. The first part of the paper focuses on the specifications, internal structure, and pin functionalities of the single-chip microcontroller, as well as the hardware circuitry, display principles, and commands of the LCD1602. The basic principles of the timer/counter and buzzer modules are also outlined. In the second part, the operational modes and workflows between the system modules are systematically explained. After thorough testing and refinement, the system operates on a basic mode controlled by the single-chip microcontroller. Through the design of timer interrupts in the STC90C516 microcontroller, the system is able to manage the clock and display it on the LCD1602 screen. When input is detected for setting the time or medication dosage, the system enters an interrupt-controlled adjustment mode. The user can then set the time and dosage values, which are stored upon pressing the timer key. As the system progresses in real-time, it continuously compares the set time with the current time. When a match is found, an alarm is triggered displaying the set dosage. After a minute, if the times no longer match, the reminder is automatically canceled, facilitating medication reminders four times a day with four different dosages, suitable for everyday household use. Keywords: smart pillbox; STC90C516; clock; 1602 display.