You are on page 1of 65

DIGITAL MEDICINE BOX WITH SMART APP

SUBMISSION DATE: 25.03.2018

SUBMITTED BY:

Tonuruha Ameen (12301002)


Department of Computer Science and Engineering

SUPERVISOR:

Dr. Amitabha Chakrabarty


Assistant Professor
Department of Computer Science and Engineering
Declaration
I, hereby declare that this thesis is based on results I have found myself. Materials of
work from researchers conducted by others are mentioned in references.

Signature of Supervisor Signature of Authors

Amitabha Chakrabarty, Ph.D Tonuruha Ameen (12301002)


Assistant Professor
Department of Computer Science and Engineering
BRAC University

i
Abstract
The idea of this thesis Digital Medicine Box With Smart Application has been de-
veloped to check various kinds of healthcare issues that occurs because of people being
ignorant or forgetful about their health and also because of the limited knowledge they
have about their health and proper medications. This project consists of two parts -
hardware and software to support the users in all possible ways in maintaining a healthy
life. The hardware part is a device consisting of a few customized boxes which keeps the
medicine safe and stores all the information such as, the dose, expiry date, refill date,
etc. about the medicine it contains and notifies the patient or user according to their pre-
scription. The device partially functions with a very user friendly android application via
WIFI that has a lot of important and unique features which will have a big contribution
to the daily health care of the people using it. This application, along with the device,
together guarantees to ease up all the critical issues regarding the regular medication and
also ensures to help maintain a healthy life for both normal and vulnerable people. The
idea is to design the device in such a way that is lightweight, handy and easily accessible
for people of all ages which can take the global medication system easier and in a more
advance level.

ii
Acknowledgment
After a rigorous period of three semesters, today is the day; writing this note of appre-
ciation is the finishing touch on my thesis. It has been a period of vigorous learning for
me, not only in the scientific arena, but also on a personal level. On this very day, I would
like to reflect on the people who have supported and helped me so much throughout this
period.

First of all, I would like to thank the Almighty for making a way for me through the
rough world. Without His help I would never have existed in this universe.

Secondly, I would like to express my sincere gratitude to our adviser Amitabha Chakrabarty
for believing in me with the project, supporting me endlessly, for his patience, motivation,
and in-depth knowledge which have guided me towards our destination. He has definitely
provided me with the correct path that I needed to choose for the right direction and suc-
cessfully complete my thesis. His doors were always opened for me whenever I needed him.

We would also like to thank my parents who were always there for me and helping
me for achieving this tremendous goal. Their constant and tireless support, both morally
and intellectually; have been one of the key factors of our achievement. Without all their
help, I would not be on the verge of graduation.

iii
Contents

1 Introduction 1
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Scope of the Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.6 Future possibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.7 Thesis Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2 Background Study 9
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Requirement Engineering . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3 Literature Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3 Specifications 14
3.1 Hardware Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.1.1 Raspberry Pi 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.1.2 Weighing Sensor 24 Bit HX711 Dual-Channel . . . . . . . . . . . 15
3.1.3 Load Cell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.1.4 ADC - MCP3008 Chip . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1.5 LCD Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.1.6 Breadboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.1.7 LED Lights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.1.8 Push Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.1.9 Resistors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.1.10 Connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

iv
3.1.11 Power Bank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.2 Software and Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.3 Design Decisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

4 Implementation and Results 25


4.1 System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.1.1 Use Case Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.1.2 Schematics Diagram . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.1.3 Design Illustrations . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.2 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2.1 The Base Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2.2 Medicine Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2.3 Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.2.4 LED Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.2.5 Weight Sensor & Load Cell . . . . . . . . . . . . . . . . . . . . . 33
4.2.6 Buzzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.2.7 LCD Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.2.8 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.3 Mobile Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.3.1 Basic Application Flow . . . . . . . . . . . . . . . . . . . . . . . . 36
4.3.2 Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.4 Raspberry Pi Development . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.5 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

5 Conclusion 53
5.1 Effectiveness of the System . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.3 Proposed Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

6 Reference 56

v
List of Figures

2.1 Reasons for low medication adherence.[1] . . . . . . . . . . . . . . . . . . 12

