You are on page 1of 29

IOT BASED SMART PILL DISPENSER

Term Paper report Submitted in partial fulfillment of the requirements for the
award of degree of

BACHELOR OF TECHNOLOGY

in

ELECTRICAL AND ELECTRONICS ENGINEERING

by

K.JEEVAN KUMAR (210006037)


M.AJAY KUMAR (2100069071)

Under the esteemed guidance of

Dr. DUKKIPATI SUDHA


Asst. Professor
EEE Department

DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING


KONERU LAKSHMAIAH EDUCATION FOUNDATION
(Deemed to be University u/s 3 of UGC Act 1956)
K L Deemed to be University
VADDESWARAM– 522 302
ANDHRA PRADESH INDIA
2023-24
KONERU LAKSHMAIAH EDUCATION FOUNDATION
DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING

Certificate
This is Certified that the term paper project entitled “IOT BASED SMART PILL
DISPENSER” which is a hardware work carried out by JEEVAN KUMAR (210006037)
M.AJAY KUMAR (2100069071) in partial fulfillment for the award of the degree of
Bachelor of Technology in Department Electrical & Electronics Engineering, during the
year 2023-2024. The term paper project has been approved as it satisfies the academic
requirements.

Dr. DUKKIPATI SUDHA (Dr. A PANIDIAN)


Mentor Head of the Department
ACKNOWLEDGEMENT

Our sincere thanks to Dr. Dukkipati Sudha in the Lab for their outstanding support
throughout the project for the successful completion of the work.
We express our gratitude to Dr. A. Pandian, Head of the Department for Electrical and
Electronics Engineering for providing us with adequate facilities, ways and means by which
we able to complete this term paper project.
We would like to place on record the deep sense of gratitude to the honourable Vice
Chancellor, K L Deemed to be University for providing the necessary facilities to carry the
term paper project.
Last, but not the least, we thank all Teaching and Non-Teaching Staff of our department and
especially my classmates and my friends for their support in the completion of our term
paper project.

Project Associates
K. JEEVAN KUMAR (210006037)
M.AJAY KUMAR (2100069071)
CONTENTS
Page No.

List of Figures 1

Abstract 2

Chapter-1 Introduction 3
1.1 Research on Aging Population

1.2 chronical diseases in elder people


Chapter-2 Literature review 6
Chapter-3 System design 9
3.1 Components Required

Chapter-4 Working 17

4.1 Hardware Setup

4.2 Blynk App Configuration

4.3 Arduino IDE

4.4 Output of MAX30102

Conclusions 22

Future Scope 23

References 24
List of Figures
Page No.
1.1 Aging Population 3
1.2 Chronical diseases in elder people 4
2.1 Manual pill organizer 6
2.2 Basic Automated Pill Dispensers 7
3.1 Arduino uno 9
3.2 ESP32 10
3.3 ESP32 CAM 10
3.4 RTC DS3231 11
3.5 MAX30102 Pulse Oximeter Sensor 12
3.6 Working of MAX30102 13
3.7 Buzzer 14
3.8 LED’s 14
3.9 Servo Motor 15
3.10 IR sensor 16
3.11Block Diagram of System 16
4.1 Integration of ESP32 with MAX30102 18
4.2 Blynk app dashboard 19
4.3 Output of MAX30102 Sensor 20

1
ABSTRACT
In today's fast-paced world, many individuals, particularly the elderly and those with chronic
illnesses, encounter challenges in adhering to their daily medication schedules. This
forgetfulness, often exacerbated by conditions such as dementia, poses significant risks. To
address this issue, this project explores technologies in home healthcare aimed at enhancing
medication management and monitoring. An innovative solution proposed is an IoT-based
medicine dispenser. This device is designed to aid patients and seniors in adhering to their
medication regimen by ensuring timely intake and preventing dosage errors. It utilizes
alarms to remind patients and can promptly notify caregivers when medication is due. By
promoting self-reliance and minimizing medication errors, this technology plays a crucial
role in supporting the elderly and individuals with health issues in our modern, fast-paced
society.

