Sie sind auf Seite 1von 6

A. Alexan et al.

/ Carpathian Journal of Electronic and Computer Engineering 6/2 (2013) 26-31 26


________________________________________________________________________________________________________
ISSN 1844 9689 http://cjece.ubm.ro
Advanced Medication Dispenser
A.I. Alexan, A.R. Osan
Technical University of Cluj-Napoca, North University
Center Baia Mare,
Baia Mare, Romania
alexanalexandru@gmail.com
S. Oniga
Electric, Electronic and Computer Engineering,
Technical University of Cluj-Napoca, North University
Center Baia Mare,
Baia Mare, Romania


AbstractMedication dispensing is an important activity that
can have major implications if done improperly. Dispensing must
be done in the correct time interval, at the correct user, with the
correct drug and dose. We propose a smart medication dispenser
that can satisfy these needs and provide a mechanism for
supervision. In order to ensure that the dispensing process is
error free, the concept of a new smart medication container is
used. A smart medication container is smart as it holds the
medication dispensing parameters for the drugs it contains:
dispensing time and date and name. Based on this information,
the actual dispensing is done.
Keywords Medication dispenser, Smart medication container,
Smart House
I. INTRODUCTION
A. Actual Medical Dispensers

A medication dispenser is a perfect system for medicine
administration because it tries to eliminate, or at least
minimize, the error that may appear in the process of
organizing/dispensing medicine.
The problems with most of the existing medicine dispensers
are that, there are semi-automatic organizers, meaning that the
user must organize the medicine and set the alarms. This
process is error prone, because any mistake in the process of
organizing the medicine can have major consequences.
Most of the devices available are very hard to use and most
of them allow the user to take an overdoses of medicine due to
improper initial preparation. The user interface is contra
intuitive sometimes, as the user is constrained to make various
operations before the actual operation. The fact that the user
must use a small alphanumeric monochrome screen and some
buttons or even button combination, to accomplish complex
tasks, add to the complexity of correctly setting a unit in order
to dispense medicines. The existing products are not easy and
fast to set up, requiring often a complex processes in order to
be up and running. This process must be repeated every time a
parameter, like date and time or medicine types, changes. This
can be very difficult to do, especially if the person who uses the
device is not able to do the process himself. This means that a
supervisor must be present to make the changes every time a
parameter changes. Regardless of who is setting the device, this
device is error prone and the results of a small mistake can be
catastrophic.
B. A Better Medical Dispenser

The medical dispenser that we propose is suitable for home
use or for medical center environment due to the fact that it
reduces the probability of taking a wrong drug or taking an
overdose. The medicine dispenser automatically offers the user
the correct dose of medicine at the correct time. The device can
be monitored via an Ethernet network and offers information
regarding the drugs that the user must take, or taken, via a
webpage. The supervisor can verify if the user has taken the
drugs and which drugs wasnt taken.
This system has a replaceable medication container module
which makes the recharge with drugs process easy. It also has
the possibility of using prearranged medicine containers. The
drugs module contains information regarding the drugs that it
contains, and the time of dispensing. The medicines are
dispensed only to the correct person; the identification being
done via RFID tags.
The project aims are to make an easy to use device that is
able to handle complex tasks with minimum of user input,
keeping the process of medicine dispensing safe. We want to
create a system that manages and monitors the drugs
dispensing activity in real-time. We propose the use of a smart
medication container, which holds the drugs along with the
information necessary for dispensing. This container can be
prepared by local pharmacy, being very safe. In order to be
backward compatible with current devices, the medical
container supports the traditional manual arrangement of drugs,
which can be error prone.
We want a device that is able to dispense the drugs in real-
time; assuring that only the correct user receives the proper
medication. The identification is implemented by RFID
technology.
Our objectives were:
Create a safer medical dispenser that the current
models
Implement and use a smart medical container that
can hold the drugs alongside with the information
needed for their dispensing, thus improving
security
Create a device that requires minimum user input
to setup, if possible only replacing the medicine
container
A. Alexan et al. / Carpathian Journal of Electronic and Computer Engineering 6/2 (2013) 26-31 27
________________________________________________________________________________________________________
ISSN 1844 9689 http://cjece.ubm.ro
Create a device that can be monitored remote via
network interface, allowing a supervisor to access
the drugs status
Permit only the correct user to receive the
medicine, by RFID identification
II. EASE OF USE THE MEDICAL DISPENSER