3.1 Raspberry Pi 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 Weighing Sensor HX711 . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3 Load Cell (1KG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.4 MCP3008 Chip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.5 MCP3008 Pin Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.6 LCD Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.7 Breadboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.8 LED Lights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.9 Push Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.10 Resistors (1K) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.11 Different types of jumper wires . . . . . . . . . . . . . . . . . . . . . . . 22
3.12 Power Bank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.13 Software and libraries used . . . . . . . . . . . . . . . . . . . . . . . . . . 24

4.1 Use Case Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26


4.2 Schematics Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.3 Inside view of the system . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.4 Time vs Voltage Graph of Power Supply . . . . . . . . . . . . . . . . . . 31
4.5 LED Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.6 Weight sensor & Load cell side view . . . . . . . . . . . . . . . . . . . . . 33
4.7 Digital Buzzer Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.8 Final device top view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.9 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.10 Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

vi
4.11 Medicine Box Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.12 Health Comparison Page . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.13 Diet Advice Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.14 Appointments Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.15 Prescriptions Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.16 Reports Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.17 Doctors Directory Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.18 Nearby Health Centers Page . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.19 Flowchart of the Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.20 Raspberry Pi Pinout Diagram . . . . . . . . . . . . . . . . . . . . . . . . 51

vii
CHAPTER 1
Introduction

Here, a formal introduction of the thesis will be presented. It will give a clear idea
about the systems overview, motivation, scope features, objectives and future work in
different subsections.

1.1 Overview
In today’s world, people seem to have become so busy with their work and surround-
ings that, they often forget when to take their most essential dose of the prescribed
medication. Parents often miss the time of their children’s medication. Elderly people,
because of their age, typically forget to take their drugs. Millions of people misuse or
forget to take their prescription medication each year, resulting in higher health care cost,
prolonged illness, and deaths [1].

When it comes to prescribed drugs, patients are usually reluctant to follow doctor’s
orders. The numbers and impact are alarming: It has been shown in a research that
nearly 25 percent of patients who are prescribed of medications for a newly diagnosed
chronic illness, fail to maintain their initial prescription. In addition, half of patients
taking maintenance medications for chronic conditions will stop taking them within the
first year of their treatment. This situation puts patients at risk and costs the healthcare
system billions of dollars in unnecessary care and treatment. While prescription drug
abuse are often in the headlines, nearly two-thirds of Americans who take medication
are non-adherent, which means they do not take their medication properly. Whether

1
intentional or not, the problem is rampant and causes an estimated 125,000 needless
deaths every year [1].

A major push for medication adherence could turn that around.

Such concept made live to this model. A lot of hardware tools and software methods
were used to come up with the possible solution which is thought to be light weight
model.

1.2 Motivation
For nearly half of adults in the U.S. with a chronic condition,[8] prescription medica-
tion is one of the most common medication interventions. Unfortunately, with different
schedules of doses, potential interactions, instructions, and side effects to track, it isn’t
always easy to take medications as prescribed.[7]

A study by the Brigham and Women’s team, published in the January 2014 Ameri-
can Heart Journal, adds to the growing body of evidence that adherence to medication
improves outcomes. Heart attack patients who took their medication regularly were less
likely than other patients to suffer from another heart attack, stroke, congestive heart
failure or unstable angina, during the next six months of follow-up.[1]

Once the diagnosis has been made and the prescription written, following doctor’s
instructions becomes the next challenge for many people. The Brigham and Women’s
team says providers should explore options to make adherence simpler and easier, such
as simplifying regimens and using tools and communications to remind and motivate pa-
tients to take their medications. Interventions that promote adherence may significantly
improve patient outcomes and help alleviate our health care crisis.[7]

To better understand what people find most difficult about dealing with their med-
ications and what might make it easier, a national poll was conducted by CVS Health,
of 2,041 adults who either have a chronic condition or are taking five or more prescrip-
tion medications. The results shed light on what types of future pharmacy offerings and
programs may help patients most.

2
Medication Management is a Challenge Especially Sticking to a Dosing
Schedule Overall, keeping to a dosing schedule is by far the most common challenge
for those prescribed with multiple medications. Sixty-nine percent of respondents say
they find this to be a challenge, and 39 percent say it is the most challenging part about
managing their medications.[7]

Other common concerns include refilling prescriptions on time (54 percent) and un-
derstanding and avoiding drug interactions (47 percent). Additionally, four in 10 people
find it challenging to understand when and how to take medications.

Patients See Promise in Tools that Add Convenience and Clarity


Two-thirds of respondents said phone, text, email or any sort of reminders to take,
refill and/or renew prescriptions would be helpful in addressing their medication manage-
ment challenges. And 61 percent reported that a personalized daily schedule with clear
instructions for when, and at what dose, to take medications would be helpful.

Recognizing that managing multiple medication can be difficult, introducing a system


that can help patients with multiple medications, keep track of all their prescription
information in one place, including which medications the patient takes, when the patient
should take them, and how much of each medication should be taken in each dose and
also make it easier for patients to refill prescriptions on time, was the prime motivation.

It has been a very tough job to come up with a suitable and cost effective solution
as the entire work seemed very simple but was very complex. The tremendous amount
of advancing technology in the electrical side has motivated me to come with a cost
effective and advanced solution of developing a system that will help patients with their
medications. The challenge was to simplify the complications a patients faced as much
as possible so that everyone is able to use it, regardless of a patient’s age, ability or
disability. The main challenge was to find out all the needs a vulnerable patient required
and put them into one system.

3
1.3 Scope of the Thesis
The thesis deals with the development of a system that will help a patient or a person
in any medical vulnerability by means of providing them constant reminders of medicines,
reminders about medicine refills and providing assistance/reminder with other health
related issues. Besides, it will also give regular reminders about doctor’s appointments
and medical health checkups. The prescriptions and medical reports of the user will be
available at any time to be used or can be of great help in case of an emergency.

The aim of this project is to remind those vulnerable individuals who forget to take
their medicines on time. This system will remind the patient to take his/her medicinal
drug at prescribed time. The proposed system is best suited for elderly persons and those
who’re very busy, as this device will remind them of their drug treatments with a buzzer
sound and also shows the name of the medication to be taken at that time. The patient
can store the respective dose timings, quantity and the name of dose by means of the
mobile application installed in his or her mobile phone. Even If the patient does not
use a mobile phone, the device can be configured with the necessary information at any
nearby pharmacy.

This system can also be useful in hospital where large number of patients is present
and sometimes it is difficult to remember the medicine and dosage by the staff. So
this system with some updates can also be used in hospitals. The problem such as 1)
maintaining the regularity of prescribed dosage is difficult to be remembered in busy
schedule 2) remembering the name of medicine to be taken is really difficult 3) due to
above two reasons the patient’s life can get more complicated. These above problems are
arising to everyone due to non-adherence of medications. Therefore, there is a growing
need and urgency for in-home health care devices and technologies in order to provide
patients with the electronic tools to support medication self-management.

1.4 Features
The developed system is able to do the following jobs:

4
1. Stores the routines of doses, tracks quantity and expiry dates and gives
reminders accordingly (for both tablets and syrup). This is of great help to
the people who forget their medication and similarly, forget to refill their medica-
tion and forget to replace the expired medicines. The user will experience the full
medication management experience with user friendly interface that makes it easy
to keep all medication requirements in one place.

2. Stores doctor’s appointments and reminds accordingly. Sends all the


notifications both to the smart phone and device. This provides reminder
on both the mobile screen of the patient and also on the device by means of blinking
lights and buzzer notifying any upcoming important appointment with a doctor or
an emergency medical checkup. One will never again forget about any upcoming
doctor appointments with the comprehensive appointment manager synced with the
calendar that keeps track of all appointment information and alerts any upcoming
appointments.

3. Stores virtual prescriptions and test reports that can be updated. This
ensures that all the medical reports and prescriptions are easily accessible at all-
time, whenever a patient requires it in an emergency situation. It can also be easily
updated so that all the information is up to date at all time. Presenting medical
progress reports to the doctor instantly.

4. Compares health conditions based on the report updates with health


charts. Depending on previous and recent health reports, the system tells the
user about his current health status compared to his previous condition and thus
suggests the user accordingly what step to be taken to normalize the his condition.

5. Gives current and future health predictions based on the changes and
symptoms. Predicts the probable health issue or illness based on multiple ques-
tionnaires about current symptoms and observing the patient’s reports. Based on
same criteria, this feature can provide future health predictions on what might
happen and whether or not to consult a doctor.

6. Stores food limitation chart and gives diet advice on daily basis. Based on
current health and bodily conditions, it will provide daily food charts depending on

5
the current health status and also provide regular advice on how to remain healthy.

7. Shows the list of nearby pharmacies, clinics, hospitals. Based on current


location of the patient, the mobile application shows the list of all the hospitals,
pharmacies, clinics or any health centers nearby. Thus, in any sort of emergency, a
patient will know where to go or others will know where to take the patient.

8. Stores all the information of the doctors needed (Name, location, spe-
cialty, visiting hours etc.). The system stores and provides categorized list of
doctors in terms of the doctor’s specialty, location and expertise. The name and
address of the desired doctor will be provide, which, anyone can suggest to his or
her close ones.

9. Shows current state of battery. The mobile application the current battery
status of the device so that the user can change the batteries or recharge it to
ensure continuous service.

1.5 Objectives
In this thesis, the main objectives are listed as follows:

• Constructing a device that is relatively small and lightweight.

• Developing a mobile application in such a way that patients receive their medication.
reliably and safely as prescribed by their physicians.

• Hassle free configuration of the device through the mobile application.