2
IOT BASED SMART PILL DISPENSER

Chapter-1
INTRODUCTION
1.1 Research on Aging Population
In the last few years, the average age of the world population has been growing rapidly.
Statistics affirm that the number of the elderly in the world is growing by 3.26% per year .
In addition, according to recent reports of health organizations, world societies are expecting
more growth in communities of elderly individuals. Global Age watch index estimates that
the aging population will continue to increase to reach 1.4 billion in 2030 and 2.1 billion by
2050 .

Fig 1.1 U.S. Population Age 65+ Growth, 1900-2060

1.2 CHRONICAL DISEASES IN ELDER PEOPLE


As the rate of aged individuals grows, the number of individuals suffering from chronic
diseases such as diabetes, high blood pressure will continue to rise. These conditions usually
require people to take multiple medications regularly to help them complete their daily life
activities safely and autonomously.

3
Fig 1.2 Chronical diseases in elder people
Thus, due to cognitive deficits correlated to age as memory deficits, older people with
intricate medication routines often tend to forget about their intakes, timings, and doses. This
frequently leads to wrong medication intakes, which can cause serious health consequences.
Medication adherence is considered a major medical concern. To support them in
medication intake, elderlies often appeal for help. However, relatives and caregivers who
frequently help the elderly in remembering their medication intakes face a daily burden
while dealing with their own lives and assisting these individuals. In addition, the recent
pandemic of Covid-19 has emphasized the importance of providing independent
autonomous living to seniors. In this perspective, multiple tools and solutions were
developed to support the elderly in this particular activity. It was found that senior
individuals have high acceptability of using smart kits and technological solutions . Smart
pill dispensers are one of the most preferred solutions . A study shows that the demand for
smart pill dispensers will keep increasing . The use of IoT paradigm in the healthcare
industry has offered various efficient applications and systems with different architectures .
In this context, we present an IoT based smart pill management system. It consists of a
connected pill dispenser connected with a mobile application installed for four main users.
system are the patient, the doctor, the pharmacist, and the caregiver. The developed system
works on two main modes: the assistance mode and the programming mode. In the assistance
mode, the pillbox continuously checks the current time using NTP (network timing
protocol).. When the intake time arrives, the pillbox emits sounds and lights using a buzzer
and a LED to alert the patient. An LCD is also used to display directives for the patient.
However, if the patient decided to take his/her pill in the 10 minutes that precede the right

4
intake time, the pill dispenser alarms are automatically cancelled. In the programming mode,
the pharmacist schedules wirelessly the pill dispenser and refills the pills compartment one
by one using a simple interface on his/her cellphone. The doctor is also able to write and
edit prescriptions for his/her patient remotely anytime. For medication adherence
monitoring, the proposed system provides all of the users with real-time intakes history. In
addition to the gradual assistance in medication reminders, the presented system keeps safe
the pills, the patient, and the relatives living with him. In addition to this we have integrated
the health monitoring system which monitor the health conditions like SPO2 and the BPM
By that we can have the record of patients health. Measures are implemented to prevent
unauthorized access to medication, ensuring that only intended users (patients) can access
the pills. This is particularly important to safeguard against accidental ingestion by children
or others.

5
Chapter 2
Literature review
Existing medication adherence solutions vary from simple electronic devices which are the
traditional pill organizers to complex intelligent systems such as pill dispensers. By
comparing different conceptual and implementation aspects, pill dispensers may be
reviewed according to the used pill dispensing mechanism, the developed programming
mode of the dispenser, the way pills intakes’ reminders are delivered and the developed
intakes monitoring method. To remind the assisted individual of his/her medication, first
developed pill dispensers mainly used visual and acoustic reminders such as buzzers to emit
sounds and LEDs to turn on lights.
Manual Pill Organizers:
Traditional pill organizers have been used for decades , typically consisting of separate
compartments for different days of the week. Users manually fill each compartment with
their medications.
Limitations:
1. Manual Organization Required
2. Risk of Medication Errors
3. Limited Capacity for Storage and Flexibility
4. Difficulty in Medication Management for Caregivers
5. Lack of Security

