Smart Pill Box

Untimed medicine administration can always show adverse effects on the health of the patients. The proposed system is designed to help these patients to take the required medicine in the right proportion at the right time. The basic ideology is integrating the principle of Alarm clock with Light based slot sensing on a normal pill box. An alternate to the light based sensing method using capacitive fields is also employed. To make it more state-of-the-art, it is inbuilt with a GSM module for alerting the patient and also the chemist at the needed instant.


Introduction
The fast paced life of people has always taken a toll on the people. The irony is that the new medicines are found for the never ending chain of diseases. These new diseases often require timely medication and course therapy for curing. But the busy life schedule of the people often let down the best procedure. Most common reason for the failure of a method of cure is the failure of the patient to administer the dosage in the right proportion and at right time.
The new awaited feature in these so called intelligent pill boxes is the availability of the automated alert system for the chemist to send the re-fill of the tablets. With the GSM technology, we are able to connect to most people around the planet. So a link between the patient and the chemist is employed using GSM. Also, it is not convenient for a fixed device to alert the patient nowadays. So portability is a necessity in this device.

Literature Survey
According to World Health Organization, over 80% of the people above the age of 60 years are prescribed medicines that are to be administered 2 -4 times a day. With the increase in Cardio vascular diseases and Diabetes among the peer group regular medicine administration has become a necessity. But among this another 40-60% is having the issues related to forgetting the taking of medicines at right time.
The current common techniques used in market for the reminder includes the normal alarm with a pill box.
But this does not check for overdose and wrong dosage among the patients.
It only uses a clock, which on passage of a set time generates an alarm. Moreover the timely alerting for the re-filling of the pill box to user is also absent resulting often in breaks in the course of therapy.
The sensing of slots of the pill box can be done by both Load Sensing methodology and by Light based sensing.
The advantages of the slot based sensing is that individual moment sensing is possible for detecting over dosage problems and incorrect dosage issues. The survey for various modes of sensing the slots has been performed both analytically and practically and comparisons between the modes have been performed.

sensing Methodology
Based on various references available, we have concluded to test the slot sensing using three main methods.
Milligram measuring Load Cell • Light based sensing • Capacitive based sensing • First we have checked for the characteristics of a Load Cell. By analyzing and studying the bigger version i.e. a Load Cell used to measure 50kg of mass, we felt it will be the most accurate method provided it is connected on the Centre of Gravity (CoG) of the box. The Load cell effectively reported the changes in mass at the corners of the box keeping the centre of mass intact. Thus the measuring is possible with just one sensor connected at the CoG of the box. But, the milligram measuring Load Cell was very expensive making it not suited for a commercial product.
The next method which can be used is light based sensing. It is found to be relatively cheap and more suitable method of sensing. This method is effective if slot based sensing is used. Thus each slot will be sensed with one sensor individually. The sensor employed is Light Dependent Resistor (LDR). The light blockade on the LDR will give maximum output voltage.
By studying the Table 1, it is observed that the light is totally dependent on the ambience illumination. On testing for an entire day with a 4g tablet on a normal LDR sensor, it is observed that the after blocking voltage is nearly the same (5V), the empty voltage varies as a function of ambient flux. The voltage will be maximum during the dawn and drops as the day progresses. After the noon, the voltage again rises to the maximum value till dusk. Thus, fixing a standard threshold voltage especially during night becomes difficult.
A specific design of structure of the slots can be developed, such that it will assist in not only sensing the presence of a medicine, but also the number of medicines in each slot. This design can be achieved specifically for a type of a pill. The slot includes placement of pills over each other, such that the increase in height of the pill pile will allow less light to fall on the LDR, thereby giving a higher voltage at the output.
The last method is capacitive based sensing where the change in frequency is proportional to the change in dielectric strength of the sensor. Here the arrangement is same as the light based sensing, i.e. slot sensing mechanism. The principle of working is that the medicine or tablets placed in the slot will produce a varying dielectric value leading to varying frequency than when it is empty.
where, C -Capacitance across the sensor Є -Permittivity of the dielectric medium A -Area of the conducting trace/plate d -Distance between the plates/traces The sensor developed is made to become a part of the potential divider at inputs of an astable multivibrator, which gives a pulse output with variable frequency for varying capacitances of the sensor. This frequency output can be monitored by a microcontroller which will count the corresponding number of pulses in a stipulated amount of time. The frequency is calculated using the following equation (2) f = 1.44(R3 + 2R2)C ----(2) Where, f = frequency of oscillations C = capacitance of sensor R3 and R2 = Resistances forming the potential divider 1.44 is the constant.
The unknown capacitance C shown in Figure 1 is the designed capacitive sensor, which is connected to the control terminal of an astable multivibrator. The capacitive sensor is developed by drawing conductive traces separated by dielectrics. The presence of a medicine pill will change the permittivity from the default permittivity of free space, hence there is a change in capacitance.
While understanding the Table 2, it is seen that the capacitance sensor yields an output that is dependent on the pill mass or area. Wider or heavier pills will yield lower count of pulses. Apart from that, there is a wide range of difference from the output due to touch from one's hand. The sensor also showed promise as it didn't get affected by the external surrounding as much as by the light.
Out of the proposed techniques, the capacitive based sensing proves to be the most suitable and appropriate Display Mode 3.
The Set Time and Date mode will enable the user to adjust the Time and Date of the display system according to his country's standard time. Referring to Figure 3, we can see that inside two selection options are given to adjust the date and time independently. Within the date or the time option, we can increment the values by using a loop and check function.
The Set Medicine Frequency module is for enabling the user to set the frequency of the medicine in a day and also set the convenient time for the alarms during the course. The entry to this mode is similar to the Set Time and Date mode. Initially the number of the times or the  option. It does not face the problem of inappropriate blockage of light or triggering due to external sources of light. The capacitive based sensing methodology also sheds the bulky appearance as in the case of the other methodologies. Also the design of the sensor is cost effective.

