We use cookies to ensure our website works properly and to personalise your experience. Cookies policy
Department of Electrical and Electronics Engineering, K.Ramakrishnan College Of Technology
Patients who take several medicines at different times of the day often forget the correct medicine, the correct dose, or the scheduled time. Manual tracking offers no automatic reminder, no confirmation that the right medicine was chosen, and no warning when the stock is running out. This paper presents the design and implementation of a low-cost RFID-based smart pill reminder and medication monitoring system built around an ESP32 microcontroller, an MFRC522 RFID reader, a DS3231 real-time clock (RTC), a 0.96-inch I2C OLED display, an active buzzer, and the Blynk mobile platform. Every medicine bottle carries a unique RFID tag. The user or caregiver enters the medicine name, reminder time, dose, tablet count, and low-stock limit through the mobile application. At the scheduled time the buzzer sounds and the display prompts the user to scan the bottle. The buzzer continues until the bottle carrying the correct RFID tag is presented; a wrong bottle produces a “WRONG MEDICINE” message and the alarm continues. On correct identification the display shows “MEDICINE CONFIRMED”, the buzzer stops, the tablet count is reduced by the prescribed dose only once for that scheduled dose, and the updated count is sent to the mobile application. A notification is raised when the stock reaches a predefined low limit. Schedules and tablet counts are held in the non-volatile memory of the ESP32, so reminders and RFID verification continue even when Wi-Fi is unavailable and after a power failure. RFID scanning confirms only that the correct bottle was presented to the reader; it does not prove that the tablet was swallowed. The system is therefore a medication reminder, medicine verification, and tablet-stock monitoring system.
Taking the right medicine at the right time is essential for the treatment of chronic and acute illnesses. In practice, patients, and especially elderly patients who follow several prescriptions at once, forget doses, confuse similar-looking bottles, or run out of tablets without noticing. Forgetfulness is a commonly reported reason why patients do not follow their prescribed regimens, and the problem grows as the number of medicines and the frequency of doses increase [1], [16]. Electronic medication reminders have therefore been studied as a way to support self-care and caregiver supervision [3].
Internet of Things (IoT) platforms and low-cost Wi-Fi microcontrollers such as the ESP32 make it practical to build such reminders at a small cost [18], [19]. However, many reminder devices only sound an alarm at a fixed time. They do not check which medicine is being taken, and they do not keep track of how many tablets remain.
Patients taking multiple medicines at different times may forget the correct medicine, dosage, or scheduled time. Manual medication tracking makes it difficult to confirm whether the correct medicine was taken and to monitor the remaining tablets, and it provides no automatic reminder or low-stock notification. A smart system is therefore required to provide timely reminders, verify the correct medicine, track tablet usage, and notify the user or caregiver when the medicine is running low.
This work proposes an RFID-based smart pill reminder that identifies each medicine bottle through a unique RFID tag, provides a timely audible and visual reminder, verifies the bottle presented by the user, tracks tablet usage, and connects to a mobile application for schedule entry and low-stock alerts. The main objectives are: (i) to identify each medicine bottle using RFID; (ii) to set the medicine schedule through a mobile application; (iii) to keep accurate time using an RTC; (iv) to sound an alarm until the correct bottle is scanned; (v) to reduce and report the tablet count after confirmation; and (vi) to continue operating from locally stored data when the mobile connection fails.
An important limitation must be stated clearly. RFID scanning confirms that the correct medicine bottle was presented to the reader, but it does not prove that the patient actually swallowed the tablet. The proposed system is therefore described as a medication reminder, medicine verification, and tablet-stock monitoring system, and not as a system that confirms ingestion.
LITERATURE SURVEY:
Osterberg and Blaschke et al. [16] reviewed the problem of medication non-adherence and described it as a widespread obstacle to effective treatment, and the World Health Organization report on adherence to long-term therapies [17] reached a similar conclusion, stressing that poor adherence reduces the benefit of treatment. These works establish the need for tools that help patients take medicines correctly and on time.
Fang et al. [3] reviewed current trends in electronic medication reminders for self-care. The review provides the background for using electronic reminders to support patients who manage
their own medication, and it shows that reminder technology is moving from simple alarms towards connected and monitored systems.
Shobanen and Mat Akir et al. [1] developed an ESP32-based pill monitor and reminder with a Blynk notification system. Their prototype uses an infrared sensor, an ESP32 and a buzzer. The buzzer sounds at the programmed time, the infrared sensor detects the patient’s hand to silence the alarm, and the Blynk application notifies the user about low medicine supply and missed doses. Their work shows that the ESP32 and Blynk are a practical combination for pill reminders and caregiver notification, but the system does not identify which medicine is presented.
Abdul Minaam and Abd-ELfattah et al. [2] presented a smart pill box for a medicine reminder and monitoring system with the aim of improving healthcare through reminders and monitoring of medicine intake. Khedkar et al. [4] proposed an IoT-based smart pill box that reminds the user to consume medicine, and Gandhi et al. [5] reported a smart pill box design for the same purpose. These works show that low-cost microcontroller-based pill boxes are a well-studied approach to medication reminders.
Dharmoji et al. [13] designed a smart medicine reminder box with an Android application, which shows the value of a mobile interface for entering schedules and receiving alerts. Fatima and Hipparge et al. [14] described an IoT-driven smart pill box that reminds the user of medicine consumption, and Ahmad et al. [15] reported an IoT-based pill reminder and monitoring system. Together these studies confirm that combining a reminder device with a mobile application and IoT connectivity is a practical way to involve caregivers.
Atzori et al. [18] surveyed the Internet of Things and described how identification technologies, sensors and communication links allow everyday objects to be connected, and Gubbi et al. [19] discussed the architectural elements and future directions of IoT. Both works support the use of a low-cost microcontroller with Wi-Fi and a cloud platform as the basis of a healthcare monitoring application, which is the approach used in this paper.
Finkenzeller et al. [20] described the fundamentals of radio frequency identification, including the 13.56 MHz contactless tags used with readers such as the MFRC522. RFID allows a unique tag to be assigned to every object, so a medicine bottle can be identified without line of sight. A common limitation of the pill boxes surveyed above is that they remind the user of the time, or detect that something was removed or approached, but they do not identify which medicine was presented. The present work addresses this gap by assigning an RFID tag to every bottle and
checking the scanned tag against the scheduled medicine before the alarm is silenced, together with tablet-count tracking, low-stock notification and non-volatile storage.
Embedded and intelligent computing techniques are also widely applied in biomedical engineering. Sujitha et al. [6] used a metaheuristic-optimized Swin transformer for keratoconus classification, Satheesh Kumar et al. [7] applied a hybrid bat algorithm based ANFIS classifier to detect autism from EEG behavior, and Mahil and Kingsly [8] studied hybrid search optimization for unit commitment. Mahil and Raja et al. [9]–[11] developed optimization-based adaptive cancellers to suppress incubator interference in the ECG of premature infants, and Mahil et al. [12] reported optimization algorithms for adaptive filtering of interferences in corrupted signals. These works show the importance of reliable, low-cost embedded processing in healthcare applications, which motivates the present design.
METHODOLOGY:
The prototype is built around a single ESP32 board that acts as the brain of the whole system. Every other part either feeds information into it or carries out an action on its behalf. The reader picks up the tag on a medicine bottle, the clock tells it what time it is, the display and the buzzer talk to the user, and the Wi-Fi link connects it to the Blynk cloud so that a caregiver can manage the schedule from a phone. Figure 1 shows the block diagram of the smart pill system.