Fig 2.1 Manual pill organizer


Basic Automated Pill Dispensers:
Early automated pill dispensers began to emerge, offering basic features such as pre-set
alarms to remind users when to take their medications with the LED indication and the
buzzer sound.

6
Limitations:
1. Manual setting of time
2. Lack of Connectivity
3. Limited Customization

Fig 2.2 Basic Automated Pill Dispensers


There are pill management systems that have associated mobile applications to the pillboxes.
These systems use mobile notifications to alert the patient about his/her intakes. Others, e.g.,
used both mobile application notifications along with pill dispenser alarms to alert the
patient. However, the user may be confused due to these double reminders and may take
his/her pills twice. Furthermore, many of the proposed systems used LCDs or OLEDs
screens to display medicines’ relative information.The second aspect to discuss pill
management systems is the way the pill dispenser is programmed and filled. Most of the
developed dispensers require that the caregiver or the patient repeatedly fill the pills and
schedule the intake timings . Thus, they leave the programming and filling mode unsecured.
In this case, the patient has access to the pill dispenser outside the intake hours. Also, anyone
may fill the pills and even edit pill schedules. point out the importance of respecting
prescriptions and the consequences of mistaking pills, so it is very important to secure pill
dispensers and make pill scheduling and filling process accessible only by health
professionals. To secure the pill dispenser, used an identification protocol based on person
identification via camera, thus no information was provided whether the programming mode
of the pillbox is also secured. Others like secure the scheduling process but ignore the
security of the filling process. In their system, the scheduling is done by physicians through
a web application. Thus, no information was given on how the filling is done. In the patient
himself/herself is responsible for pill filling whereas it is the doctor who does the scheduling
of the intakes. Another important detail in pill dispensers is the method used for dispensing
the medication. The dispensing method used in medication dispensers is very important

7
since it impacts the medication adherence of the patient and also the security of both the
patient and the relatives living with him/her as well. Some of the developed systems use
vital signs to dispense the pills only when it is necessary .However, this is not adopted for
elderly individuals with memory deficits since they do not emit any reminders. The authors
of use ultrasound sensors to detect the presence of the individual before dispensing the pills.
If a presence is detected, the scheduled pill will automatically be dispensed. Yet, this may
put at risk infants or illiterate adults living with the patient, since it blindly frees the
medication. Similar solutions are described in which automatically open when the intake
time comes. In case of non-response from the patient, the pills remain accessible for all the
individuals living with him/her. In an infrared sensor is used to detect if the pill has been
taken or not. However, if the patient does not respond in 10 min the pillbox locks
automatically.
Moreover, the existing pill dispensers require physical intervention to be programmed, while
the dispenser of this system is wirelessly and securely programmed. The connected pill
management system is fully connected and the intake tracking is done remotely.
We developed a pill management system adapted to elderly needs suffering from mild
cognitive impairments related to age. In this system, we address multiple issues. Mainly,
simple gradual assistance is provided for the users so as to increase their adherence to
medication by giving them more time to take their scheduled pills. Our system uses multiple
means of assistance. This way individuals with visual or acoustic deficits and also elderly
with few skills in operating IT are able to handle productively. The implemented pill
dispenser is connected with a mobile application that ensures full medication monitoring for
the preauthorized users, and it is manipulated only by health professionals. A secured
dispensing mechanism is implemented so that the pills stay out of reach of unauthorized
individuals and also from authorized individuals outside their intakes timings intervals. In
addition to dispensing we integrated the health monitoring system which monitor the SPO2
and BPM of patient .