• Saving time of both doctors and patients.

• Making it easier to locate nearby health centers for the newcomers having a slim
idea about locations.

• Creating awareness among the people who often neglect any inconvenience related
to health

• Keeping people up to date about their daily health conditions which can contribute
to prevent diseases.

6
• Helping people, specially from a weak educational background to keep pace with
modern health researches and medication that the lack of.

1.6 Future possibilities


1. Increasing scope by pathfinder

• People who are mentally and physically fit can only enjoy all the features of
this developed system. So, the main scope is to develop this system in such a
way so that it can help people who are mentally or physically challenged.

• The developed system can be collaborated with a pathfinder of some sort so


that when it is time, the device will itself find its way to the specific person.

2. Reducing documents by introducing OCR

• The mobile application can be updated with OCR system.

• It can be trained to precisely understand a doctors handwriting over time and


after scanning any doctor’s handwritten prescription or report, it will store
the prescription or report in digital text format which will be much easier to
understand by patients.

3. Cloud based multi-end application

• The mobile application can be developed and made cloud based.

• Doctor’s version of the application can be developed so that doctors can access
their patient’s data easily and follow up easily with their patients on a regular
basis.

• Doctors will be able to update their status on their availability and patients
will be able to use this information and set appointments with the doctor or
their assistants.

• Doctors will also be reminded of their appointments on a regular basis so that


they don’t miss the diagnosis of any patient and to ensure that no patient is
left untreated.

• The system can further be developed as such that it can be involved with all
the Hospitals, Clinics or any Health Centers.

7
• Patients can fill up hospital forms and book beds or cabins in advance and
pay their medical bills.

1.7 Thesis Outline


The rest of this report is structured as stated below:

• Chapter 2 covers the prerequisite knowledge required build the whole system and
construct prototype.

• Chapter 3 focuses on overall system design along with design decisions.

• Chapter 4 covers the implementation of the system and describes all the steps in
details.

• Chapter 5 explains testing process and discuss about the know limitations of the
device.

• Chapter 6 summarize the whole thesis and discuss the effectiveness of the system.

8
CHAPTER 2
Background Study

This chapter is all about how the initial information was gathered, some history, data
etc, the study of this project which covers a review on the engineering required and
literature review which states how the general ideas of implementing the system were
generated.

2.1 Introduction
Nowadays people move at a fast pace and people start to feel the pressure on their
bodies. Diseases are popping up everywhere to attacking a weakened body. To prevent
these, people have to take some prescribed medicines on a regular basis. Taking regular
medicines is also a major part of a recovery process of human body after an accident or
during an illness. Some might even need to take some regular calcium or vitamins in order
to stay healthy. Here comes the part when people often forget to take their medicines or
face some serious irregularities. My proposed Digital Medicine Box with Smart App will
never let you miss your medication again. It will make sure that they are taking regular
medications on time. It will notify whenever it’s time to take a prescribed medicine.

2.2 Requirement Engineering


To understand the need of a Digital Medicine Box, its needed to understand what
the patients really need and their mentality. The main problem here is forgetfulness.
So, the plan is to build something that will remind the patient in different ways. The

9
notifications on mobile device or beeping sound may not be enough, since they can easily
miss it or ignore it completely for lack of attention. So, its needed to think about a
different approach that can make sure the patient will never miss the daily medicines.
The only person that will care more about the patient other than the patient himself is
the close family members like son, daughter, spouse etc.

An SMS notification will be sent to the patient’s family member that the patient have
a dose of medicine to take right now. This will make the family member to come to
the patient and take the pill out of box and help him take it. If the family member is
away from the patient, at least, he can call the patient and kindly ask him to take the
medicine. Not only this will make sure that the patient take the medicine, but also make
the family bond stronger.

2.3 Literature Review


While designing and planning for this thesis, several papers had been gone through to
make it possible as it was very challenging to complete the job with a limited knowledge.
Several online articles discussed about the hazards and problems people are facing now a
days regarding their medication. One thing that was evident in these writings was that,
following the doctor’s prescriptions timely has become a big challenge for people now a
days.

Medication adherence is defined by the World Health Organization as ”the degree


to which the person’s behavior corresponds with the agreed recommendations from a
health care provider.”[2] Poor adherence to prescribed medication can result in serious
health hazards. For instance, a recent study has found that the risk of hospitalization in
patients, with diabetes mellitus, hypercholesterolemia, hypertension, or congestive heart
failure who were non adherent to prescribed therapies was more than double compared
with the general population.[3]

Rates of non-adherence vary widely and can be very high, even in the tightly con-
trolled and monitored environment of a clinical trial. Multiple factors contribute to
non-adherence. For instance, patients with chronic conditions are less likely to follow
prescription orders than those with acute conditions.[4]

10
The effectiveness of a therapy or treatment directly depends upon a patient’s abil-
ity and willingness to follow a prescribed regimen. The patient’s ability to read and
understand medication instructions is a key factor.[5] Patients with low literacy face dif-
ficulties in understanding the instructions in a prescription which ultimately results in
decreased adherence and poor medication management and consumption. Issues of low
literacy must be recognized and strategies designed with this limitation in consideration.
A patient with heart failure who does not take his or her prescribed medication or forget
to have their medicine, costs the U.S. health care system an average of almost $8,000
annually, according to a 2011 analysis published in Health Affairs. The figures are high
for other illnesses too almost $4,000 per patient with high blood pressure, over $3,700
per patient with diabetes and about $1,200 per patient with high cholesterol.[1]

Dr. Brennan and a team of researchers at Brigham and Women’s Hospital, in Boston,
have been studying this issue since 2010 by analyzing pharmaceutical insurance claims
data. They’ve pinpointed several reasons patients don’t take their medicine and among
those, one of them is:

There is a high degree of complexity for patients taking multiple drugs for a vari-
ety of conditions. There are currently around 80 million U.S. residents with multiple
chronic conditions and several medications to manage. Patients who have a number of
prescriptions are less likely to take their medications as prescribed because they may
have difficulty managing a schedule that involves taking several different medications at
various times throughout the day.[1]

11
Figure 2.1: Reasons for low medication adherence.[1]

”If we can get people to take their medications, they’ll have fewer heart attacks, they
won’t develop complications associated with diabetes and they won’t be going to the
emergency department with asthma” says Dr. Troyen Brennan, executive vice president
and chief medical officer of CVS Caremark. In simple words and in a more general way,
it can be stated that, all the health related problems faced due to missing a dose of
medication can be avoided, if it is, somehow ensured that a patient is consuming his or
her prescribed medication on time and also that he or she doesn’t miss any single dose.

Missed health care or doctor’s appointments, now a days, have become another consid-
erable issue. Increased cost of care delivery, under utilization of equipment and personnel,
reduced appointment availability, reduced patient satisfaction and negative relationships
between patients and staffs are the main consequences of a non-attendance to an appoint-
ment. Delay occurs in presenting health conditions to the doctors as a result of this; and
thus lack of follow-up of chronic conditions ultimately lead to complications, unnecessary
suffering and costly hospital admission.[10]