Figure 1: Block Diagram of the Smart Pill System
Each part was chosen to keep the cost low and the wiring simple. The ESP32 DevKit provides two processor cores, built-in Wi-Fi and enough flash memory to hold the program together with the stored medicine records. The MFRC522 is a 13.56 MHz reader that exchanges data with the ESP32 over the SPI bus and returns the unique identification number (UID) of any tag brought close to it. A separate tag is stuck on every medicine bottle, so the UID acts as the identity of that medicine. For timekeeping, a DS3231 module is used because it has its own temperature-compensated oscillator and a backup cell, which means the time stays correct even when the board is switched off or has no internet. A 0.96-inch OLED screen with an SSD1306 controller displays the messages, and an active buzzer gives the audible alert, since it only needs a high or low level on one pin to start or stop. The reader is powered from 3.3 V as its pins do not tolerate 5 V, and the whole assembly is supplied from a 5 V USB adapter or power bank through the VIN pin of the ESP32. No LEDs are used anywhere in the design.
The wiring is shown in Fig. 2. The reader uses the hardware SPI pins of the ESP32, with its chip-select line on GPIO 5, clock on GPIO 18, MOSI on GPIO 23, MISO on GPIO 19 and reset on GPIO 27, while its interrupt pin is left free. The RTC and the OLED are both I2C devices, so they share the same two wires, GPIO 21 for data and GPIO 22 for clock, and the controller tells them apart by their different bus addresses. The buzzer is wired between GPIO 25 and ground. Using only a handful of pins keeps the breadboard layout tidy and leaves room for later additions. Figure 2 shows the Connection diagram of the RFID-based smart pill reminder system.

