INOVTEK Polbeng - Seri Informatika
Vol. 11 No. 2 (2026): May

Smart Pill Dispenser with Naive Bayes Algorithm for Predicting Medication Compliance Based on Patient Behavior Patterns

Achmad Ridwan (Prima Indonesia University)
Samuel Jackonia Sembing (Prima Indonesia University)
Sere Lonian Sihombing (Prima Indonesia University)
Diventranus Lei (Prima Indonesia University)
Rio Utama Putra Pasaribu (Prima Indonesia University)



Article Info

Publish Date
28 May 2026

Abstract

Medication adherence is a critical challenge in chronic disease management, with global non-adherence rates estimated at 50% or higher among patients with long-term conditions. This study presents the design and implementation of an ESP32-based smart pill dispenser prototype integrating a Naive Bayes classification algorithm for real-time, on-device prediction of patient medication compliance behavior. The system collects multimodal interaction data through an RTC DS3231, a load cell weight sensor, and a push button to extract four behavioral features: time delay (ΔT), weight change (ΔW), compliance frequency, and signal quality. These features are locally classified on the ESP32 into three categories: Compliant, Late, and Non-Compliant. A dataset of 100 interaction records was generated through controlled laboratory experiments, with a stratified 80:20 train-test split applied for evaluation. The trained Naive Bayes model achieved an overall accuracy of 80.0% on the test set, with per-class precision, recall, and F1-score reported. Class imbalance effects are analyzed, and results are compared against decision tree, k-NN, logistic regression, and random forest. The prototype demonstrates feasibility as a low-cost, portable medication management device, though clinical validation with real patients remains required.

Copyrights © 2026






Journal Info

Abbrev

ISI

Publisher

Subject

Computer Science & IT

Description

The Journal of Innovation and Technology (INOVTEK Polbeng—Seri Informatika) is a distinguished publication hosted by the State Polytechnic of Bengkalis. Dedicated to advancing the field of informatics, this scientific research journal serves as a vital platform for academics, researchers, and ...