基于树莓派的智能语音药盒设计与实现
Design and Implementation of a Raspberry Pi-Based Smart Voice-Enabled Pillbox
DOI: 10.12677/csa.2026.1611339, PDF,   
作者: 张棒棒, 马卢燚, 崔旭旭*:辽宁科技大学计算机与软件工程学院,辽宁 鞍山
关键词: 智能药盒;语音播报;树莓派;多终端管理;Flask;SQLite;Smart Pillbox; Voice Broadcast; Raspberry Pi; Multi-Terminal Management; Flask; SQLite
摘要: 针对老年慢性病患者长期居家服药过程中提醒过度依赖网络、提醒信息与具体药仓对应不明确、用药计划多终端管理不便等问题,设计并实现一种基于树莓派的智能语音药盒系统。系统以树莓派4B为控制核心,采用DS3231提供独立时间基准,通过SG90舵机完成药仓解锁,利用eSpeak实现离线药品名称播报,并基于Flask和SQLite实现用药计划管理服务,同时提供Web端和微信小程序端支持用药计划配置和设备状态查询。通过定时精度、舵机动作、语音播报、接口性能和连续运行实验验证系统性能。结果表明,40次定时测试中最大触发误差为30 s,平均误差为7.5 s,漏触发0次;舵机动作成功率100%;语音播报可懂度100%;接口平均响应时间不超过35 ms;连续运行48 h无漏触发和程序崩溃。系统能够完成多终端用药计划管理与本地离线提醒,可为居家服药提醒设备设计提供参考。
Abstract: To address the problems of over-reliance on network for reminders, unclear correspondence between reminder information and specific medicine compartments, and inconvenient multi-terminal management of medication plans in long-term home medication for elderly patients with chronic diseases, a Raspberry Pi-based smart voice-enabled pillbox system is designed and implemented. The system uses Raspberry Pi 4B as the control core, DS3231 as an independent time reference, SG90 servos to unlock medicine compartments, eSpeak for offline voice broadcast of medicine names, and Flask and SQLite for medication plan management. Web and WeChat mini-program interfaces are provided for plan configuration and device status query. Experiments are conducted on timing accuracy, servo action reliability, voice intelligibility, API response performance, and continuous operation stability. Results show that in 40 timing tests, the maximum trigger error is 30 s, the average error is 7.5 s, and no missed trigger occurs; the servo action success rate is 100%; the voice intelligibility is 100%; the average API response time is no more than 35 ms; and the system runs continuously for 48 h without missed triggers or crashes. The system can realize multi-terminal medication plan management and local offline reminders, providing a reference for the design of home medication reminder devices.
文章引用:张棒棒, 马卢燚, 崔旭旭. 基于树莓派的智能语音药盒设计与实现[J]. 计算机科学与应用, 2026, 16(11): 228-237. https://doi.org/10.12677/csa.2026.1611339

参考文献

[1] 中华人民共和国2024年国民经济和社会发展统计公报[EB/OL]. 2025-02-28.
https://www.stats.gov.cn/xxgk/sjfb/tjgb2020/202502/t20250228_1958817.html, 2026-09-29.
[2] Hu, X., Li, S., Wei, Z., Wu, D., Meng, L., Li, J., et al. (2024) Prevalence and Pattern of Multimorbidity in China: A Cross-Sectional Study of 224,142 Adults over 60 Years Old. Frontiers in Public Health, 12, Article 1349418.
https://doi.org/10.3389/fpubh.2024.1349418
[3] Faisal, S., Samoth, D., Aslam, Y., Patel, H., Park, S., Baby, B., et al. (2023) Key Features of Smart Medication Adherence Products: Updated Scoping Review. JMIR Aging, 6, e50990.
https://doi.org/10.2196/50990
[4] 王新宇, 蔡星雨, 房志顺, 等. 基于单片机的智能药箱系统[J]. 电脑知识与技术, 2025, 21(35): 90-93.
[5] 王明, 李建婷, 杨勃, 等. 基于STM32的智能电子药箱设计[J]. 现代信息科技, 2025, 9(17): 18-21, 27.
[6] 杨沛聪, 余汉泉, 谢依依, 等. 基于STM32的智能语音控制药箱[J]. 中国新技术新产品, 2022(11): 34-36.
[7] 邱萌萌, 刘瑞, 张凯旋, 等. 基于STM32多功能智能药箱的设计与实现[J]. 湖北师范大学学报(自然科学版), 2023, 43(2): 87-94.
[8] 解丹婷, 赵培, 杜胜. 基于单片机控制的老年人智能药箱设计[J]. 机械设计与制造工程, 2021, 50(7): 40-42.
[9] 文昕, 杜丹蕾, 韦美雁, 等. 智能药箱APP的实现[J]. 大众科技, 2022, 24(11): 21-25.
[10] AlDuaij, N. (2024) mPillBox: An Open Framework for a Smarter Pillbox. Journal of Network and Computer Applications, 223, Article ID: 103824.
https://doi.org/10.1016/j.jnca.2024.103824
[11] Karagiannis, D., Mitsis, K. and Nikita, K.S. (2022) Development of a Low-Power IoMT Portable Pillbox for Medication Adherence Improvement and Remote Treatment Adjustment. Sensors, 22, Article 5818.
https://doi.org/10.3390/s22155818
[12] Salmensuu, O., Hyttinen-Huotari, V., Isotalo, J., Rijken, M., Linnosmaa, I. and Kaarakainen, M. (2025) Systematic Review of Effects of Medication Dispenser Use by Home-Dwelling Older Adults. Nursing Research, 74, 305-312.
https://doi.org/10.1097/nnr.0000000000000824
[13] Analog Devices, Inc (2015) DS3231 Extremely Accurate I2C-Integrated RTC/TCXO/Crystal.
https://www.analog.com/media/en/technical-documentation/data-sheets/ds3231.pdf