The medication dispenser is built around a Digilent ChipKit
Max32 Arduino compatible board, being the central unit that
connects all the other components. This platform was chosen
because it combines the power and speed of a PIC32
microcontroller and the flexibility and code portability of a
Arduino. This board operates at a frequency of 80 MHz,
allowing the software to perform multiple tasks in the same
time.
The second unit as importance is the 802.11 WIFI shield that
connects to the ChipKit Max32 board, thus enabling wireless
communication to the device. This creates a device that can be
monitored from a local area network, and with the help of a
VPN connection, the device can be accessed from any location
with internet access.
The component that keeps track of time is a real time clock,
and it is responsible for dispensing the drugs at the correct
time. The IC chosen for this task was DS1375 from MAXIM,
mainly due to its very small form factor and low power
consumption.
Two servo motors ensure the actual dispensing:
one for the rotation of the medicine container
one for the sliding door that is at the bottom of this
container.
The container is fitted with a PIC 12F1840 microcontroller
responsible with the storage of the medicine list. Besides the
name of the drugs, this microcontroller stores the date and time
of actual dispensing. A microcontroller was chosen to act as a
bridge for communication and to allow the authentication of
the container. In order to keep the part count low, the internal
EEPROM memory was used to store the data. This can be also
achieved with other larger storing mediums; the only condition
is to maintain the security, by preventing unauthorized user to
modify the data stored.
A LCD module is used to display information to the user and
two capacitive button modules to acquire information from the
user. In the present software implementation, the buttons are
not used in order to demonstrate that the user can receive the
medication with almost no interaction.
An RFID module ensures that only the authorized person
can take the drugs.
A buzzer is fitted in order to allow an acoustic alarm when
the patient needs to receive the medication.

The components used in this project are:
ChipKit Max32
ChipKit WiFi Shield
PmodCDC1 - Capacitive I/O
GWS Servo Kit
RTC Maxim DS1375
RFID Reader ID-12LA (125 kHz)
LCD DM2021-3
PIC 12f1840
Optical encoder used for the continuous servomotor

The systems major components are showed in Fig 1.

A. Hardware design
The Real time clock chosen for implementation is Maxim
DS1375. It was chosen because it has an I2C interface and does
not require a crystal. It counts: Seconds, Minutes, Hours, Day,
Date, Month, and Year with Leap-Year Compensation Valid
Up to 2100. This module works at 32.768kH. An external RTC
was chosen in order to preserve the date and time settings while
the batteries for the device are changed.
The LCD used is a SANYO DM2021 Liquid Crystal Dot
Matrix Display Module with 20 characters on 2 lines. The
interface used is a 4 bit of date parallel and some control
signals.
The RFID chip used is ID-12 Innovations. It was chosen
because it supports ASCII, Wiegand26 and Magnetic ABA
Track2 data formats. The data format used in this case is ASCII
because the ChipKit Max32 has a generous number of serial
interfaces. This module can operate at distances up to 12+cm,
being perfect for reading a RFID card from inside the Advance
Medication Dispenser housing.
The PIC 12F1840 is used as a smart and easy to interface
EEPROM memory. It has 256 bytes of data EEPROM, enough
to store the name and date for the 24 drugs in a container. If the
container must hold more drugs, or the need to store additional
information appears, this microcontroller can be changed with
another one with a bigger EEPROM. The reason that a
microcontroller was used, and not an EEPROM IC, is that the



Fig.1 The medication dispenser major components
A. Alexan et al. / Carpathian Journal of Electronic and Computer Engineering 6/2 (2013) 26-31 28
________________________________________________________________________________________________________
ISSN 1844 9689 http://cjece.ubm.ro
microcontroller can be password protected the data being more
secure and tamper proof. This microcontroller communicates
with the ChipKit Max32 via a serial interface.
The ChipKit WIFI shield is used to offer the project network
capabilities.
The capacitive I/O buttons are used to read user input. These
kinds of input devices are suitable for this implementation
because the buttons can be activated even if they are closed
inside the devices enclosure.
The project uses two servomotors. One normal servomotor
used for the sliding door of the medicine container and one
servomotor that can rotate continuous. The continuous
servomotor is used in order to rotate the medicine container for
the actual drug dispensing. The continuous servomotor has an
optical encoder used to precisely determine the current
position.
The buzzer used is a simple piezoelectric buzzer.

B. Software design

1) The PIC 12F1840 software