8
Chapter 3
System design
3.1 Components Required:
• Arduino uno
• Jumper wires
• IR sensors
• Servo motor
• Bread board
• LED’s
• Buzzer
• RTC DS3231 sensor
• MAX30102 sensor
• ESP32
• ESP32 CAM
Arduino uno:
The Arduino Uno is a popular microcontroller board widely used in electronics projects and
prototyping. It features an Atmega328P microcontroller, digital and analog input/output
pins, USB interface for programming and communication, and a power jack. The Uno is
beginner-friendly with a simple interface and extensive community support. It can be
programmed using the Arduino IDE, which offers a user-friendly environment for writing
and uploading code. The Uno's versatility makes it suitable for a wide range of applications,
from simple LED blinking projects to more complex robotics and IoT systems. Arduino
UNO controls all of the hardware components of the pill dispenser

Fig 3.1 Arduino uno

9
ESP32:
The ESP32 is a versatile microcontroller that combines Wi-Fi and Bluetooth connectivity
with powerful processing capabilities. It's widely used in IoT applications due to its low
cost, low power consumption, and rich set of features. With built-in support for wireless
communication protocols and ample GPIO pins, the ESP32 is ideal for creating connected
devices, sensor nodes, and smart systems. Its popularity stems from its flexibility, ease of
use, and extensive community support, making it a go-to choice for developers working on
IoT projects. The ESP32 is considered for communication between mobile application and
the pill dispenser.

Fig 3.2 ESP32


ESP32 CAM:
The ESP32-CAM is a small-sized, low-cost development board based on the ESP32
microcontroller and an OV2640 camera module. It integrates Wi-Fi and Bluetooth
connectivity, making it suitable for IoT applications that require image capture and
transmission. The ESP32-CAM board features GPIO pins for connecting additional sensors
or peripherals, as well as a microSD card slot for storing captured images or videos.

Fig 3.3 ESP32 CAM

10
It can be programmed using the Arduino IDE or ESP-IDF (Espressif IoT Development
Framework), offering flexibility for developers to create various projects such as security
cameras, surveillance systems, and video streaming applications. The ESP32-CAM's
compact size, affordability, and versatility make it popular among hobbyists and makers
interested in visual IoT projects. The ESP32 CAM is used for security i.e to avoid
unauthorized person can’t take the pill.
RTC DS3231 Sensor:
The RTC DS3231 sensor is a highly accurate real-time clock (RTC) module commonly used
in electronic devices for timekeeping applications. It features a built-in temperature-
compensated crystal oscillator (TCXO) which provides precise timekeeping even in varying
environmental conditions. The DS3231 offers a high degree of accuracy, typically within a
few seconds per month, making it suitable for applications where precise timing is crucial.
Its low power consumption and battery backup capability ensure reliable operation even in
the absence of external power. With its small form factor and I2C interface, the DS3231
sensor is widely used in various IoT, medical, and industrial applications where accurate
timekeeping is essential.
Pins:
1. SDA: SDA stands for Serial Data Line. It is used for bidirectional data transfer
between the DS3231 module and the microcontroller through I²C (Inter-Integrated
Circuit) communication protocol.
2. SCL: SCL stands for Serial Clock Line. It is used to synchronize data transfer
between the DS3231 module and the microcontroller during I²C communication.

Fig 3.4 RTC DS3231

11
MAX30102 Pulse Oximeter Sensor:
The sensor is integrated pulse oximetry and heart-rate monitor sensor solution. It combines
two LED’s, a photodetector, optimized optics, and low-noise analog signal processing to
detect pulse and heart-rate signals. It operates from 1.8V and 3.3V power supplies and can
be powered down through software with negligible standby current, permitting the power
supply to remain connected at all times.

Fig 3.5 MAX30102 Pulse Oximeter Sensor


Features of MAX30102 Pulse Oximeter
1. Consumes very low power (operates from 1.8V and 3.3V)
2. Ultra-Low Shutdown Current (0.7µA, typ)
3. Fast Data Output Capability
WORKING OF MAX30102 PULSE OXMITER
The device has two LEDs, one emitting red light, another emitting infrared light. For pulse
rate, only the infrared light is needed. Both the red light and infrared light is used to measure
oxygen levels in the blood.
When the heart pumps blood, there is an increase in oxygenated blood as a result of having
more blood. As the heart relaxes, the volume of oxygenated blood also decreases. By
knowing the time between the increase and decrease of oxygenated blood, the pulse
rate is determined.
It turns out, oxygenated blood absorbs more infrared light and passes more red light while
deoxygenated blood absorbs red light and passes more infrared light. This is the main
function of the MAX30100: it reads the absorption levels for both light sources and stored
them in a buffer that can be read via I2C.