To be more specific, people are reluctant when it comes to following prescribed


medicines. Beverly Merz, a Boston-based freelance medical writer and editor, stated
in one of his write-ups that nearly 25 percent of the patients suffering from any chronic

12
illness are likely to not be able to fill their initial prescription and half of patients taking
maintenance medications for any long term illness will stop taking them within the first
year. These cause large numbers of unusual or unexpected deaths and also costs the
health care system billions of dollars in unnecessary care.[1] The issue with consuming
timely medicine is either be intentional or unintentional but in both cases the outcome is
harmful. ”If we can get people to take their medications, they’ll have fewer heart attacks,
they won’t develop complications associated with diabetes and they won’t be going to the
emergency department with asthma” said Dr. Troyen Brennan, executive vice president
and chief medical officer of CVS Caremark. In addition to improving patient’s outcomes,
Brennan says, medication adherence will reduce health care costs associated with these
conditions.

In a write up by CVS Health, where they had conducted a national poll of 2,041 adults,
it was projected what types of health or medication related assistance they preferred and
that what would benefit them by how much. In the results, majority of them said they
faced challenges regarding their daily doses of medicine and that they see promise in tools
that provides them a notification or reminder about their medications.

Surender, Niharika, Rohit, Bharat and Narayana mentioned in their paper that elderly
people face challenges in remembering their timely medicines. So, a developed system
that would not only remind them of their drugs timely but also display the medication
to be taken at that time.[9] This paper was helpful to know about a similar system and
got a basic idea on how the medicine box can be constructed.

At the end of this chapter it will be stated clearly that necessary knowledge has been
gathered to design and implement a effective Smart Medicine Box. So the next chapter
will cover the design part of this project.

13
CHAPTER 3
Specifications

This chapter focuses on the specifications that include the hardware specification part,
the software specification, the libraries chosen and the decisions involved in designing the
system. This entire chapter includes the necessary things that was used to complete the
project.

3.1 Hardware Specifications


In this thesis project, a large portion of the work goes to build the hardware part.
Because, if the hardware is stable, then the device will run smoothly. So, only the
suitable and suitable and convenient components from a large list of components were
implemented. Raspberry Pi 3, Weighing Sensor 24 Bit HX711 Dual-Channel, Load Cell,
ADC - MCP3008-I/P, LCD Display, Breadboard, Buzzer, LED Lights, Push Switch,
Resistors, Jumper Wires, Power Bank are some of them.

3.1.1 Raspberry Pi 3

The thesis project mainly depends on an on-board logic controller. The main re-
quirement for such controller is to have enough computational power to provide logic to
medicine boxes and smartphone app. It must have easier connectivity options as well to
interface with hardware components and user interactions. So, the best choice possible
for this controller is a Raspberry Pi 3. It have great I/O support and enough compu-
tational power for this thesis project. The Raspberry Pi will act as a main brain of the
system, provide data storage for remembering states of the medicine boxes, and connect

14
to outside world for user interactions. The main features of Raspberry Pi 3 is given below.

• Quad Core 1.2GHz Broadcom BCM2837 64bit CPU

• 1GB RAM

• BCM43438 wireless LAN and Bluetooth Low Energy (BLE) on board

• 40-pin extended GPIO

• 4 USB 2 ports

• Micro USB power source up to 2.5A

Figure 3.1: Raspberry Pi 3

3.1.2 Weighing Sensor 24 Bit HX711 Dual-Channel

In order to measure weight of medicine, a weight sensor is needed. It is bit challenging


to integrate a weight sensor module and read accurate data in such a small scale. That’s
why HX711 chip was chosen to measure weight with good accuracy. This module uses 24
high precision A/D converter chip HX711. It is a specially designed for the high precision

15
electronic scale design, with two analog input channel, the internal integration of 128
times the programmable gain amplifier. The input circuit can be configured to provide
a bridge type pressure bridge (such as pressure, weighing sensor mode). This module is
also very cheap so that makes it an ideal weight sampling module. The specifications of
this module is given below.

• Current consumption including on-chip analog power supply regulator: normal op-
eration ¡ 1.5mA, power down ¡ 1uA

• Operation supply voltage range: 2.6 5.5V

• Operating Temperature Range:-20 degree +85 degree

Figure 3.2: Weighing Sensor HX711

3.1.3 Load Cell

This straight bar load cell can translate up to 1kg of pressure (force) into an electrical
signal. Each load cell is able to measure the electrical resistance that changes in response
to, and proportional of, the strain, pressure or force applied to the bar. With this gauge
its possible to tell just how heavy an object is, if an object’s weight changes over time, or
if you simply need to sense the presence of an object by measuring strain or load applied
to a surface. Each straight bar load cell is made from an aluminum-alloy and is capable
of reading a capacity of 1kg. These load cells have four strain gauges that are hooked up
in a wheatstone[12] bridge formation. The color code on the wiring is as follows: red =

16
E+, green = O+, black = E-, and white = O-. These load cells feature two M4 and two
M5 sized through holes for mounting purposes. The specifications for load cell is given
below.

• Capacity: 1Kg

• Rated output: 1.0 +


− 0.15 mV/V

• Input resistance: 1066 +


− 20

• Output resistance: 1000 +


− 20

Figure 3.3: Load Cell (1KG)

3.1.4 ADC - MCP3008 Chip

One important feature of the system is, it will be portable and have internal power
supply. To enable the Raspberry Pi to check how much battery is remaining on the
system, it is important to read analog voltage of the battery. Raspberry Pi 3 doesn’t
have built in Analog to Digital Converter (ADC). So, an external ADC needed to be
implemented. Among various ADC chips, MCP3008 Chip is very easy to use with a
Raspberry Pi 3. Even though, this project requires only 1 input of analog voltage,
this chip will add 8 channels of 10-bit analog input to the Raspberry Pi. It uses serial
peripheral interface (SPI), so only 4 pins are required.

17
Figure 3.4: MCP3008 Chip

Figure 3.5: MCP3008 Pin Layout

3.1.5 LCD Display

In order to show various useful data to user, a LCD display is required in this system.
This display will show notifications about patient’s health, medicine etc. when at idle,

18
this display will show random inspiring quotes to cheer up patient’s day. It keeps the
information really simple and quick to read. Features of this LCD module is listed below.

• Operating Voltage is 4.7V to 5.3V

• Alphanumeric LCD display module, meaning can display alphabets and numbers

• Consists of two rows and each row can print 16 characters.

Figure 3.6: LCD Display

3.1.6 Breadboard

Breadboards are really effective to design circuits. It is like sandbox to try out circuits
before it gets complicated. It offers solder less connection that helps to change the
components very quickly. Everything components can be seen at a quick glance, and it’s
very useful to troubleshoot problems. Breadboard gives the opportunity to test out each
components and build prototypes without much effort. In this thesis project, a small
dimension breadboard is chosen in order to keep the system compact and clean.