Figure 2: Connection Diagram of the RFID-based Smart Pill Reminder System
The program is written in the Arduino IDE and is divided into small functions, one each for reading the tag, checking the time, updating the display, switching the buzzer, saving data and talking to Blynk, so that a student can follow and modify each part independently. The code depends on a few libraries. The SPI and MFRC522 libraries handle communication with the reader and give back the tag UID. The Wire library runs the I2C bus, on top of which RTClib reads the date and time from the DS3231, and the Adafruit GFX and SSD1306 libraries draw text on the screen. The Preferences library stores values in the non-volatile memory of the ESP32, and the WiFi and Blynk libraries manage the connection to the cloud.
The user or caregiver first registers each bottle by letting the reader scan its tag and linking the UID to a medicine. Through the Blynk application they then enter the medicine name, the reminder hour and minute, the number of tablets in one dose, the number of tablets in stock and the stock level at which a warning should be raised. These values arrive at the ESP32 over Wi-Fi on datastreams V0 to V4 and are copied into its non-volatile memory straight away. The ESP32 reports back on V5 and V6, which carry the remaining tablet count and the current medicine status. In normal operation the ESP32 keeps comparing the time given by the RTC with the stored schedule. When the two match, the buzzer starts and the screen asks the user to scan the bottle. Whatever tag is brought to the reader is compared with the UID saved for the scheduled medicine. A mismatch leaves the buzzer running, shows “WRONG MEDICINE” and sends a wrong-medicine status to the phone. A match switches the buzzer off, shows “MEDICINE CONFIRMED”, subtracts the prescribed dose from the stock and sends the new count to the application. If the stock has fallen to the chosen limit or below, a Blynk notification warns that the
medicine is running low, and the system goes back to waiting for the next scheduled time.
A few design decisions make the behaviour dependable. Each scheduled dose carries a “confirmed” flag, so scanning the same bottle again cannot lower the tablet count a second time. Instead of long delay () calls, the program measures elapsed time with millis (), which lets the reader, the screen and the buzzer all stay responsive together. If Wi-Fi drops, the reminder and the tag check carry on using the data already stored in the board, and the cloud values are brought up to date once the link returns. Because the schedule and the tablet counts are kept in non-volatile memory, they also survive a power cut. Finally, it is worth remembering that the reader only proves which bottle was shown to it, so the system supports the patient with reminders and verification but cannot confirm that the tablet was actually swallowed.
RESULTS AND DISCUSSION:
The core firmware of the prototype was written and compiled in Arduino IDE 2.3.2 for the ESP32 Dev Module. The program includes the SPI, MFRC522, Wire, RTClib, Adafruit_GFX and Adafruit_SSD1306 libraries, initialises the reader, RTC and OLED in setup (), and in loop () compares the RTC time with the scheduled hour and minute, displays “Medicine Time! Scan Medicine” and drives the buzzer. The compiler report shows that the sketch uses 1,310,728 bytes (39%) of program storage and 46,600 bytes (14%) of dynamic memory, which leaves sufficient memory on the ESP32 for the Blynk, Wi-Fi and NVS functions.
The intended behaviour of the system is as follows. When the scheduled time is reached, the buzzer turns on and the display shows “MEDICINE TIME - SCAN BOTTLE”. If a wrong bottle is scanned, the buzzer remains on and “WRONG MEDICINE” is displayed. If the correct bottle is scanned, the buzzer turns off, “MEDICINE CONFIRMED” is displayed and the new tablet count is sent to the mobile application. A second scan of the same bottle after confirmation does not reduce the count again. When the stock is at or below the low limit, a notification is raised. If Wi-Fi is unavailable, the reminder and verification continue from stored data, and after a power failure the schedule and tablet counts are restored from NVS.
As an illustration, consider Paracetamol with an RFID tag UID of A3 47 91 2C, a reminder time of 08:30, a dose of one tablet, an initial stock of 10 tablets and a low-stock limit of 3 tablets. At 08:30 the buzzer turns on. If another medicine’s bottle is scanned, “WRONG MEDICINE” is displayed and the buzzer continues. When the Paracetamol bottle is scanned, “MEDICINE CONFIRMED” is displayed, the buzzer stops and the count changes from 10 to 9. When the count reaches 3, the notification “Paracetamol stock is low - 3 tablets remaining.” is sent to the mobile application.
The timing behaviour of the system was examined for a sample three-dose daily schedule at 8 AM, 1 PM and 8 PM. Fig. 3 shows the reminder status. The reminder switches ON when the RTC time reaches each scheduled time and returns to OFF after the dose event has been handled, giving one reminder pulse for each of the three scheduled doses. Figure 3 shows the Medication reminder activation.