12
Fig 3.6 Working of MAX30102
As we have discussed earlier the max30102 sensor consists of a Red LED and an IR LED
and a photodetector respectively. The wavelength of the RED Led is 660 nm and the
wavelength of the IR Led is 880nm.
The MAX30102 Sensor shines both the light through the skin and measures the reflection
with the photodetector. This method of pulse detection through light is called
Photoplethysmogram. The working of the sensor can be divided into two parts one is heart
rate measurement and another is blood oxygen level measurement.
The oxygen in the hemoglobin has a specific characteristic, that it can absorb IR light. When
the concentration of hemoglobin is more, the redder the blood. Which simply means it can
absorve more IR light. As the blood is pumped through the veins in the finger the amount of
reflected light changes creating an oscillating waveform. And by measuring this wave we
can get the heartbeat reading. Blood oxygen level measurement works on the principle that
Red and IR light varies depending upon the oxygen level in your blood. Deoxygenated blood
absorbs more RED light while blood with more sufficient oxygen absorbs more IR light. By
measuring the ratio between two we can measure oxygen level.
Buzzer:
A buzzer is a device that produces a buzzing or humming sound. It is typically used as an
alert or warning signal in various electronic devices, appliances, and systems. Buzzer
circuits often consist of an electromechanical or piezoelectric transducer that converts
electrical energy into mechanical vibrations, creating sound waves. Buzzer sound can vary
in frequency, intensity, and duration depending on its design and application. Common uses
of buzzers include in alarm clocks, timers, doorbells, electronic games, and industrial
machinery to indicate various events or conditions. They are simple yet effective
components widely employed for auditory notification purposes.

13
Fig 3.7 Buzzer
In an IoT-based pill dispenser, a buzzer serves multiple functions. It reminds users to take
their medication, alerts them to errors or low medication levels, and confirms successful
dispensing. Integrated into the IoT system, the buzzer is triggered by software based on
predefined conditions, enhancing usability and effectiveness.
LED’s:
In an IoT-based pill dispenser, LEDs play crucial roles in enhancing functionality and user
interaction. They serve as status indicators, confirming successful medication dispensing,
signaling errors or low medication levels, and providing feedback on user interactions.
Additionally, LEDs can indicate connectivity status, battery levels, and serve as part of the
user interface. Integrated into the dispenser's design, LEDs offer visual cues that
complement other alerts and notifications, contributing to a seamless and user-friendly
experience.

Fig 3.8 LED’s


Servo motor:
A servo motor is a highly precise motor used for controlling angular or linear position, speed,
and acceleration. Its design integrates a motor, position sensor, and control system, enabling
accurate movement. Servo motors excel in applications demanding precision, such as
robotics, CNC machines, and 3D printers. They operate in a closed-loop control system,
continuously adjusting based on real-time feedback to maintain desired positions or
velocities. With their high torque output relative to size, servo motors offer both power and
precision, making them versatile across industries including manufacturing, aerospace, and

14
automation. Available in various types including DC, AC, and brushless DC, servo motors
are indispensable for applications requiring reliable and accurate motion control.

Fig 3.9 Servo Motor