19
Figure 3.7: Breadboard

3.1.7 LED Lights

Light Emitting Diodes or LED lights are very useful to convey message to user. In
this thesis project, LED’s are used for displaying medicine box’s status. There are four
LED’s in each box. The color of the LED’s that were used in this project are: red, blue,
green, yellow. The lens of these LED’s is 3mm in diameter, and is diffused. Features of
the LED’s are given below.

• 1.8-2.2VDC forward drop

• Max current: 20mA

Figure 3.8: LED Lights

20
3.1.8 Push Switch

In order to count the remaining medicine inside each medicine box, it is required to
count how many times the box’s lid has been opened and then closed. To measure this,
a push switch is required to be mounted inside each of the box. Since the height of
the box is very low, and the box closing is very narrow, so a miniature 2-pin single pull
single throw switch is used. These are high quality momentary on switches. Perfect as a
tactile reset switch. These switches are rated up to 50mA and its perfectly usable with
Raspberry Pi 3’s GPIO.

Figure 3.9: Push Switch

3.1.9 Resistors

A resistor is an electrical component that limits or regulates the flow of electrical


current in an electronic circuit. Resistors are used for multiple purposes like voltage
drop, voltage divider, reduce current flow, and adjust signal levels etc. Resistors are very
cheap and easy to replace. On this project, only 1 KΩ is required. 3 1 KΩ resistors was
used to cut the incoming voltage in half.

Figure 3.10: Resistors (1K)

21
3.1.10 Connectors

To link multiple different chips, modules and hardware components connectors is


a vital part. Connectors comes in different shapes and sizes. In this thesis project,
male to male, male to female and female to female connectors are used. Generally,
these connectors or jumper wires goes to breadboard to hardware components or one
breadboard point to another point.

Figure 3.11: Different types of jumper wires

3.1.11 Power Bank

Power bank is a compact way to put portable power supply in any small to medium
device. It is easily rechargeable with power cable provided with it. The best advantage
of using a power bank in this system is that the power bank provide an USB port that
have constant 5V (2.1A) voltage output. This is especially required to run Raspberry Pi
smoothly. But this feature also cause a problem to read current real-time battery voltage,
which is required to measure remaining battery percentage. This is why, the power bank
needed to be modified, and it was required to cut open the hard case, and two power
connector was attached to the positive and negative terminals of the internal battery.
Only then it can be an input to the ADC’s input channel to measure remaining battery
percentage. The specification of the used power bank is given below.

• Capacity: 10000mAh

• Battery Type: Polymer

22
• Input Current: 5V / 1A

• Output Current: DC 5V / 2.1A

Figure 3.12: Power Bank

3.2 Software and Libraries


There are two side of software development in this project. One in the Mobile ap-
plication side, and other one is programming for the Raspberry Pi to interact with the
hardware. Lets focus on what software and libraries should be chosen to design mobile
application. The Android side of the mobile application will be focused on since it’s free
and easier. Coding in raw Java to make android applications are time consuming, so
Ionic Framework has been chosen to build the mobile application. With the help of this
framework, Angular, JavaScript/TypeScript, HTML, CSS can be used to make a full
mobile application from ground up.

On the Hardware coding part, Python 3 have been chosen since it have the most active
community and full hardware support for Raspberry Pi 3. Python is the first choice of
any coder who is coding for Raspberry Pi.

23
Figure 3.13: Software and libraries used

3.3 Design Decisions


Design decisions depends on various factors. The considerations that was while de-
signing the thesis project are listed below.

• Keep the costing as low as possible. In order to mass production of this device,
its obligatory to keep the cost in range of average consumer purchase power.

• Enable all kind of phones to be able to operate the device. Most of the
people don’t have high end smartphones, so its needed to keep the functionality
available in most basic feature phones and smartphones.

• Simple yet effective. This device can not be to tough and complex to handle,
otherwise there would be possibilities to lose the magic of intuitive user experi-
ence. Since our target customers age range will be in late 50’s, the interface and
interactions are need to be as basic as possible.

• Small and compact. This device will lose it’s attraction if its too bulky, and hard
to handle. It needs to be lightweight, and easy to be carried anywhere.

24
CHAPTER 4
Implementation and Results

This chapter discusses the implementations of the whole system which describes the
system architecture on which the whole project is based and then describes the hardware,
use case diagram, the development of the mobile application also how the device was
linked to the mobile application via Raspberry Pi. Outputs and results are shown along
with each of the description.

25
4.1 System Architecture

4.1.1 Use Case Diagram

Figure 4.1: Use Case Diagram

26
4.1.2 Schematics Diagram

Figure 4.2: Schematics Diagram

27
4.1.3 Design Illustrations

After the high level illustration of the device, here is the actual implementation on
the hardware level.

Figure 4.3: Inside view of the system

28
4.2 Hardware

4.2.1 The Base Structure

After the design part, the device has been started building from the scratch. For
the base of the device, a strong but lightweight box styled platform was needed. So, a
26 square centimeter cardboard box with height of 6 centimeter was chosen. The box
is strong enough to hold 3 medicine boxes, weight sensor, lcd display, and other small
components. The box has been wrapped with colored paper to give it a nice look.

4.2.2 Medicine Box

To put 3 medicine boxes on top of the cardboard base, the boxes needed to be kept
lightweight and small. So, three 9x8 centimeter plastic boxes were chosen. Two of the
boxes will be for normal medicine pills and one box will be for liquid or gel, which will
have weight sensor underneath it.

Two medicine pill box will also have a push switch connected to the base of the box,
and which will trigger a signal when the box is being closed. This will help keep track
of each medicine’s count. So it can be counted exactly how many pills are remaining of
each medicine. These boxes will be connected to the base by screw, so that it doesn’t
move while moving or carrying the device around.

The special weight sensor box, which will keep track of the weight of the given liquid
medicine, is not like the other two boxes. There is no push switch on this box since,
the amount of liquid left on the medicine container cannot be tracked just by tracking
the count of how many times it has been opened. This box will be mounted on top of
the weight sensor. The weight sensor will take weight inputs every 5 minutes to see how
much medicine is left on the container. This box will also have a small cut out on the
cardboard box, to make sure the weight sensor can measure the weight accurately; more
on this topic will be covered later on.

Each box will have 4 led lights. The color of the leds are: red, blue, green and
yellow. Each color symbolizes different states of the medicine. Green light indicates that

29
everything is normal. Yellow light indicates that the medicine is getting low in number,
and the medicine needs to be refilled. The blue light indicates that the expiry of the
medicine is nearing, and that the medicine should be replaced. The red light indicates
that it’s time to take that specific medicine in the box. These 4 led lights are mounted
in front of each box.

4.2.3 Power Supply

