ELKHA : Jurnal Teknik Elektro. Vol. 18 No. April 2026, pp. 18 - 24 ISSN: 1858-1463 . , 2580-6807 . Automatic Daily Medication Reminder Tool Using an IoT-Based ESP532 Sensor Ain Sahara1*). Fitri Oktafiani. Muhammad Saleh. , and Muhammad Fensar. 1, 2, 3, . Department of Instrumentation and Electronics. Sekolah Tinggi Teknologi Minyak dan Gas Bumi Balikpapan. Indonesia Corresponding Email: *) ain. sahara@gmail. Abstract Ae Patient compliance with medication schedules remains a major challenge, especially for individuals with chronic diseases requiring long-term and routine treatment. Missed or delayed doses frequently occur due to forgetfulness or the absence of monitoring. This study presents the design of an IoT-based daily medication consumption monitoring system using an ESP32 microcontroller. The system integrates a limit switch to detect the opening of a medicine box as an indicator of medication intake, and is supported by an LED, buzzer, and 16y2 LCD for local reminders and status display. An Android application is included for configuring schedules and receiving real-time notifications. key methodological difference from previous ESP32-based medication reminder studies is that earlier systems rely mainly on time-based alerts without verifying whether the user actually responds. In contrast, the proposed approach employs sensor-based event detection to confirm physical interaction with the medication box, enabling behavioral verification rather than simple reminder delivery. IoT provides an unprecedented approach in the field of instrumentation and measurement, namely enabling instruments to detect, characterize, and analyze physical phenomena continuously and in real time. This allows the system to log actual user compliance in real time via Firebase. System development involves hardware design. Arduinobased ESP32 programming, and HTTP data communication using JSON processing. Experimental results show that the system reliably detects user actions, triggers reminders, and uploads consumption data. The system has been proven to provide timely notifications via LEDs and buzzers with 100% Overall, the system offers a more accurate and responsive method for supporting daily medication Keywords: Patients. ESP32. IoT. Medication Monitoring. Limit Switch. Arduino. Android Application INTRODUCTION In the current era of digital transformation, the development of instrumentation and electronics technology continues to advance rapidly, particularly in the implementation of Internet of Things (IoT)-based IoT enables various physical devices to connect and exchange data over the internet in real time. In the context of electronics, the integration of microcontrollers such as the ESP32 with various sensors can create an Manuscript received 2025-12-20. revised 2026-02-28. accepted 2026-03-02 adaptive and efficient monitoring system in various fields, including healthcare . With its wireless communication capabilities and high-power efficiency, the ESP32 is a prime choice for developing modern IoT-based systems. The integration of the ESP32 offers a significant advantage because its builtin Wi-Fi and dual-core processing allow sensing, data processing, and cloud communication to run on a single compact platform. Compared to conventional systems that require separate modules for connectivity and control, the ESP32 provides a more efficient, low-power, and costeffective solution. This integration enables faster system response and simplifies the overall architecture of medication-monitoring devices . , . Instrumentation in electronic systems plays a vital role in measuring, controlling, and monitoring physical variables across various sectors. In implementing a drug consumption monitoring system, sensors such as limit switches, real-time clocks (RTC. , and buzzers are used to detect user interactions, record consumption times, and provide reminders. Data from these sensors is processed by the ESP32 and then sent to a cloud platform or application for remote monitoring by family members or medical personnel. The combination of physical sensors and digital platforms makes this system not just an electronic device but also part of a cyber-physical system capable of intelligent response . The application of ESP32-based IoT systems in the medical world is not new, but continues to evolve in various forms. One relevant implementation is an automatic medication reminder and recording system. This is especially important for elderly patients or those with chronic diseases who often experience memory loss. With this system, the reliability of manual recording can be replaced by a more precise digital system, reducing the risk of medication delays or forgetfulness . Furthermore, the success of medical treatment depends not only on the type of medication prescribed, but also on patient compliance with the prescribed schedule. Irregular medication use is a major cause of therapy failure, especially in patients with hypertension, diabetes, and other chronic disorders. The WHO even notes that only around 50% of patients with chronic diseases adhere to their medication schedules, which can certainly worsen - 18 - This work is licensed under a Creative Commons Attribution 4. 0 License For more information, see https://creativecommons. org/licenses/by-nc-sa/4. Automatic Daily Medication Reminder (A. Sahara, et al. their health conditions . Therefore, a system that can help patients maintain medication adherence is essential. Elderly patients and individuals with cognitive impairments are the groups most vulnerable to forgetting to take their medication. In practice, manual reminders such as notes or alarm clocks are ineffective because they are not integrated with a reporting system accessible to family members or medical personnel. In this context, an IoT-based medication consumption monitoring system presents a promising alternative solution. With this technology, medication consumption reminders are not only local . ia buzzer or notificatio. but can also be monitored online by a third party responsible for the patient's health . Several studies have explored the application of medication reminder systems that employ alarm-based mechanisms and mobile notifications to support patient However, existing approaches rely primarily on time-based reminders and do not explicitly verify whether medication has been taken . Other IoT-based healthcare systems focus on general physiological monitoring, offering limited functionality for recording medication consumption behavior . Consequently, the lack of behavior-based detection and real-time compliance logging remains a notable gap in current medication-monitoring solutions. To address this limitation, this study proposes an ESP32-based IoT medication monitoring system that integrates sensor-based event detection, real-time cloud communication, and automated consumption logging. By focusing on instrumentation-driven verification of medication intake rather than solely on reminder delivery, the proposed system aims to provide a more practical framework for monitoring daily medication adherence. According to Ooi and Shirmohammadi. IoT provides an unprecedented approach in the field of instrumentation and measurement, namely enabling instruments to detect, characterize, and analyze physical phenomena continuously and in real time. In other words. IoT is a natural extension of instrumentation devices, which can now be integrated into network-based intelligent systems . synchronized time, the ESP32 periodically compares the current time with the medication schedule data stored in Firebase. If the current time does not match the scheduled time, the system will return to the time monitoring process. However, if the current time matches, the system will activate a buzzer to alert the user. The system will also display a reminder message on the LCD screen or send a notification to the Android application. In the next step, the system waits for the userAos confirmation, in the form of a button press, that the medication has been taken. If the button is not pressed within a specified time period, the system will send a reminder notification. Conversely, if the user presses the button, the system will record that the medication has been taken and save the time of consumption to Firebase as an adherence log. Once the recording process is complete, the buzzer will be turned off, and the system will be considered to have completed one reminder cycle. The system will then return to monitoring mode and wait for the next scheduled medication, repeating the process. This process represents an improvement on real-time medication consumption monitoring and recording systems, whereas previous studies have been time-based and have not explicitly verified whether medication consumption has actually occurred . Other IoT-based healthcare systems have focused on general physiological monitoring, offering limited functionality for recording medication consumption behavior . The addition of behavior-based detection systems and real-time adherence recording remains a significant gap in current medication-monitoring solutions. System Integration Figure 1 illustrates a system block diagram for ESP32-based consumption monitoring, along with the My Aventor website and APK platforms. This system consists of several main components integrated to achieve real-time monitoring over the internet. The ESP32 serves as the system's central control center. This microcontroller receives input from sensors installed in the pillbox and transmits medication consumption status data to the Android application via Wi-Fi. The ESP32 was selected for its ability to support wireless connectivity and good power efficiency. The pillbox is equipped with sensors . uch as reed switches or Hall effect sensor. that detect whether the lid is open or closed. When the lid is opened, the sensor sends a logic signal to the ESP32. This signal is interpreted as medication intake. The ESP32 utilizes the Wi-Fi network to transmit data to the application. This component is crucial because it enables the system to send real-time medication consumption status to a cloud server and then forwards it to the user's device. The application serves as the user interface that displays medication consumption status Users can monitor whether medication has been consumed and receive automatic notifications if there are delays. The smartphone serves as a user access point II. METHODOLOGY Tool Working System The system begins when the device is turned on and all components, both hardware and software, are initialized. The user then enters a medication schedule through the Android application integrated with the system. This entered schedule data is automatically saved in the Firebase Realtime Database, the primary database used by IoT devices. The ESP32 microcontroller then synchronizes the time, either using a Real-Time Clock (RTC) module to maintain accurate time, or by connecting to an NTP server if internet access is available. By using - 19 - Automatic Daily Medication Reminder (A. Sahara, et al. for monitoring information. An app is installed on the device to display data from the ESP32. Communication between the smartphone and the ESP32 is two-way, enabling remote monitoring and control . Ae. , . Tool Design This tool design shows the overall shape and layout of the tool to be built. This drawing provides a general idea of what the Medication Reminder Tool will look like and how its parts will connect. Figure 3 shows that the device has been well integrated between the hardware . ESP32, buzzer. LED. LCD) and software (ESP32 program and Aventor applicatio. Figure 1. System Integration Wiring Diagram A wiring diagram is a diagram that show how electronic components, such as sensors, lights, buzzers, and microcontrollers, are connected via cables in a circuit. This diagram helps us . hether technicians, students, or anyone els. know which cables to connect to where and ensures the device can be installed and operate correctly . Figure 3. Figure Medication Reminder Tool Design This device uses 3 mm-thick Prototype Acrylic as the primary frame material. This prototype plate is durable, sturdy, and easy to shape. It also acts as a good electrical insulator, reducing the risk of short circuits that could damage the device. Research Flow The system workflow begins with the user entering the medication schedule through an Android application, as shown in Figure 4. This schedule is then stored in the Firebase database and serves as the reference for the reminder process. The ESP32 microcontroller synchronizes the current time using either a Real-Time Clock (RTC) module or a Network Time Protocol (NTP) server to ensure time consistency. The synchronized time is continuously compared with the stored medication When the current time does not match the scheduled medication time, the system remains in a waiting state until it activates an audible alarm via a buzzer and displays a reminder message on the LCD or the userAos smartphone. The system then monitors user interaction by checking whether the user presses the confirmation button, indicating a response to the reminder. If the user does not respond within the defined period, the system sends a reminder notification and waits for further user interaction. When the user presses the button, the system records the medication consumption event in the Firebase database. Figure 2. System Diagram Figure 2 shows a wiring diagram of an ESP32 microcontroller-based daily medication consumption monitoring system connected to several main components: a limit switch . s a medication box status senso. , a buzzer . udible reminde. , an LED indicator, a 16x2 LCD . nformation displa. , and the Aventor application accessed via a smartphone. A limit switch was selected as the primary indicator of medication intake due to its simplicity, low power consumption, high reliability, and clear binary output that directly corresponds to the pillboxAos open-closed state. Compared to alternative sensors such as load cells, proximity sensors, or visionbased solutions, the limit switch provides a more stable and cost-effective mechanism for detecting user interaction without requiring complex calibration or high computational resources. Methodologically, this choice ensures that adherence data reflect actual physical engagement with the medication box, thereby improving the practicality and robustness of the monitoring process. - 20 - Automatic Daily Medication Reminder (A. Sahara, et al. RESULTS AND DISCUSSION Tool Design Results The system is designed as a stationary medication box, while patient mobility is supported through smartphone notifications and cloud-based data monitoring, as shown in Figure 5. Figure 5. Medication Reminder Tool The Buzzer Test Results The purpose of the buzzer test is to determine whether the buzzer sounds at the specified time. We use the following accuracy formula: yaycaycaycycycaycayc = ycuycycoycayceyc ycuyce ycaycuycycyceycayc ycyceycyc ycu 100% 15 ycycuycycayco ycyceycyc yaycaycaycycycaycayc = 5 ycu 100% = 100% a . Figure 4. System Flowchart If the buzzer sounds within O 2 seconds of the set time, it is considered correct . ccuracy is me. The buzzer test results show 100% accuracy, meaning the system can sound the buzzer at the set reminder time with a maximum time tolerance of 2 seconds, as shown in Table 1. The buzzer operates exactly as designed, without errors, but there is a time lag of about 1Ae2 seconds before it activates after the conditions are met. After the data are successfully logged, the alarm is deactivated, and the system returns to the idle state, waiting for the next scheduled reminder. Unlike previous medication reminder systems that rely solely on timebased alerts or simple confirmation mechanisms such as manual buttons . , the proposed approach introduces a behavior-driven verification method by utilizing a limit switch to detect the physical opening of the medication This event-based detection provides an automated and objective indication of user interaction, enabling the system to record actual responses rather than merely deliver reminders. The integration of sensor-verified behavior with real-time cloud synchronization via Firebase represents a methodological advancement over prior ESP32-based designs, which generally lack direct validation of user actions and do not incorporate continuous monitoring of adherence events. Through this approach, the system provides a more reliable and datadriven framework for monitoring daily medication intake. Table 1. Buzzer Test Result - 21 - No. Time Setting Buzzer Condition (On/Of. On Time 13:40:00 13:41:00 13:42:00 13:43:00 13:44:00 13:40:01 13:41:01 13:42:02 13:43:02 13:44:01 Automatic Daily Medication Reminder (A. Sahara, et al. Table 3. Limit Switch Test Result The LED Test Results The LED test results aim to determine whether the LED is lit under the specified settings. Accuracy was calculated based on the correspondence between the LED activation status and the expected response time, as shown in Table Table 2. LED Test Result No. Time Setting LED Condition (On/Of. On Time LED-1 13:06:00 13:07:00 13:09:00 13:10:00 13:10:00 13:06:02 13:07:02 13:08:03 13:08:03 13:08:02 LED-2 13:11:00 13:12:00 13:13:00 13:14:00 13:15:00 13:11:02 13:12:02 13:13:03 13:14:02 13:15:02 LED-3 13:16:00 13:17:00 13:18:00 13:19:00 13:20:00 13:16:02 13:17:02 13:18:02 13:19:02 13:20:02 Total tests: 5(LED. 5(LED. 5(LED. =15a. ycu 100% Time Setting Firebase Server Notifications (Sent/Not Sent Time Medicine Storage Box-1 14:28:00 14:29:00 14:30:00 14:31:00 14:32:00 Sent Sent Sent Sent Sent 14:28:03 14:29:05 14:30:05 14:31:03 14:32:06 Medicine Storage Box-2 14:33:00 14:34:00 14:35:00 14:36:00 14:37:00 Sent Sent Sent Sent Sent 14:33:03 14:34:03 14:35:04 14:36:03 14:37:03 Medicine Storage Box-3 14:38:00 14:39:00 14:40:00 14:41:00 14:42:00 Sent Sent Sent Sent Sent 14:38:03 14:39:03 14:40:03 14:41:03 14:42:03 The accuracy of the Limit Switch test is 100%. All sensors successfully detected the opening of the medication box at the appropriate time, with an average delay of 1-2 seconds. Table 4 shows that the tests were conducted at three key times of the day: morning, afternoon, and evening, both when the medication box was opened and when it was not. The system demonstrated stable and consistent responses. This means the device successfully responded to all scenarios, both when the medication was taken and when it was not, without any errors during the test. This demonstrates that the reminder system performed very well and reliably under the test conditions. When it's time to take medication, and the box hasn't been opened, the device automatically turns on the LED and buzzer as a reminder. However, if the box is opened on time, the buzzer immediately sounds, the LED turns off, and the screen displays a message indicating that the medication has been taken. Since all LEDs (LED-1. LED-2, and LED-. were lit in all test cases, the evaluation focused on the ON function of each LED output. The test results show that LED-1. LED2, and LED-3 turned on properly in response to the control signals, with no malfunctions observed during testing. This indicates that the LED output stage of the system operated correctly and reliably. yaycaycaycycycaycayc = No. = 100% AA. Despite the 2Ae3 second delay, all LEDs lit as intended, and there were no failures. Therefore, the LED test accuracy is 100% regarding Equations . The Limit Switch Test Results Testing the Limit Switch determines whether the medication box is open. The results of the limit switch testing are shown in Table 3. - 22 - Automatic Daily Medication Reminder (A. Sahara, et al. Table 4. Overall Test Results No. Time Morning Morning Afternoon Afternoon Night Night Morning Afternoon Night Morning Afternoon Night Morning Afternoon Night Morning Afternoon Night Morning Afternoon Box Status (Open/ Close. Open Closed Open Closed Open Closed Open Open Open Closed Closed Open Open Open Closed Open Closed Open Closed Open LED & LCD Buzzer (On/Off Taken Off Not Taken Off Not Taken Off Not Taken Taken Taken Off Not Off Not Taken Taken Taken Off Not Taken Off Not Taken Off Not Taken Information Succeed Succeed Succeed Succeed Succeed Succeed Succeed Succeed Succeed Succeed Succeed Succeed Succeed Succeed Succeed Succeed Succeed Succeed Succeed Succeed Figure 6. The application interface which shows up on the userAos smartphone The system also sends a notification to my Aventor app to let the user know that the activity has been recorded. When the user is late, the LCD also displays a AuNot takenAy warning, as an additional visual reminder. Overall, the device is responsive and provides reliable results in everyday use (Table . Figure 6 presents the interface of the smartphone-based application used to integrate and control the system. Although the proposed system does not directly verify physiological medication consumption, it still utilizes real-time monitoring by medical personnel or family members to determine whether the patient is actually taking the medication as prescribed. An eventbased approach offers a practical alternative to more complex consumption-detection technologies such as smart pills or ingestible sensors. These state-of-the-art systems provide high verification accuracy but require specialized hardware, incur higher operational costs, and entail increased system complexity, making them less suitable for everyday use by the general population . , . In contrast, the ESP32-based limit-switch mechanism provides a low-power, low-cost, and reliable behavioral proxy that can be easily deployed in home environments while still enabling real-time adherence monitoring. This methodological trade-off allows the system to maintain feasibility and scalability while addressing the core problem of missed medication events without requiring invasive or high-cost solutions. Although the buzzer. LED, and limit switch tests demonstrated 100% functional accuracy, these metrics primarily reflect local hardware responsiveness and do not fully represent the reliability of an IoT-based medical Additional performance indicatorsAisuch as network latency, packet loss during data transmission, and overall system uptimeAiwere not evaluated in this prototype but are essential for ensuring dependable real-time monitoring in practical healthcare environments. Furthermore, the event-based detection approach has an inherent limitation the system may record false compliance when the medication box is opened without the medication actually being consumed. These factors highlight the need for future work to incorporate more comprehensive reliability testing and mitigation strategies to improve the validity of adherence data. IV. CONCLUSION An IoT-based daily medication reminder and monitoring system using an ESP32 microcontroller has been designed and implemented. The system integrates limit switches to detect medication box opening events and is supported by LEDs, buzzers, and a 16x2 LCD, which provides local reminders and status information. Medication schedules and consumption records are stored in the Firebase Realtime Database and accessed through an Android application for remote monitoring. The system has been proven to provide timely notifications via LEDs and buzzers with 100% accuracy. Medication intake data is automatically recorded and sent to the Firebase Realtime Database, allowing the Android application to record and monitor user activity directly. This system still uses realtime monitoring by medical personnel or family members - 23 - Automatic Daily Medication Reminder (A. Sahara, et al. to determine whether patients are actually taking medications as prescribed, and to fill medication needs in the medicine box. The user-friendly Android application also adds value to the monitoring process for family or medical personnel. ACKNOWLEDGEMENT Thank you to all parties who have helped and provided support in the creation of this tool, both moral and material . REFERENCES