In a pill dispenser, a servo motor plays a critical role in accurately dispensing medication.
By connecting the servo motor to the dispensing mechanism, the dispenser can precisely
control the release of pills, ensuring the correct dosage is administered each time. This level
of precision is particularly important for individuals who rely on strict medication schedules.
Additionally, the servo motor can be integrated with IoT technology to enable remote
monitoring and scheduling of medication dispensing, enhancing convenience and adherence
to medication regimens. With its ability to provide reliable and customizable dosage control,
the servo motor significantly improves the functionality and effectiveness of the pill
dispenser, ultimately contributing to better patient outcomes and medication management.
IR sensor:
In a pill dispenser, an IR (Infrared) sensor serves as a valuable component for various
functionalities:
The IR sensor can be strategically placed within the dispenser to detect the presence of a
user's hand or container when it's placed near the dispenser, initiating the dispensing process.
This touchless interaction ensures hygiene and convenience, especially for individuals with
limited mobility or dexterity.
Additionally, IR sensors can be utilized to verify the correct dispensing of medication. By
installing sensors at key points along the dispensing mechanism, the system can confirm
whether pills have been successfully dispensed into the designated container. This feedback
mechanism helps prevent errors and ensures the accurate administration of medication.
Furthermore, IR sensors can contribute to the safety of the pill dispenser by detecting any
obstructions or blockages in the dispensing pathway. If the sensor detects an obstacle, it can
trigger an alert to notify the user or caregiver, preventing potential malfunctions or accidents.

15
Fig 3.10 IR sensor
Moreover, integrating IR sensors into an IoT-enabled pill dispenser allows for remote
monitoring and management of medication usage. The sensors can transmit data regarding
dispensing events, medication levels, and user interactions to a central system or smartphone
application. This real-time monitoring capability enhances medication adherence and
enables timely intervention if issues arise.
Overall, IR sensors play a crucial role in enhancing the functionality, safety, and user
experience of pill dispensers by enabling touchless interaction, verifying dispensing
accuracy, detecting obstructions, and facilitating remote monitoring. Their integration
empowers individuals to manage their medication effectively while ensuring convenience,
reliability, and peace of mind.

Fig 3.112Block Diagram of System

16
Chapter 4
Working
To develop the IoT-based pill dispenser system, we employ Arduino and ESP32
microcontroller boards for robust hardware integration. Arduino serves as the primary
controller for managing the pill dispensing mechanism and interfacing with peripheral
devices. ESP32, known for its versatility and built-in Wi-Fi capabilities, acts as the bridge
between the hardware components and the Blynk mobile application for remote control and
monitoring. The Arduino board controls the servo motor responsible for pill dispensing and
interfaces with sensors such as the MAX30102 for health monitoring. Concurrently, ESP32
facilitates seamless communication with the Blynk app, enabling users to schedule pill
intake times, set dosages, monitor health parameters, and access security features remotely.
By leveraging Arduino and ESP32, we ensure efficient coordination between hardware
components and mobile connectivity, enhancing the functionality and usability of the IoT-
based pill dispenser system.
4.1 Hardware Setup:
To construct the hardware infrastructure, we integrate a combination of Arduino and ESP32
microcontroller boards, leveraging their respective strengths for seamless operation.
Beginning with the Arduino, it serves as the central hub for managing the core functionalities
of the pill dispenser system. We connect the servo motor, responsible for precise pill
dispensing, directly to the Arduino board. Through Arduino's GPIO pins, we ensure efficient
control over the motor's movements, facilitating accurate dispensing according to the
scheduled dosage regimen.
For health monitoring capabilities, we employ the MAX30102 sensor, which we interface
with the ESP32 microcontroller. This sensor, renowned for its accuracy in measuring heart
rate and blood oxygen saturation levels, is crucial for real-time health assessment. By
establishing a connection between the MAX30102 sensor and the ESP32, we enable
continuous monitoring of vital signs, providing invaluable insights into the patient's well-
being.