Software Algorithm
The smart pill box is designed to assist the users who are generally in the age group of a 50+ who tends to forget their periodical medicinal intake. The software that governs the control message flow is designed on ARM platform using Keil Software. The flowcharts given below explain the operations of the design under different conditions and their response. From the general flowchart of operation given above in Figure 2 we realize the most optimum code that will After the normal mode of execution, the alarm function checks for the time to map with the set alarm values. If the result yields positive, the GSM module is activated via the UART messages (AT commands) to call the user in his contact number. In order to activate a snooze option, the alarm_min variable is incremented twice thereafter. If the person fails to take the pill on time, another UART message to the GSM is sent for ringing again.
The detection of activity of box opening will trigger the Scan and result function. The loop for the reading the values from each sensor is defined via selection lines of the multiplexer IC. The received values are stored in the registers. The values stored in an array are again scanned for the values of the counter read. If they exceed the maximum set threshold, then a count variable is incremented. If the count variable value approaches the number of slots, the UART will send AT command to GSM module to set an SMS to the user or the pharmacy to refill the medicine box.
Once the box gets closed, count variable is checked for incremental updation. If it fails, then the snooze operation will be executed. Else, the next alarm value will be loaded to Alarm registers. Figure 4 above explains the operation of Scan and Alarm function.
The code not only covers the all necessary functions of the system, but also eliminates the possibility of a false alarm. For example, the user choosing to have his medicine before few minutes of the alarm will set the next new value of alarm registers as soon as he closes the box. This will prevent the unwanted ringing after the event.
Side heading 5 not found…

Design
The smart pill box is combination of two major parts: Sensor board and the Control board. The Capacitive based Sensor was finalized after the above testing owing to it its cheap and all time operation advantage over the light based sensor. The sensor board was fabricated using the ORCAD PCB wizard. For a prototype we designed a 2*4 matrix sensor board (Refer Figure 5). Each element in this matrix will form an individual slot for the medicine or pills. The individual sensor is connected to the interface board designed based on the principle of the astable multivibrator.  consumption by the GSM module. Alternatively, we can use Li-ion battery pack for easy portable use.

Working/Operation
The system will work as normal Digital clock by default. The Real time clock inside the LPC2148 will update the registers every 12000000 cycles. The registers are then loaded to the RAM of the LCD and hence displayed on the Screen. When the Set button is pressed, the display is cleared and message for setting the time is displayed. When the adjust button is pressed the time registers are updated and new value is displayed. The components can be changed by pressing again the Set button. The register is updated by incrementing the operation.
Similarly, the Medicine frequency can be set for an atmost of 4 times a day. Based on this individual alarm can also be set by the same operation. When the time register value equals the Alarm register value, PWM pulse is generated at the Pin connected to the Buzzer and the UART1 sends the AT command for calling the user to the GSM module.
When the box is opened, a delay timer is set for 2 minutes. At the end of 2 minutes, a buzzer will sound and a display message alerting the user that the box is open for long. If the box is closed before this alert, the timer is interrupted and reset. Once the box is closed, the selector lines are updated one by one to read the current frequency value of the sensor. The sensor slot with very high frequency will be considered empty and a count register will be incremented. The user will be aware of the scan, as the message will be displayed on the LCD screen at this moment.
As the count value is near to 85 % of the total slots in the medicine box, the UART will send AT command to GSM module to send a SMS to the pharmacy or the user alerting him about the need to refill the pill box. The box has to be scanned while it is closed to obtain results with minimum external interferences.

Experimental Result
The system was tested in office and home environment and passed the test with ease. The system was successfully tested for 10mg tablets. Below 10mg, the results were marred by interferences from the surrounding. A higher sensitivity sensor will result in cross-talk between the sensors.  The sensor output is multiplexed to the controller board (LPC2148) via the multiplexer IC. The selector lines receive inputs from the microcontroller. The microcontroller is interfaced with two output modules. The LCD module for display operations and Buzzer for alarm function. Additional switches and push buttons are connected as inputs to adjust the register values. The GSM module is connected via the UART.
The GSM module (SIM300) is interfaced to the controller for sending messages to the Chemist and to the patient as an alert system. The numbers to be accessed by the GSM is read from the microcontroller's memory. Also the time for setting the alarm will be accessed from the microcontroller. This will help the chemist to find any case of over dosage or under dosage.
To reduce the interference from the nearby sensors a one side conducting MYRAL material division is created between each of these sensors. The clock is powered by external AC to DC adapter owing to high power The system can be often be limited by the network problems or engaged/busy lines of communication. These additional solutions will result in higher price and often unfeasible keeping in mind the portability of the system.

Conclusion
The solution of this complication is supplemented by the development of an advanced technology supported pill box called the Smart pill box. This technology is derived by combining the two vintage experiments from our technical education.
The smartness of the pillbox is achieved using cost effective slot sensing techniques like capacitance based slot sensing. These simple efficient techniques are supported by advancements like GSM technology to bridge the gap in communication between the supplier or the chemist and the customer or patient, thus aiding the patient.