Implementation and Design of a Smart Pharmacy Automation System Using Raspberry Pi

محتوى المقالة الرئيسي

Saja Sadiq Bakhit
Saleem Lateef
Ali Al-Naji

الملخص

Manual medication dispensing in pharmacies remains prone to human errors and is time-intensive, particularly under high patient loads, while existing commercial automation solutions are cost-prohibitive for small to medium-sized pharmacy settings. This paper presents the design and implementation of a cost-effective smart pharmacy automation system leveraging a Raspberry Pi 5 platform. The proposed system integrates a web camera for real-time image acquisition, a stepper motor-driven dispensing mechanism, and an HDMI display for visual feedback of identified medications. To enable accurate drug recognition, we employ the YOLOv8 deep learning object detection algorithm. A custom dataset comprising 1,500 images of ten distinct medication classes—with 150 samples per class, captured under varying illumination conditions (bright, normal, and low light) and three viewing angles—was constructed for model training and evaluation. The dataset was partitioned into 70% training, 20% validation, and 10% testing sets. Experimental results demonstrate that the YOLOv8-based model achieves exceptional performance, with an overall precision of 98%, precision and recall values approaching 1.0, and mAP50 and mAP50-95 scores of approximately 0.99, indicating high reliability for real-time deployment. The entire system, including both hardware and software, is able to accurately identify and dispense medications in an automatic manner with minimal delay. This affordable, on-site alternative to high-cost commercial systems presents an efficient and scalable solution to help decrease dispensing mistakes and enhance workflow in a pharmacy setting with limited resources.

##plugins.themes.bootstrap3.displayStats.downloads##

##plugins.themes.bootstrap3.displayStats.noStats##

تفاصيل المقالة

القسم

Articles

كيفية الاقتباس

"Implementation and Design of a Smart Pharmacy Automation System Using Raspberry Pi" (2026) مجلة الهندسة, 32(8), ص 16–33. doi:10.31026/j.eng.2026.08.02.

المراجع

Abasa, S., Aziz, F., Ishak, P. and Jeffry, J., 2025. Detection of persistent vs non-persistent medications in pharmacy using artificial intelligence: Development of intelligent algorithms for pharmaceutical product safety. Journal of System and Computer Engineering (JSCE), 6(1), pp. 137–143. https://doi.org/10.61628/jsce.v6i1.1618.

Abdulkadhim, F.G., Yi, Z. and Khalid, M., 2020. Smart pharmacy monitoring system based on MQTT protocol using RFID and raspberry pi. EUREKA, Physics and Engineering, 2020(2), pp. 98–104. https://doi.org/10.21303/2461-4262.2020.001207.

Al-Hussaeni, K., Karamitsos, I., Adewumi, E. and Amawi, R.M., 2023. CNN-Based pill image recognition for retrieval systems. Applied Sciences (Switzerland), 13(8). https://doi.org/10.3390/app13085050.

Aungst, T.D., 2025. Beyond the fill: Navigating pharmacy’s technological future in 2050. Journal of the American Pharmacists Association, https://doi.org/10.1016/j.japh.2024.102285.

Chang, W.J., Chen, L.B., Hsu, C.H., Chen, J.H., Yang, T.C. and Lin, C.P., 2020. MedGlasses: A wearable smart-glasses-based drug pill recognition system using deep learning for visually impaired chronic patients. IEEE Access, 8, pp. 17013–17024. https://doi.org/10.1109/ACCESS.2020.2967400.

Cheng, H., Ming Sun, Hai-Ling He, Shi-Qing Huang, Rui Feng and Yong-Qiang Wang, 2025. Design and research of pharmacy management robot based on artificial intelligence. Economics & Management Information, pp. 1–10. https://doi.org/10.62836/emi.v4i3.451.

Chiu, Y.J., 2024. Automated medication verification system (AMVS): System based on edge detection and CNN classification drug on embedded systems. Heliyon, 10(9). https://doi.org/10.1016/j.heliyon.2024.e30486.