17
Fig 4.1 Integration of ESP32 with MAX30102
Incorporating security features into the system, we integrate the ESP32-CAM module for
video surveillance and enhanced security measures. With its built-in camera functionality,
the ESP32-CAM facilitates real-time video monitoring, enabling users to remotely monitor
the medication area for any unauthorized access or suspicious activities. This added layer of
security ensures the safety and integrity of the medication supply, offering peace of mind to
both patients and caregivers.
Expanding upon the hardware setup, we augment the ESP32 microcontroller with additional
components for improved user interaction and pill outage reminders. By connecting a buzzer
and LED indicators to the ESP32, we enable audible and visual alerts to notify users of
upcoming pill intake times and any potential medication shortages. Through programmable
logic, the ESP32 can trigger these alerts based on preset schedules or in response to real-
time data from the pill dispenser system. This proactive approach not only enhances
medication adherence but also minimizes the risk of missed doses or medication errors,
ultimately promoting better health outcomes for patients.
4.2 Blynk App Configuration:
To kickstart the project in the Blynk app, we create a new project and retrieve the
authentication token, which enables communication between the app and the ESP32
microcontroller. We then integrate essential widgets for scheduling pills, including options
for setting time and dosage. Additionally, we include widgets for monitoring health
parameters, allowing users to track vital signs such as heart rate and blood oxygen saturation
levels in real-time. Lastly, we add widgets for accessing security features, enabling remote
surveillance of the medication area through live video feeds captured by the ESP32-CAM
module. Through these widgets, users can efficiently manage medication adherence,
monitor health metrics, and ensure the security of the system, all from within the intuitive
interface of the Blynk app.

18
Fig 4.2 Blynk app dashboard
We will get the authorization token that should be noted and keep in the arduino ide then
map them with the pins.

Fig 4.3 Blynk AUTH Token


4.3 Arduino IDE
Through the inclusion of essential libraries such as WiFi.h, BlynkSimpleEsp32.h, and
Servo.h, the code establishes Wi-Fi connectivity, integrates with the Blynk app, and enables
control over the servo motor responsible for dispensing medication. Within the Blynk
integration aspect, authentication tokens obtained from the Blynk app facilitate
communication between the ESP32 and the Blynk server, while virtual pins are designated

19
to receive user input for scheduling medication doses, setting dosage amounts, and accessing
health monitoring features.
Furthermore, the code encompasses functionalities to interface with the MAX30102 sensor
for monitoring vital signs such as heart rate and blood oxygen saturation levels. Data
collected from the sensor is processed and seamlessly transmitted to the Blynk app, enabling
real-time monitoring by users or caregivers. To ensure timely medication adherence, the
code incorporates an alarm and notification system, triggering alerts to remind patients of
scheduled medication intake times. Instant notifications are dispatched to caregivers through
the Blynk app when medication is due, facilitating prompt assistance and supervision.
4.4 Health monitoring
The Max30102 sensor gives the spo2 and the BPM data in the blynk app and the Thingspeak
in the graphical representation.

Fig 4.4 Output of MAX30102 Sensor


The IoT-based pill dispenser system integrates seamlessly with the MAX30102 sensor,
ESP32-CAM, and Blynk app to provide comprehensive medication management and
monitoring functionalities. Upon initialization, the ESP32 microcontroller establishes
connectivity with the Blynk app, facilitated by the inclusion of essential libraries such as
WiFi.h and BlynkSimpleEsp32.h. Through the Blynk app interface, users can schedule
medication doses, adjust dosage settings, and monitor vital signs in real-time using
designated virtual pins.

20
When a medication dose is due, the ESP32 activates the servo motor to dispense the
prescribed dosage from the pill dispenser mechanism. Simultaneously, the ESP32 interacts
with the MAX30102 sensor to collect vital signs data, including heart rate and blood oxygen
saturation levels. This data is transmitted to the Blynk app, allowing users and caregivers to
monitor the patient's health status remotely.
To ensure timely medication adherence, the system incorporates an alarm and notification
system. When it's time for medication intake, the Blynk app sends notifications to the user's
device, alerting them to take their medication. Additionally, caregivers receive alerts through
the app, enabling them to provide timely assistance if needed.
Moreover, the integration of the ESP32-CAM module enhances security by enabling remote
surveillance of the medication area. Users can monitor the dispensing process and ensure
the integrity of the medication supply through live video feeds streamed directly to the Blynk
app.
By leveraging these advanced technologies, the IoT-based pill dispenser system not only
simplifies medication management but also promotes patient autonomy and safety. With its
intuitive user interface and real-time monitoring capabilities, the system provides invaluable
support to both patients and caregivers, ensuring adherence to medication schedules and
enhancing overall healthcare outcomes.