The device can not be useful if it’s required to be plugged in to wall socket all day.
That is why, a built in power supply is included that can run the device even if the
main power supply is disrupted. Moreover, one of the feature of the proposed mobile
application is showing the current battery status as percentage. So, a power bank has
been included into the device. It’s capacity is 10000mAh and it can provide an output
current of 2A with 5V, which is perfect for running Raspberry Pi and other electrical
components. But the challenge faced, while working with the power supply is that, on
the usb port, it always give 5V constant power supply, which is good for the Raspberry
Pi. But, in order to measure the remaining battery on the power bank, the actual voltage
of the battery must be measured. So, the power bank is cut open bank and wires are
connected to the positive and negative terminals of the battery. Then, it was used as
an input to the Analog to Digital converter (ADC - MCP3008-I/P). This ADC chip will
convert the battery’s voltage to a readable voltage format. After studying the battery,
it was found that at maximum charged state, the battery’s voltage is 4V and at lowest
charged state it’s 3V. So we can then calculate the battery percentage using this formula:
((input - min) * 100) / (max - min)

30
Figure 4.4: Time vs Voltage Graph of Power Supply

4.2.4 LED Matrix

There are 3 medicine boxes in the developed device and there are 4 led lights on
each of them. So there are total 12 led lights for 3 medicine boxes. In Raspberry Pi,
there are 24 GPIO (General Purpose Input/Output) pins that are usable for external
components. If 12 gpio pins were used on only the LED lights, then there will be a
shortage of gpio pins for other components. But, using LED matrix pattern, 12 led lights
can be functioned with only 7 gpio pins. LED matrix is often challenging because it
cannot be light up irregularly. It is easier to light up a whole column, or row, but its
required multiplexing to light up different patterns. Multiplexing the LED light means,
it will light up a pattern, then wait for a small duration, then light up another pattern,
and when the delay duration is so small, the human eye cannot distinguish the difference.
For optimum results, delay between different states are set to 0.001 seconds. So, the
lights are turned on and off in such a way and speed that the human eye cannot detect
the flickering. This is why the LED matrix pattern is used, to light up 12 led lights. The
circuit diagram is given below.

31
Figure 4.5: LED Array

32
4.2.5 Weight Sensor & Load Cell

To measure liquid or gel type medicine, a load cell and weight sensor was constructed.
On this developed device, 1KG load cell and HX711 weight sensor has been used. In
order to measure accurate weight, the load cell is fixed on the cardboard base using 2
screws and a small hole is cut for the load cell to move freely when any weight is put on
top of it. The plastic box is carefully placed on top of the weight sensor, in such a way
that the center of gravity of the box will be exactly in the middle of load cell’s middle
point. Since the input from load cell is too small for Raspberry Pi to understand, HX711
weight sensor has been used; which will amplify the signal to a readable amount. Then
the weight sensor is very carefully calibrated by tweaking the weight factor in the software
code. Finally, the medicine’s weight was measured without much error. Measuring the
weight is not enough for this thesis’s purpose, Raspberry Pi have to remember when the
weight is below 20% of the original medicine’s weight. To achieve this, the weight sensor
is being ran continuously in the background, and measure the current weight. Each and
every reading will be recorded into the local database of the Raspberry Pi. When the
current weight is measured below 20% of the total weight of the medicine, the yellow
LED light will light up, indicating that the liquid medicine is getting low. It will also
trigger sms and push notifications.

Figure 4.6: Weight sensor & Load cell side view

33
4.2.6 Buzzer

Digital Buzzer Module was used to generate notification style sound. This alerts the
patient when he or she will need to take a medicine. The buzzer will sound for 2 minutes,
until the medicine box is opened. The buzzer will also simulate a different kind of tone
when it’s time to replace the medicine if the medicine’s expiry date is coming soon.

Figure 4.7: Digital Buzzer Module

4.2.7 LCD Display

LCD display is a great way to communicate with the patient. It serves as a guide
when the patient is picking up his or her medicine. He or she will know exactly how
much he or she needs to consume, like 2 pills at a time or 1 pill. It will also act as a
welcome screen for the patient. Another important feature of the LCD display is, when
the device is powered up, it will show the IP address of the device, because the patient
needs to input the IP address in the settings page of the mobile application. Without
the IP address in the settings page, the mobile app will not be able to communicate with
the device at all. It will greet the patient, and show them random inspiring quotes. So,
the LCD display is not only a vital part of the medicine taking system, but also it act as
a mental happiness booster.

34
Figure 4.8: Final device top view

35
4.2.8 Block Diagram

Figure 4.9: Block Diagram

4.3 Mobile Application

4.3.1 Basic Application Flow

The mobile application has been developed using Ionic Framework. It’s a very good
framework to build mobile applications fast and make developers life easier. The basic
flow of the mobile application is very simple and intuitive. Once the patient or family
member installs the mobile application into the smartphone, it will ask for basic in-
formation like Name, Phone number, Height, Weight, etc. After setting up the initial

36
profile, they will see the main application menu. Then the user can go through different
pages and browse the mobile application’s features. The features are discussed in details
throughout this section.

Figure 4.10: Dashboard

37
1. Smart Medicine Box: Amongst all the other features, this feature is directly
connected to the Digital Medicine Box. It has some user input options to set the
name and quantity for tablets, weight for the syrup, doses, expiry date, box number
and an extra contact number of near one to follow up. All these inputs will be given
to the Digital box through the local server that is created by the Raspberry Pi. A
percentage of the availability of total medicines will be shown on the interface of
the app after the whole set up is done. When its time for a dose, the Digital box
gives notifications with all its physical components (i.e. the red LED lights blinks,
the buzzer start alarm and the LCD display shows the number of the box and the
name of the medicine that is to be taken), the app receives notifications about
doses, the relatives number receives texts. Then after taking the medicines, The
system decreases the amount of the medicine from the total quantity each time
a pill/tablet is taken from the box and the lid is close as the push switches are
been pressed while closing the lids. This thing works for the tablets and capsules
only where the weight chamber functions in a bit different way. It continuously
calculates the weight of the floor with the help of the load cell to see if there is
any difference, if there is, the system instantly decrease the weight and shows the
current availability percentage of the syrup and gives all the notifications in the
same way as before. That’s how, when the quantity goes below 20% the device,
app and the phone number receives their notifications about refilling.

If a patient or user fails to take medicine even after notifying, the system goes to
resume mode and gives alarm in a specific time interval until there is a counter less
or a decrement in current weight.

38
Figure 4.11: Medicine Box Page

39
2. Health Comparison/Predictions: Depending on previous and recent health
reports, the user can add current parameters to compare his health status. The
application will go through his previous health parameters and verify it with the
normal conditions. If the user’s current parameters are alarming, the application
will check what symptoms those parameters means. And thus compiles a list of
probable diseases. In addition to this, to refrain the users from any kind of miscon-
ception or wrong guesses, the application provide a health predictions on the base
of current symptoms of the users. After taking some user information like gender
and birth year, it shows a list of symptoms retrieved from the local database of
Raspberry Pi. Users can choose those health symptoms according to his current
health condition and then the system provides all the possible diseases one can have
with the suggestions of the specializations.