Figure 3: Medication Reminder Activation
At 8 AM and 1 PM the buzzer turns ON at the scheduled time and goes OFF almost immediately, which corresponds to the correct bottle being scanned. At 8 PM the buzzer turns ON and stays ON, because no correct bottle is presented; this agrees with the design requirement that the alarm must continue until the right bottle is scanned. Figure 4 Buzzer activation.

Figure 4: Buzzer Activation
The doses at 8 AM and 1 PM are marked as taken, since the correct RFID tag was verified, while the dose at 8 PM is marked as missed because it was not confirmed. Figure 5 shows the Medicine taken / missed.

Figure 5: Medicine Taken / Missed
The status rises from OFF to the reminder level at each scheduled time, moves to the medicine-taken level after a correct scan and falls back to OFF. At 8 PM, where no confirmation occurs, the status moves to the medicine-missed level and remains there. Together, Figs. 3 to 6 show that the reminder, the alarm and the dose record respond consistently to a correct scan and to a missed dose. As noted earlier, a taken status only means that the correct bottle was presented to the reader; it does not prove that the tablet was swallowed. Figure 6 shows the status indication.

Figure 6: Status Indication
The use of a unique RFID tag for every bottle allows the system to verify the medicine and not just the time, and the combination of the RTC and the non-volatile memory keeps the reminder reliable without the mobile connection. The system has one important limitation: RFID verification only confirms that the correct bottle was presented to the reader. It cannot show that the tablet was swallowed. Reliable confirmation of ingestion would require additional sensing or caregiver
supervision, and the system should be understood as a reminder, verification and stock-monitoring aid.
CONCLUSION:
An RFID-based smart pill reminder and medication monitoring system has been designed using an ESP32, an MFRC522 RFID reader, a DS3231 RTC, an OLED display, an active buzzer and the Blynk mobile platform. The system reminds the user at the scheduled time, keeps the alarm active until the correct medicine bottle is scanned, displays clear confirmation or warning messages, reduces the tablet count only once per scheduled dose, and sends the remaining count and low-stock notifications to the mobile application. By storing the schedule and tablet counts in the non-volatile memory of the ESP32, the system continues to operate during Wi-Fi failure and power loss. The prototype is low in cost and simple to build, and it is suitable for home use under caregiver supervision.
Because RFID verification does not prove that the tablet was swallowed, the system is a reminder, medicine-verification and stock-monitoring aid. Future work may include support for more medicines and schedules, a missed-dose alert to the caregiver, a weight or compartment sensor to better indicate that medicine was actually removed, dose-history logging, and a compact enclosure for the bottles and electronics.
REFERENCES
Sanjai A., Damodharn V., Lokesh M., Theradi Santhosh M., RFID-Based Smart Pill Reminder and Medication Monitoring System, Int. J. Sci. R. Tech., 2026, 3 (10), 728-734. https://doi.org/10.5281/zenodo.23314704
10.5281/zenodo.23314704