21
Conclusions
In conclusion, the development and implementation of IoT-based solutions for medication
management represent a significant step forward in addressing the challenges faced by
individuals, especially the elderly and those with chronic illnesses, in adhering to their
medication regimens. Through the utilization of technologies such as smart medicine
dispensers, we have the potential to greatly improve medication adherence rates and reduce
the occurrence of medication errors. By leveraging features such as alarms, real-time
monitoring, and caregiver alerts, these systems promote self-reliance among patients while
providing valuable support to caregivers. Additionally, the integration of IoT technology
facilitates remote monitoring and management, offering convenience and peace of mind to
both patients and caregivers. Moving forward, continued research and development in this
field hold promise for further advancements in home healthcare, ultimately leading to
improved health outcomes and enhanced quality of life for individuals worldwide.

22
Future Scope
• Integration with Wearable Health Devices: Incorporating wearable devices such as
fitness trackers and smartwatches to collect real-time health data for better
monitoring and analysis.
• Expansion of Remote Monitoring Capabilities: Enhancing systems to remotely
monitor patients' health conditions, enabling healthcare professionals to provide
timely interventions and support.
• Exploration of Voice-Activated Interfaces: Investigating the use of voice-activated
interfaces for hands-free operation of healthcare applications, facilitating easier
access to information for users.
• Incorporation of Biometric Authentication: Implementing biometric authentication
methods such as fingerprint or facial recognition to ensure secure access to sensitive
health data and applications.
• Expansion into Global Healthcare Markets: Scaling operations and services to reach
healthcare markets worldwide, addressing diverse needs and challenges across
different regions.
• Partnerships with Pharmaceutical Companies: Forming strategic partnerships with
pharmaceutical firms to leverage expertise and resources for developing innovative
healthcare solutions and improving patient outcomes.

23
References
1. Guerrero Ulloa, Gleiston & Hornos, Miguel & Rodríguez-Domínguez, Carlos &
Fernández-Coello, Ma. (2020). IoT-Based Smart Medicine Dispenser to Control and
Supervise Medication Intake. 10.3233/AISE200021.
2. Patil, Chandrashekhar & Lightwala, Nakia & Sherdiwala, Mehul & Vibhute, Amol
& Naik, Sachin & Mali, Shankar. (2022). An IoT based Smart Medicine Dispenser
Model for Healthcare. 391-395. 10.1109/AIC55036.2022.9848934.
3. Dayananda, P., Upadhya, A.G. Development of Smart Pill Expert System Based on
IoT. J. Inst. Eng. India Ser. B (2024).
4. 1. J. E. P. Reddy, Dr. A. Chavan, AI-IOT based smart pill expert system, 2022 4th
International Conference on Trends in Electronicsand Informatics (ICOEI), 2022, in
press
5. Singh U, Sharad A, Kumar P. (2019)IoMT Based Pill Dispensing System. In: 2019
10th International Conference on Computing, Communication and Networking
Technologies, ICCCNT 2019; jul 6-8; Kampur, India, India. IEEE. p. 1–5.
6. Guerrero-Ulloa G, Rodr´ıguez-Dom´ınguez C, Hornos MJ. (2019) IoT-Based
System to Help Care for Dependent Elderly. In: Botto-Tobar M, Pizarro G, Zu´niga-
Prieto M, D’Armas M, Z ˜ u´niga S ˜ anchez M., editors. ´ Communications in
Computer and Information Science. Springer, Cham;. p. 41– 55. 8.
7. Jaipriya S, Aishwarya R, Akash NB, Jeyadevi AP. An intelligent medical box
remotely controlled by doctor. In: Proceedings of the International Conference on
Intelligent Sustainable Systems, ICISS 2019. 2019 Feb 21-22; Palladam, Tamilnadu,
India, India. IEEE. p. 565–9.

24

You might also like