Database work process: Firstly, all the symptoms and diseases were stored in
the local database that are collected through data mining from different health and
disease related websites such as diseasesdatabase.com, symptoms101.com. As there
are huge amount of redundancies like a disease can have more than one symptoms
and three of those match with the symptoms of another disease. Reversely, one
symptoms can indicate to more than one diseases. So, to show a clear list to the
user, the list of symptoms had to made unique while retrieving to make sure that
all the values in a column are different and there is no repeated values shown. Then
after the user chooses all his symptoms and apply, the list of the diseases had to
made unique and shown it to the users interface.

40
Figure 4.12: Health Comparison Page

41
3. Diet Advice:. Not letting anyone to forget their diet, food limitation and also cut
off the stereotype food diet, this feature provides interesting suggestions and healthy
recipes. User can give preferences on food item or ingredients from the given list
like low calorie, low sugar, medium carbohydrate etc to maintain a balanced diet
and the system provides 10 type of interesting healthy food recipes based on those
preferences composing the collected data from the data storage of the mobile app.
All the recipes, ingredients amount and pictures have been scraped from websites
such as yummly.com, food.com, allrecipes.com that provides healthy food recipes.
Stored in the local database with all the tags like food type, calorie contains, cuisine,
non-allergic etc. A unique list is shown to the users while showing the list to the
users to choose food items and ingredients amount. On the base of these preferences,
the system retrieve all the data where those ingredients are in common and shows
it to the user with pictures.

Figure 4.13: Diet Advice Page

42
4. Storing Appointments. This feature is all based on user input. Users can set
Doctors name, appointment date, time, location and create an appointment with
the doctor and get notification before its time for the appointment. User has the
option to set unlimited appointments that creates a list of appointments. The saved
appointments can be changed, deleted. With each input given and saved by the
user, the data saved in the local database. The data will be dropped after deleted.

Figure 4.14: Appointments Page

43
5. Prescriptions and Reports: It’s very inconvenient for patients to carry document
copies of test reports and prescriptions during doctor visit, traveling or abroad
treatment. To solve this, the system provides the facility to store all the medical
papers in one single app. It takes necessary information like doctors name, location,
advice, medicine item for prescription and saved in the local storage of mobile
application. The information are taken individually to make the prescription easier
for a normal person to understand. All the inputs given by the users are saved in
the local database.

For saving the reports the system creates some sections naming after the hospitals
or diagnostic centers and some subsections naming after the type of the tests like X-
Ray, Hematology report, ECG etc and saved in a organized way in the application
storage and the database as well. To avoid redundancies, there will be a new folder
created each time a unique input is given by the user. In the local storage of mobile
application, the reports will be maintained by unique identifier, along with user
input. When showing the reports from the data storage, the app firstly group all
the reports by hospital department names, then it group by hospital names. Finally,
when a user clicks on a hospital name from a specific department, the app queries
which report is clicked by its unique identifier, and get its information from local
storage. Then it shows the report along with report images in a new page.

These two features has an option to take pictures of the documents instantly and
save the pictures with the related documents that is in the default data direc-
tory of android application (/data/app-id/files). If the app Id of this project is
”com.user.smartMedicine” so all the pictures will be saved to /data/com.user.smart-
Medicine/files. Instead of saving the pictures in the phones common gallery with
hundreds of personal pictures makes it easier to carry all the prescriptions and
reports in one application and find out in a faster and easier way whenever needed.

44
Figure 4.15: Prescriptions Page

45
Figure 4.16: Reports Page

46
6. Doctors Directory: Its not easy to collect visiting cards and finding the important
one timely is tougher than that. Keeping this issue in mind there is an option to
create a doctors directory where necessary information about all the doctors needed
can be saved. All the data will be saved in local database with the user input. Names
and information will be saved under some section that will be named after their
specializations. User can search with their names, designation or specialization
from the directory when its needed.

Figure 4.17: Doctors Directory Page

47
7. Locating nearby healthcare centers and pharmacies: Lastly and most in-
terestingly, the system gives an advantage to find out nearby hospitals, clinics and
pharmacies located in such places that usually don’t show up in Google map. To
develop this feature, Google map API has been used to take the map or the back-
ground view but the application will have a manually collected data list of hospitals,
pharmacies, clinics. One can search his desired health center searching by the spe-
cializations of the physicist like gynecology, dermatology, surgeon etc can be used as
searching keywords and the pointer shows exactly those health centers on the map
along with the name of the doctors available there according to the input keyword.
All the information which was given into the system was manually verified and care-
fully chosen. To make sure the accuracy of given information is good enough, only
official website and verified pages of hospital, clinics, and pharmacies are harvested
to collect the location information. After collecting the location information such
as longitude, latitude, name, and address, these are then imported into the local
storage of mobile app. Since all the location information of different health centers
are stored within the mobile application’s local storage, there is no need to query
Google maps for extra location results. All the location markers are generated in
real time based on user keyword input.

48
Figure 4.18: Nearby Health Centers Page

49
4.3.2 Workflow

Figure 4.19: Flowchart of the Workflow

50
4.4 Raspberry Pi Development
After building the Hardware and Mobile application, now it’s time for coding in the
Raspberry Pi to bridge two side of this device. First, we need to install necessary library
for the following modules from Python Package Manager and GitHub.

• Weight Sensor(HX711)

• ADC - MCP3008-I/P

• LCD Driver

• GPIO

Now, the Raspberry Pi pinout diagram is followed and use GPIO pins to connect
each components based on respective data sheet. Then, an individual python script
to run each of the component was created. After testing each of the components are
working fine with Raspberry Pi,Linux service for each of the hardware components was
created so that they can operate individually, without interfering each other. Each of the
hardware components will continue to run in the background while the device is powered
on, and update a MySQL database hosted locally on the Raspberry Pi. This will make
the mobile application run faster, since the mobile application will only read from the
MySQL database, and it will not query any hardware when called from user end.

Figure 4.20: Raspberry Pi Pinout Diagram

51
4.5 Testing
After building the device and mobile application, The whole system was checked
thoroughly for errors. Tests to simulate different types of use case, human behavior and
hazardous conditions. The tests and its finds are given below in details:

• Perform multiple medicine take away from medicine box at a time and close the lid.
No problem was found here, because each box is connected to unique push switch,
which will remember its state and update on raspberry pi accordingly.

• Hazardous Test. The device was tried shaking multiple time and see if its really
portable. It was fond that it’s perfectly portable since its components are securely
connected to the base and the electrical connections are not loose.