Dayananda, P. and Upadhya, A.G., 2024. Development of smart pill expert system based on IoT. Journal of The Institution of Engineers (India): Series B, 105(3), pp. 457–467. https://doi.org/10.1007/s40031-023-00956-2.

Dhoke, S. and Desai, S.A., 2017. Advanced method to detect railway track damage using Raspberry Pi and internet of things. International Journal of Advanced Trends in Computer Science and Engineering, 6(3).

Fanzury, N. and Hwang, M., 2025. Real-Time identification of mixed and partly covered foreign currency using YOLOv11 object detection. AI (Switzerland), 6(10). https://doi.org/10.3390/ai6100241.

Ferreira, F.J.N. and Carneiro, A.S., 2025. AI-Driven Drug Discovery: A Comprehensive Review. ACS Omega, https://doi.org/10.1021/acsomega.5c00549.

Hajizadeh, M., Sabokrou, M. and Rahmani, A., 2023. MobileDenseNet: A new approach to object detection on mobile devices. Expert Systems with Applications, 215, P. 119348.

Hu, H. and Wang, Z., 2022. Wind speed and direction sensing and monitoring intelligent control system based on Raspberry Pi. In: ACM International Conference Proceeding Series. Association for Computing Machinery. pp. 136–148. https://doi.org/10.1145/3582935.3582959.

Javaid, M., Haleem, A., Singh, R.P. and Ahmed, M., 2024. Computer vision to enhance healthcare domain: An overview of features, implementation, and opportunities. Intelligent Pharmacy, 2(6), pp. 792–803. https://doi.org/10.1016/j.ipha.2024.05.007.

Khan, O., Parvez, M., Kumari, P., Parvez, S. and Ahmad, S., 2023. The future of pharmacy: How AI is revolutionizing the industry. Intelligent Pharmacy, 1(1), pp. 32–40. https://doi.org/10.1016/j.ipha.2023.04.008.

Khow, Z.J., Tan, Y.F., Karim, H.A. and Rashid, H.A.A., 2024. Improved YOLOv8 model for a comprehensive approach to object detection and distance estimation. IEEE Access, 12, pp. 63754–63767. https://doi.org/10.1109/ACCESS.2024.3396224.

Kuo, Y.H., Siao, C.Y., Li, T.L., Wang, C.J., Lin, H.C., Chen, Y.A., Liu, C.H. and Chang, R.G., 2024. Smart-sensors-based Medicine Identification System. Sensors and Materials, 36(12), pp. 5283–5297. https://doi.org/10.18494/SAM5244.

Larios Delgado, N., Usuyama, N., Hall, A.K., Hazen, R.J., Ma, M., Sahu, S. and Lundin, J., 2019. Fast and accurate medication identification. npj Digital Medicine, 2(1). https://doi.org/10.1038/s41746-019-0086-0.

Lee, H. and Youm, S., 2021. Development of a wearable camera and ai algorithm for medication behavior recognition. Sensors, 21(11). https://doi.org/10.3390/s21113594.

Li, L., Wang, W., Xue, X., Miao, W., Liu, X., Cheng, X., Wang, X., Huang, L. and Feng, Y., 2023. Current status and cost burden of non-first-line treatment in ITP: A multicenter study based on real-world data in China. Intelligent Pharmacy, 1(4), pp. 274–279. https://doi.org/10.1016/j.ipha.2023.04.003.

Ma, W., Zhang, Y., Li, Z. and Chen, X., 2025. Design of an intelligent picking robot based on Raspberry Pi and Arduino control. SPIE-Intl Soc Optical Eng. p.42. https://doi.org/10.1117/12.3045000.

Mao, H., Yao, S., Tang, T., Li, B., Yao, J. and Wang, Y., 2018. Towards real-time object detection on embedded systems. IEEE Transactions on Emerging Topics in Computing, 6(3), pp. 417–431. https://doi.org/10.1109/TETC.2016.2593643.