The software on this microcontroller acts as a bridge
between the serial interface and the EEPROM internal
memory, allowing storing values sent by serial interface
directly in EEPROM and their retrieval. This storing method
was chosen in order to increase security, this implementation
allowing password protection over the data. On the EEPROM,
a container start date is stored, along with 24 drug information.
Each drug data contains the time difference from the last drug
that must be administrated and the drug name. In order not to
store the same information multiple times, the 24 drug
information contains only the time difference between the last
drug dispensing date and time under the form of hours and
minutes. The first drug uses the container start date in order to
compute the dispensing date. The container start date is used as
a safety feature, meaning that if a container houses drugs with a
dispensing date older that the current date, the drugs will not be
dispensed. This enables the user to safely try to use an older
container or even a newer container without the possibility of
the wrong medication being dispensed. The algorithm maps the
available EEPROM memory into portions manageable via the
serial interface.
Via the serial interface, there a two possible commands:
Read: Marked with a single character, R, the
read command is followed by:
o A number indicating the desired position
from the container, more precisely the
drug number from which to read the
information
o A character, D, indicating that the
container start date and time will be read.
Write: Marked with a single character, W, the
write command is followed by:
o A number indicating the desired position
from the container, more precisely the
drug number for witch to write the
information
o A character, D indicating that the
container start date and time will be
written.

2) The ChipKit Max32



The program for the ChipKit MAX32 is created around the
Ethernet (TCP/IP and UDP) libraries, written in such a way
that any function tries to return as soon as possible, in order to
avoid bottlenecks. This behavior allows a fast response to any
external event, including external interrupts.


The setup part of the program handles:

LCD module initialization
Servomotors initialization
WIFI module initialization
Attaches interrupts needed for the encoder
Loads the drug list for the first time

The main part of the program handles the process of
dispensing medicine. The medicine has four possible states:

Waiting
Take medicine
Taken
Missed

The state diagram for a medication is presented in Fig. 3.




Fig.2 The medication dispenser hardware components

A. Alexan et al. / Carpathian Journal of Electronic and Computer Engineering 6/2 (2013) 26-31 29
________________________________________________________________________________________________________
ISSN 1844 9689 http://cjece.ubm.ro
At the beginning all the drugs are in a waiting state. The
interval that the drug can be dispensed to the user represents
the take medication state. After that, depending on the user
actions the drug changes its state into medication taken if the
user authenticated with the system or else medication missed.

After the medicine list is loaded from the PIC 12F1840
microcontroller, the list is parsed in order to find a medicine
that must be administrated. This is done by comparing the
administration date/time of the medicine with the current date
supplied by the RTC module. Initial all the drugs are in
WAITING state. As soon as a ready to dispense medicine
is found, the medicine gets updated into the TAKE
MEDICINE state. A timer is started, in order to allow the
person to receive the medicine only in the correct time interval.
The buzzer alerts the user that he must take the medicine and a
message is shown on the LCD screen. As long as the
administration interval is not exceeded, the system waits for the
user to authenticate with the personal RFID card. If the user
presets the correct RFID card within the valid time interval, the
medicine is dispensed, the user receiving the drugs. After this
the timer and buzzer are stopped and a message is showed on
the LCD screen. The medicine state updated to TAKEN. If
the time interval has been exceeded without a valid
authenticated user, the medicine is marked as MISSED and
the buzzer and timer are stopped. A message is left on the LCD
screen in order to inform the user that a medicine has been
missed.

This behavior is presented in Fig. 4 in the medication
dispenser activity diagram.
The Ethernet library creates a web server, which allows a
remote person to connect to the device and monitor the
medication dispensing activity. The supervisor can access the
devices web page from any location, via internet. The
supervisor must be authenticated in order to be able to see the
medicine dispensing related information (Fig. 5).


Fig. 4. The medication dispenser activity diagram

Fig.3. The medication state diagram
A. Alexan et al. / Carpathian Journal of Electronic and Computer Engineering 6/2 (2013) 26-31 30
________________________________________________________________________________________________________
ISSN 1844 9689 http://cjece.ubm.ro
The login information is stored on the device in the current
implementation. Also the current implementation is created for
a single user.

C. Medication Container
The medical container is designed in order to create a safe
and reusable medical storing device. It is safe because only the
medical dispenser can open it and it is reusable because it can
be filled with different drugs and the stored information
updated.
.
This container (Fig. 8) is designed to avoid medication
overdoses and accidents. The container is supposed to be
obtained from the pharmacy based on a prescription.




D. The User Interface

The medical dispenser has a simple yet powerful user
interface. Since it is designed with simplicity in mind, the
user interface components are:

The LCD screen
The LEDs
The Buzzer
The RFID reader
The capacitive touch buttons (are not used in the
current implementation)


Fig. 5. The medication webserver User Interface (Login)



Fig. 7. The medication dispenser container life cycle


Fig. 8. Themedicationdispenser container