• Wrong and malformed data was given as input into the mobile application to see if
it validates those data, and It was found that it reject to save malformed data to
storage, and prompt user to give valid data.

52
CHAPTER 5
Conclusion

This portion concludes the whole report with discussing two parts- effectiveness of
the system and future work

5.1 Effectiveness of the System


With the advancement of today’s world, many big machinery and devices has been
built for the treatment of various diseases but people, on the other hand, in their fast
paced life, have more likely moved away from concentrating on their daily or timely
medications. Keeping that fact in mind, the developed system has been made into a
small device, which can be carried around anywhere because of its size and a mobile
application.
A number of devices have been constructed before but just to remind the patients of
their medications. None of them could diagnose one’s health as closely as this developed
system. The developed system is very effective and accurate in terms of providing the
necessary information. It is made sure that no information is lost and accurate health
information is provided all the time. Further research is needed to evaluate more pre-
cisely the effectiveness of the Smart Medicine Box.Testing with different segments of the
population is needed to assess individual interactions with the device and to measure
medication adherence. Many features, which are directly related to health issues or casu-
alties, have been included in this small system and these, with further implementation,
will keep on serving the user for a long time.

53
5.2 Future Work
The proposed system is challenging and accuracy of the implementation is very crucial.
To make the application as user-friendly as possible, it must be very accurate and fast.
Our future work plan would be the following:

• Implement the proposed mobile application on Apple smartphones.

• Perform various tests to measure accuracy.

• Test the application with actual patient.

• Write proper documentation for future reference.

• Publish the application for public uses.

5.3 Proposed Future Work


Integrating this thesis with telemedicine.
Telemedicine is basically the remote delivery of a few types of healthcare services, such
as health assessments or consultations, over the telecommunications infrastructure. This
allows healthcare providers or doctors to diagnose, evaluate and treat patients without
the need of an in-person visit to the patient. [14]

Telemedicine was introduced as a way to treat patients located in remote places, far
away from local health centers or facilities or in area there was a lack of medical experts.
Telemedicine is still used today and it is increasingly becoming a more convenient way
of such medical care. Todays patients wants to waste less time in the waiting room at
the doctor, and demands immediate care for minor but urgent conditions whenever they
need it. [15]

Keeping this factor in mind, the developed system for this thesis can be further
developed to extend its reach to the doctors or healthcare providers, where they will be
able to connect to the patients directly via the application, follow-up with them, provide
updates and suggestions.

54
The challenge for this is to design and develop a mobile health app that works well
under certain, looks good, and can be sustained.

Mobile health applications allow healthcare providers or doctors to connect with pa-
tients and staff more quickly and more dynamically, reaching out to them on the device of
their choosing and convenience. Applications designed for a smartphone or a tablet also
allows users to access information when and where they need it, reducing time wasted
searching for the data. [16]

The proposed extension will have the following work procedure: When user first
initializes the mobile app and device, it will send the personal info of the user to the cloud
server and registers the user. The mobile app will have a token stored in its database,
which is a unique identifier of the patient. After the initial setup, all the remote call will
convey this token, and the server can identify the user by this token. The mobile app
will check if the user is connected to the internet, and if the internet is active, then it
will try to sync with the cloud server every hour. The mobile app will send information
related to prescriptions, reports, medicine boxes, and analytics of pills taken from boxes.
All these data will only be sent once every hour. This will ensure that the mobile app
doesn’t take much bandwidth of the phone and drain its battery. After the data has
been saved and synced with the cloud server, the doctor’s team can access the data from
web portal. Here, they can see the analytics of each patient. After analysis, the doctor
can send sms and push notifications to specific patient with health advice from the web
portal. When the mobile app will receive the push notification, it will alert the patient
and show the medical advice.

55
CHAPTER 6
Reference

[1] Merz, B. (2018). Forget to Take Meds? The Real Cost


of Ignoring Your Doctor’s Orders.. [ONLINE] Available at:
http://www.theatlantic.com/sponsored/cvs-innovation-care/
forget-take-meds-real-cost-ignoring-your-doctors-orders/89/ [Accessed
10 March 2018]

[2] Dobbels F, Van Damme-Lombaert R, Vanhaecke J, De Geest S. Growing pains: Non-


adherence with the immunosuppressive regimen in adolescent transplant recipients.
Pediatr Transplantation. 2005;9:381-390.

[3] Anon. Poor medication adherence increases healthcare costs. PharmacoEconomics


and Outcomes News. 2005;480:5.

[4] Osterberg L, Blaschke T. Adherence to medication. N Engl J Med. 2005;353:487-497.

[5] Praska JL, Kripalani S, Seright AL, Jacobsen TA. Identifying and assisting low-
literacy patients with medication use: a survey of community pharmacies. Ann Phar-
macother. 2005;39:1441-1445.

[6] Improvement and Efficiency, West Midlands, Midlands and East, The Automated
pill dispenser project, The right pills at the right time delivering right outcomes, End
Project Evaluation Report 2012.

[7] CVSHealth, By the Numbers: The Challenge of Complex Medication


Management. [Online] https://cvshealth.com/thought-leadership/

56
by-the-numbers-challenge-of-complex-medication-management [Accessed
10 March 2018]

[8] Centers for Disease Control and Prevention. Chronic Disease Overview. [Online]
https://www.cdc.gov/chronicdisease/overview/index.htm [Accessed 10 March
2018]

[9] R. Surender Reddy, C. Niharika, Rohit Sharma, A. Bharath Kumar, E. Narayana. An


Intelligent Patient Medicine Reminder. International Journal of Innovative Research
in Computer and Communication Engineering, Vol. 5, Issue 2, February 2017.

[10] Appointment reminder systems are effective but not optimal: results of a systematic
review and evidence synthesis employing realist principles [Online]. https://www.
ncbi.nlm.nih.gov/pmc/articles/PMC4831598/ [Accessed 10 March 2018]

[11] epill e-pill MedSmart PLUS Monitored Automatic Pill Dispenser. [ONLINE] Avail-
able at: https://www.epill.com/medsmartplus.html [Accessed 10 March 2018]

[12] Wheatstone bridge. [ONLINE] Available at: https://en.wikipedia.org/wiki/


Wheatstone_bridge [Accessed 10 March 2018]

[13] Diseases Database. [ONLINE] Available at: http://www.diseasesdatabase.com/


[Accessed 10 March 2018]

[14] What is telemedicine?. [ONLINE] Available at: http://searchhealthit.


techtarget.com/definition/telemedicine [Accessed 10 March 2018]

[15] The Ultimate Telemedicine Guide — What Is Telemedicine?. [ONLINE] Available


at: https://evisit.com/what-is-telemedicine/ [Accessed 10 March 2018]

[16] How to Design and Develop a Mobile Health Application. [ON-


LINE] Available at: https://mhealthintelligence.com/features/
how-to-design-and-develop-a-mobile-health-application [Accessed 10
March 2018]

57

You might also like