Meshram, V. V., Patil, K.R., Meshram, V.A. and Bhatlawande, S., 2022. SmartMedBox: A smart medicine box for visually impaired people using IoT and computer vision techniques. Revue d’Intelligence Artificielle, 36(5), pp. 681–688. https://doi.org/10.18280/ria.360504.

Ogbuagu, O.O., Mbata, A.O., Balogun, O.D., Oladapo, O., Ojo, O.O. and Muonde, M., 2023. Artificial intelligence in clinical pharmacy: Enhancing drug safety, adherence, and patient-centered care. International Journal of Multidisciplinary Research and Growth Evaluation, 4(1), pp. 814–822. https://doi.org/10.54660/.ijmrge.2023.4.1-814-

822.

Rammal, D.S., Alomar, M. and Palaian, S., 2024. AI-Driven pharmacy practice: Unleashing the revolutionary potential in medication management, pharmacy workflow, and patient care. Pharmacy Practice, 22(2). https://doi.org/10.18549/PharmPract.2024.2.2958.

Sharma, D., Anabala, M., Jain, V.V., Shyam, M., Prince, S.E. and Muniyan, R., 2025. Computational landscape in drug discovery: From AI/ML models to translational application. Scientifica, https://doi.org/10.1155/sci5/1688637.

Tan, L., Huangfu, T., Wu, L. and Chen, W., 2021. Comparison of RetinaNet, SSD, and YOLO v3 for real-time pill identification. BMC Medical Informatics and Decision Making, 21(1). https://doi.org/10.1186/s12911-021-01691-8.

Tavakoli, M.J., Fazl, F., Sedighi, M., Naseri, K., Ghavami, M. and Taghipour-Gorjikolaie, M., 2025. Enhancing pharmacy warehouse management with faster R-CNN for accurate and reliable pharmaceutical product identification and counting. International Journal of Intelligent Systems, 2025(1). https://doi.org/10.1155/int/8883735.

Ting, H.W., Chung, S.L., Chen, C.F., Chiu, H.Y. and Hsieh, Y.W., 2020. A drug identification model developed using deep learning technologies: Experience of a medical center in Taiwan. BMC Health Services Research, 20(1). https://doi.org/10.1186/s12913-020-05166-w.

Vehkaoja, A. and Hästbacka, D., 2021. Utilizing Deep Learning on Embedded Devices. Master of Science Thesis. Tampere University Biomedical Engineering, Finland

Wang, C. Y. and Liao, H.Y.M., 2024. YOLOv1 to YOLOv10: The fastest and most accurate real-time object detection systems. APSIPA Transactions on Signal and Information Processing, 13(1). https://doi.org/10.1561/116.20240058.

Al Washahi, J., Al Qartubi, M.I. and Al-Hakmani, J.H., 2023. Smart identification and notification of drugs in medical pharmacy using IOT. International Journal of Information Technology, Research and Applications, 2(2), pp. 01–09. https://doi.org/10.59461/ijitra.v2i2.47.

Zhou, K. and Yuan, Y., 2020. A smart ammunition library management system based on raspberry pie. In: Procedia Computer Science. Elsevier B.V. pp. 165–169. https://doi.org/10.1016/j.procs.2020.02.041.

Zijp, T.R., Touw, D.J. and van Boven, J.F.M., 2020. User acceptability and technical robustness evaluation of a novel smart pill bottle prototype designed to support medication adherence. Patient Preference and Adherence, 14, pp. 625–634. https://doi.org/10.2147/PPA.S240443.

Zufi Shad, Mehwish Nisar, Tahmina Maqbool, Anamta Khalil and Hadia Imran, 2025. The role of smart pharmacy automation in improving medication safety: A systematic review. Indus Journal of Bioscience Research, 3(7), pp. 90–94. https://doi.org/10.70749/ijbr.v3i7.1683.

المؤلفات المشابهة

يمكنك أيضاً إبدأ بحثاً متقدماً عن المشابهات لهذا المؤلَّف.