Fig. 6. The medication webserver User Interface
A. Alexan et al. / Carpathian Journal of Electronic and Computer Engineering 6/2 (2013) 26-31 31
________________________________________________________________________________________________________
ISSN 1844 9689 http://cjece.ubm.ro
The LCD screen is used to display the current time and date.
Along with this information, the take medication and
medication lost event are displayed.
The LEDs, one green and one red provide a quick way (Fig.
9) for the user to know if he must take the medication (green
LED) or he has missed a dose of the medication (red LED).
The green LED is ON during the interval that the user can take
the medicine. In order for the user to receive the medication, he
must authenticate via RFID. The red LED is ON in the interval
that the user has missed a dose of the medicine and the next
dose of the medicine. It stays ON for that period in order to
inform the user that something is WRONG, more precisely he
has missed a dose of medicine.


Another element is the buzzer, which announces acoustically
the moment that a user can receive its medicine. The buzzer
stays ON as long as the user can take its medicine, in order to
force him to take the medicine as soon as possible.
The RFID is considered as a user interface element since the
user authenticates using this device and a RFID tag. This
authentication is used since it requires less user action and it is
reliable. The most secure implementation will use RFID
microchip implants that ensure that the person receiving the
medicines is the correct one.
E. Developing environment
For the programming of the dispenser, the developing
environment used was a Widows 8 Enterprise PC. The PIC
12F1840 was programmed with the PCWHD compiler & IDE
and the program was transferred to the PIC with the OLIMEX
PIC-PG1 serial programmer. The ChipKit MAX32 was
programmed with the MPIDE environment.
CONCLUSIONS
The project (Fig. 10) has been implemented and meets all
the specification goals. This project offers a complex assistance
and medicine dispensing system. Due to the security checks
used, RFID identification, the system is able to avoid potential
critical medicine administration errors, and to ensure that the
medication has been taken.
This product offers more features than other related
products, like patient supervision via internet and almost
instant setup.
The system is open to extension and integration with the
smart house and a wide range of sensors.

REFERENCES

[1] J ournal of Biomedicine and Biotechnology, Volume 2012, Article
ID 381493, 10 pages doi:10.1155/2012/381493, Construction of a
Smart Medication Dispenser with High Degree of Scalability and
Remote Manageability, 2012
[2] Athina A. Lazakidou, Konstantinos M. Siassiakos, Konstantinos
Ioannou , Wireless technologies for ambient assisted living and
healthcare , 2011
[3] Noel E. Zeller, Portable medicine dispenser, Patent Publication
Number: 0533300 A1
[4] Cathy Cress, Handbook of Geriatric Care Management, J ones &
Bartlett Publishers , 2011
[5] Douglas A. Perednia, Overhauling America's Healthcare Machine: Stop
the Bleeding and Save Trillions, FT Press, 2011
[6] Sylvain Giroux, Hlne Pigot, From Smart Homes to Smart
Care: ICOST 2005, 3rd International Conference on Smart Homes and
Health Telematics, IOS Press, 2005
[7] S. Oniga, I. Orha, Hardware Implemented Neural Networks used for
Hand Gestures Recognition, Carpathian J ournal of Electronic and
Computer Engineering, Volume 4, Number 1 - 2011, pp.93-96, ISSN
1844 - 9689
[8] S. Oniga, A. Osan, A. Alexan, Alternative control method of the smart
house: natural gestures, Carpathian J ournal of Electronic and Computer
Engineering, Volume 4, Number 1 - 2011, pp.97-100
[9] I. Orha, S. Oniga, Assistance and telepresence robots: a solution for
elderly people, Carpathian J ournal of Electronic and Computer
Engineering, Volume 5, Number 1 - 2012, pp.87-90, ISSN 1844 - 9689
[10] [3.] A. Alexan, A. Osan, S. Oniga, AssistMe robot, an assistance robotic
platform, Carpathian J ournal of Electronic and Computer Engineering,
Volume 5, Number 1 - 2012, pp.1-4, ISSN 1844 9689
[11] Lamr, K, Veszprmi, K., Shaft Sensorless Control of a PMSM Drive
with Rectangular Field Proceedings of the International Conference
Kand 2002, Budapest, Hungary, p.6. 2002. ISBN 963 7158 03 0
[12] Lamr, K., Digital Control of Permanent Magnet Synchronous Motors
Proceedings of the Budapest Tech J ubilee Conference, Budapest,
Hungary, pp. 213-228. 2004. ISBN 963 7154 31 0
[13] PCWHD compiler & IDE http://www.ccsinfo.com/
[14] MPIDE https://github.com/chipKIT32/chipKIT32-MAX/downloads.



Fig. 10. The medication dispenser


Fig. 9 The medication User Interface

Das könnte Ihnen auch gefallen