Next Article in Journal / Special Issue
A Review of Medication Adherence Monitoring Technologies
Previous Article in Journal
Crude Glycerol as an Innovative Corrosion Inhibitor
Previous Article in Special Issue
Health Symptom Checking System for Elderly People Using Fuzzy Analytic Hierarchy Process
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:

Design and Feasibility of a Safe Pill Bottle

Electrical and Computer Engineering Department, University of Alabama in Huntsville, Huntsville, AL 35899, USA
Department of Psychology, University of Alabama at Birmingham, Birmingham, AL 35294, USA
Milken Institute School of Public Health, The George Washington University, Washington, DC 20052, USA
Author to whom correspondence should be addressed.
Appl. Syst. Innov. 2018, 1(2), 13;
Received: 5 April 2018 / Revised: 28 April 2018 / Accepted: 3 May 2018 / Published: 6 May 2018
(This article belongs to the Special Issue Healthcare System Innovation)


Ubiquitous intelligence of Internet of Things (IoT) objects and new sensors provide innovative solutions for a variety of health issues. Unintentional child poisoning represents an increasingly important health issue worldwide, partially because of an increase in the use of drugs and food supplements. Although child-resistant bottle caps have probably saved many lives, they are not foolproof and do not provide warnings for parents and caregivers when children try to access the bottles. In this paper we present a design, implementation, and feasibility analysis of an intelligent “safe pill bottle” that can identify when a child is trying to open a bottle and then generate an immediate warning to deter a child from opening the bottle and send alerts to parents/guardians. The bottle controller uses capacitive sensing to identify the class of user. We present the results of pilot testing with eight adults and eight children using neural networks (NN). With 474 bottle-opening events, our NN had 96.4% accuracy of predicting whether the user was a child or an adult. Preliminary results demonstrate that smart pill bottles may be an effective tool to prevent unintentional child poisoning.

1. Introduction and Background

Unintentional child poisoning of children under six years of age represents nearly 50% of the 2.4 million poisoning exposures reported to US poison control centers annually [1,2]. Moreover, not all exposures of children ages 0–5 years are reported to poison control centers, so existing numbers are believed to be underestimates. Currently used child-resistant caps have proven to be an efficient method of saving young children’s lives, but they are not foolproof. Federal regulations permit child-resistant caps to be used if they are opened by 20% of children ages 42–51 months within 10 min (16 CFR 1700.20). Furthermore, child-resistant caps are frustrating to many consumers, including elderly and disabled individuals.
There are at least two primary reasons for high child poisoning rates. First, medications are more available than ever in our homes. The presence of prescription drugs, over-the-counter medicines, vitamins, herbs, and dietary supplements near young children is extremely common, and the simple presence of dangerous items in the home increases the odds of young children encountering them and unintentionally poisoning themselves [3]. Second, because of our fast-paced lifestyles, adults might forget to properly store medicine away from children’s reach, or a parent or grandparent might forget a pill bottle is in a handbag or briefcase. Young children who discover medicine while adults were not looking comprise 95% of unintentional medication overdose ER visits [4].
New sensing technologies and biometric identification may detect a variety of hazardous events. Biometric authentication could ensure that the right person is accessing the right data. The most popular biometric authentication methods include fingerprint authentication based on 2D image processing techniques to extract unique physiological features of the user [5]. Palm features, such as palm prints and palm-vein networks have been proposed [6,7]. Zhang et al. proposed a technique using 3D surface curvature maps for feature extraction [8]. All methods demonstrate that hand geometry and surface curvature influence the contact area with an object and allow for unique identification of the user. Changes in contact area and pressure influence capacitance of the skin to object interface [9]. We propose a new method of identification of the class of users and detection of critical events when a child is trying to open a pill bottle.
The Internet of Things (IoT) introduced a paradigm where everyday objects feature identification, sensing, networking, and processing capabilities that allows them to communicate with one another and with other devices and services over the Internet [10]. Ubiquity of IoT sensors and services provides an opportunity for new devices and services. Smart pill bottles, such as the AdhereTech smart pill bottle [11], are increasingly used for monitoring of drug compliance. We plan to expand the existing functionality of connectivity of the smart pill bottle with detection of critical events to prevent child poisoning. The same technology can be used to reduce child poisoning from other household products. Our preliminary results demonstrated feasibility of use of capacitive measurement to identify the class of user (child vs. adult) [12].
Widespread use of capacitance-based human–computer interfaces motivates the integration of capacitance measurement interfaces in a number of commercially available microcontrollers. As an example, the microcontroller NXP MKL26Z64VFT4 used in the Teensy LC sensor platform [13] supports capacitive measurements from up to 11 pins with a default accuracy of 0.02 pF and a measurement time in the order of 1 millisecond. The microcontroller features low power consumption, a small 48QFN package, and a low price, thus making it suitable for embedded IoT platforms.
Herein, we describe a pilot study with the prototype safe bottle [12] to demonstrate the effectiveness of our system design for the real-time generation of warnings. Our sample comprised 16 participants: eight children and eight adults. The primary hypothesis of our study was that the system can properly detect users as a child (less than 10 years old) or an adult (more than 20 years old).

2. Materials and Methods

We implemented the prototype safe bottle with 15 capacitive segments around a standard pill bottle. The capacitive sensors were made of copper tape strips insulated with clear plastic tape. The first prototype featured 5 segments and provided insufficient resolution. Therefore, we implemented a second prototype with 15 capacitive segments, as shown in Figure 1.
Inside the bottle we placed an embedded microcontroller board and a battery. To facilitate measurements from multiple segments at a high sampling rate, we used two microcontroller boards: Teensy 3.2 [14] was used to measure capacitance from 6 channels and Teensy 3.6 [15] to measure capacitance from 9 channels and save data to an on-board microSD card. Capacitance was sampled at 50 Hz throughout the experiment. Teensy 3.6 served as the master controller that initiated measurements in each cycle and collected measurements from the slave board using serial (UART) communication.
In the pilot experiment we collected real-time measurements of capacitance to detect two classes of users: children (in our pilot experiment, ages 5 to 10 years old), and adults (over 20 years old). We asked 16 participants—eight adults and eight children—to open and shut the bottle 30 times, simulating taking a pill out of the bottle. We recruited participants as volunteers from our circle of friends and collaborators, in many cases using children and adults from the same family to represent a realistic use case scenario. Participants represented a range of racial, ethnic, and cultural groups. The average age and standard deviation of adult users was 33 ± 14.9 years, and for children 7.5 ± 1.5 years. The experimental protocol was approved by the IRB at the University of Alabama at Birmingham (approval number IRB-300000806).
The capacitance of all segments was constantly recorded with a sampling frequency of 50 Hz. Subjects were not instructed how to hold or open the bottle, as we wished to capture their natural patterns of bottle use. We collected a total of 474 events during the experiment, 29.6 events per user. Two hundred and forty-eight events were from adult users and 226 events from child users.

2.1. Signal Processing and Feature Selection

All signals were collected by the embedded controller and stored on the microSD card for postprocessing. All processing was performed off line using Matlab 2017b.
A typical example of the change of capacitance on two out of 15 segments during bottle opening is shown in Figure 2. As shown, depending on the contact area between the capacitive segment and the palm or fingers, the capacitance of segments increases from approximately 25 pF to 36–43 pF. A time sequence of contact with different sensor segments can be also seen; in this case, segment seven (S7) is touched first and released later. Segment capacitance fluctuates somewhat during the event, depending on the contact area and pressure. Figure 2 illustrates the change of capacitance for two segments only (S6 and S7); similar patterns of change during bottle handling event can be seen in all 15 segments. Both signals are filtered using a 3-point median filter to remove high frequency noise.
The user’s contact pattern can be characterized using the relative change of segment capacitance caused by contact with the palm or fingers. Each segment has a different default capacitance, as shown in Figure 2. Therefore, we calculate the relative change of capacitance CRi for each segment i (Ci) using default capacitance (Cdefi) before the touch, via Equation (1):
C R i =   C i C d e f i C d e f i .
Total capacitance Ct of all N segments is calculated as:
C t = i = 1 15 C R i .
The start of an event is recognized as a change of total capacitance greater than the threshold, which in our case is 20% higher than the default capacitance Ct. The region of interest (ROI) for each touch event is selected as the 500 ms period from the start of touch. We save the relative change of capacitance for each segment and characterize each event using the following parameters:
  • tRCC—total relative change of capacitance as the sum of all relative changes CRi, i = 1…N
  • CRmax = max(CRi), i = 1…N
  • CRNi—normalized change of capacitance
    C R N i = C R i C R m a x ,    i = 1 . . N
  • tRCCN—normalized total relative change of capacitance, calculated as sum of all normalized changes of capacitance according to Equation (3)
  • mspos—mid-segment position, calculated as a center of gravity of the sorted set of relative capacitances CRsorti
    m s p o s = i C R s o r t i i i C R s o r t i ,    i = 1 . . N .
Since touch capacitance depends on skin properties and current conditions, touch capacitance can be significantly different in the case of wet hands compared with contact with dry hands for the same user. Therefore, we use normalized changes according to Equation (3) and tRCCN to determine parameters that depend on touch area, not skin condition.
An example of the absolute change of capacitance (CiCdefi) for a child and an adult for each segment is shown in Figure 3. As shown, the smaller child’s hand is in contact with a smaller number of segments. Smaller contact area from the child also generated smaller change of capacitance on segments in contact with the palm or fingers. Note that because of the circular pattern of capacitive segments, with no markers on the bottle (as shown in Figure 1), each touch event will have a different distribution of values between segments, even for the same hand contact pattern with the bottle. That is the reason why we use sorted sets of relative changes (CRsorti) to generate the pattern, independent of the relative position of the bottle during opening, as defined in Equation (4).
Each user generates a specific touch pattern described with our set of parameters (Equations 1–4). As an illustration, a sorted set of normalized changes of capacitance for an adult and a child is represented in Figure 4. It can be seen that the adult has a larger contact area and more segments with significant changes than the child. The extracted parameter mspos represents the “center of gravity” of the change and the distribution of segments during a touch event. In this example, normalized change of capacitance for the 3 segments with the largest contact area has a similar change as the remaining 12 segments for a child (exact value is 3.29). For the same example, the adult has contact with more sensors, and therefore relative change of 5 segments is similar to the change of the remaining 10 segments (exact value is 5.17). Both values of mspos in Figure 4 were calculated according to Equation (4).

2.2. User Identification

Our preliminary investigation demonstrated effectiveness of user classification using both Support Vector Machines (SVM) and neural networks (NN), with the two techniques yielding similar performances [12]. Since NN had a slightly better performance and are suitable for embedded implementation, we present in this paper only the NN method of user class identification.
The extracted parameters demonstrate significant variability between users and even for different events from the same user. An example of the relationship between tRCC and tRCCN is presented in Figure 5. Because of the overlap of values, it is necessary to use multi-parameter user identification.
We used a 2-layer NN with 12 nodes in the first layer and one node in the second layer. All processing was performed using the NN toolbox in Matlab. In addition to the previously described parameters, we improved the performance by introducing two additional parameters:
  • CCdiff—difference of total capacitance from average total capacitance for all children (CCmean):
  • CAdiff—difference of total capacitance from average total capacitance for all adults (CAmean):
Values of CCdiff and CAdiff are calculated using total capacitance Ct, adult group capacitance threshold CAthresh, and group capacitance means CCmean and CAmean using the following pseudo code:
i f   C t   < C A t h r e s h                             C C d i f f   =   C t     C C m e a n                             C A d i f f   =   0 e l s e                             C C d i f f   =   0                             C A d i f f   =   C t     C A m e a n
Therefore, the NN feature set we used for class identification contains five parameters, defined as:
t R C C   |   t R C C N   |   m s p o s   |   C C d i f f   |   C A d i f f

3. Results

The average values and the standard deviation of the main event parameters are presented in Table 1. Although the mean values demonstrate significant differences between groups, individual events demonstrate significant variance, even for the same user. Therefore, we used multi-parameter user classification.
We selected the first eight subjects (four adults and four children) to train NN, and the remaining eight subjects to test the network. During training, 80% of events were used to train NN, 15% for validation, and 5% for testing. The confusion matrix for the testing set is presented in Table 2.
We also trained and tested a neural network with all events from all 16 subjects. The neural network was trained with 70% of the events, validated with 15%, and tested with 15% of the events. The confusion matrix for that test is shown in Figure 6. The receiver operating characteristic (ROC) performance of the test is shown in Figure 7.
Training of the NN was performed off-line to optimize NN weights for classification, with bias for maximum accuracy for detection of children. NN weights were then implemented on an embedded microcontroller for real-time classification of an event. Processing time for a selected set of features is less than 1 ms. Therefore, total processing latency is 500 ms for data collection, and 1 ms for signal processing and classification, which allows the controller to work in real-time and generate timely warnings without delay. A long data collection window is necessary for a stable input data signal, as can be seen in Figure 2, but subsequent prototypes will be able to implement an on-bottle warning that is generated immediately to deter a child and to send a message to supervising adults through Wireless Local Area Network.

4. Discussion

Results from this preliminary study of 16 participants demonstrate the feasibility of the proposed concept of a “safe bottle” that can recognize the class of user as a child or an adult. Accuracy of the NN was approximately 97%, with an error rate of just 3%. Furthermore, we emphasize that the safe bottle is intended primarily to protect children 0–5 years of age from unintentional poisoning, and our pilot test used for pragmatic reasons (availability, developmental maturity to complete the task) children with an average age of children 7.5 years (range = 5–10). We greatly outperformed our initial goal of less than 10% of errors for children ages 0–5.
Ultimately, we envision the use of “smart bottles” as devices that can replace or supplement current child-resistant lids on pill containers. We are unaware of any similar such initiatives in the field to improve the safety of children; the closest comparator we have located is a proposal, not yet prototyped to our knowledge, to use biometric characteristics such as fingerprints to restrict the use of firearms [16].
As our prototype moves into implementation, an embedded controller will be placed at the bottom or the side of the pill bottle, separate from pills in the bottle; this model replicates existing smart pill bottles from Adhere Tech [11]. Since medical or advertising labels can be taped over the sensors without changing their performance, safe pill bottles would look identical to currently-used standard pill bottles. Given the frequency of unintentional child poisoning, and the fact that the current technology of child-resistant caps is imperfect, smart bottles may offer an alternative that provides greater protection and higher efficacy than currently used strategies.
Smart bottle technology is not without limitations. There will be an increase in price per bottle, primarily because of the price of the embedded controller. Capacitive sensors can be taped onto the bottle or integrated in the bottle during injection molding of the plastic bottle. Although costs are likely to decrease over time, and re-usable bottles could easily be manufactured (consider the precedent of reusable glass bottles in many eras and jurisdictions), some consumers and manufacturers are likely to continue to choose the lowest-cost legal strategies to reduce the child poisoning risk, which currently are child-resistant caps. As costs decrease, industry and consumer decisions may change, as evidenced by the early commercial success of the Adhere Tech bottle [11].
Engineering limitations exist also. Current processing of the event and selection of the region of interest can be significantly improved. We currently use only 0.5 s at the beginning of the event to detect the average of values in the region of interest. However, sophisticated pre-processing can significantly improve noise immunity in recorded signals. Furthermore, our pilot test did not provide enough data for training of the neural network. We expect to conduct additional tests in the future.
Finally, there is potential to improve our use of neural networks. NN allow analysts to set the thresholds for class separation. The results presented for our experiment used the default NN threshold of 0.5. Sensitivity analyses suggest that modified thresholds would reduce the number of events when children are detected as adults, but would also increase the number of errors when adults are detected as children, or “false alarms.” Increased false alarms where adults are incorrectly classified as children might be preferred in our system over errors where children are misidentified as adults. With larger datasets, NN could be retrained based on feedback from users, thus optimizing performance for a given group of users.

5. Conclusions

Smart objects in the IoT age can provide better solutions for important problems. We presented data demonstrating the feasibility of using a safe pill bottle to prevent unintentional child poisoning. Our pilot study indicates that the approach is feasible, suggesting a safe pill bottle integrated into an IoT system [17] could provide warnings to parents and caregivers, reducing unintentional child poisoning risk. Similar methods can be embedded into other everyday objects that could potentially harm children, including cleaning fluids; alcohol, nicotine, or marijuana products; fuels; and so on. Ultimately, intelligent bottle designs might detect all critical events, such as children trying to access dangerous products, and generate aural and visual warnings to deter children. The bottle could also communicate information about events to a central server that would immediately notify parents/guardians about possibly critical events using preconfigured messages and modalities. The server would also store data for identification of patterns and re-conceptualization of potential poisoning situations. We plan future work along these lines, including system integration and additional optimization of processing to reduce the number of critical errors.

Author Contributions

E.J. proposed the concept and implemented the prototype safe bottle. B.T. and E.J. wrote embedded programs and performed record processing and analysis. W.D.E, D.C.S., and E.J. designed experiments and data processing strategies. D.C.S. and E.J. performed the experiments. All authors participated in the writing and editing of the paper.


This research was supported in part by UAH Charger Innovation Fund grant 602079. We appreciate help from Anna Johnston and the UAB Youth Safety Lab to organize experiments and data collection.

Conflicts of Interest

The authors declare no conflict of interest. The founding sponsors had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.


  1. Schwebel, D.C.; Evans, W.D.; Hoeffler, S.E.; Marlenga, B.L.; Nguyen, S.P.; Jovanov, E.; Meltzer, D.O.; Sheares, B.J. Unintentional child poisoning risk: A review of causal factors and prevention studies. Child. Health Care 2017, 46, 109–130. [Google Scholar] [CrossRef]
  2. Mowry, J.B.; Spyker, D.A.; Cantilena, L.R., Jr.; McMillan, N.; Ford, M. 2013 Annual Report of the American Association of Poison Control Centers’ National Poison Data System (NPDS): 31st Annual Report. Clin. Toxicol. 2014, 52, 1032–1283. [Google Scholar] [CrossRef] [PubMed]
  3. Schwebel, D.C.; Wells, H.; Johnston, A. Children’s Recognition of Dangerous Household Products: Child Development and Poisoning Risk. J. Pediatr. Psychol. 2015, 40, 238–250. [Google Scholar] [CrossRef] [PubMed]
  4. Nierenbert, C. Medication Leading Cause of Child Poisoning in U.S. Available online: (accessed on 4 February 2018).
  5. Meng, W.; Wong, D.S.; Furnell, S.; Zhou, J. Surveying the Development of Biometric User Authentication on Mobile Phones. IEEE Commun. Surv. Tutor. 2015, 17, 1268–1293. [Google Scholar] [CrossRef]
  6. Sajedi, H.; Moghaddam, B.G. Personal Authentication by Palmprint Using Contourlet Transform and k-Nearest Neighbour Classifier. Int. J. Mach. Intell. Sens. Signal Process. 2016, 1, 287–303. [Google Scholar] [CrossRef]
  7. Fei, L.; Xu, Y.; Zhang, D. Half-orientation Extraction of Palmprint Features. Pattern Recognit. Lett. 2016, 69, 35–41. [Google Scholar] [CrossRef]
  8. Zhang, L.; Shen, Y.; Li, H.; Lu, J. 3D Palmprint Identification Using Block-Wise Features and Collaborative Representation. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 1730–1736. [Google Scholar] [CrossRef] [PubMed]
  9. Barel, A.O.; Clarys, P. Skin Capacitance. In Non Invasive Diagnostic Techniques in Clinical Dermatology; Springer: Berlin/Heidelberg, Germany, 2014; pp. 357–366. [Google Scholar]
  10. Whitmore, A.; Agarwal, A.; Xu, L.D. The Internet of Things—A survey of Topics and Trends. Inf. Syst. Front. 2015, 17, 261–274. [Google Scholar] [CrossRef]
  11. AdhereTech. Available online: (accessed on 3 May 2018).
  12. Talukder, B.B.M.S.; Jovanov, E.; Schwebel, D.; Evans, D.W. A New Method to Prevent Unintentional Child Poisoning. In Proceedings of the 40th International Conference of the IEEE EMBS Engineering in Medicine and Biology Society, Honolulu, HI, USA, 17–21 July 2018. [Google Scholar]
  13. Teensy LC (Low Cost). Available online: (accessed on 11 December 2017).
  14. Teensy 3.2, PJRC Store. Available online: (accessed on 3 May 2018).
  15. Teensy 3.6. Available online: (accessed on 11 December 2017).
  16. Adee, S. Guns That Fire Only for You. New Sci. 2015, 227, 25. [Google Scholar] [CrossRef]
  17. Jovanov, E.; Nallathimmareddygari, V.; Pryor, J. SmartStuff: A Case Study of a Smart Water Bottle. In Proceedings of the 38th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, Orlando, FL, USA, 16–20 August 2016; pp. 6307–6310. [Google Scholar]
Figure 1. Safe bottle prototype.
Figure 1. Safe bottle prototype.
Asi 01 00013 g001
Figure 2. Pattern of capacitance change on two segments during bottle opening.
Figure 2. Pattern of capacitance change on two segments during bottle opening.
Asi 01 00013 g002
Figure 3. An example of the absolute change of capacitance during opening of the bottle for an adult and a child.
Figure 3. An example of the absolute change of capacitance during opening of the bottle for an adult and a child.
Asi 01 00013 g003
Figure 4. Sorted and normalized capacitance of all segments and calculated values of mspos for an adult and a child; figure represents the same data set from Figure 3.
Figure 4. Sorted and normalized capacitance of all segments and calculated values of mspos for an adult and a child; figure represents the same data set from Figure 3.
Asi 01 00013 g004
Figure 5. Change of tRCC and tRCCN for adults and children.
Figure 5. Change of tRCC and tRCCN for adults and children.
Asi 01 00013 g005
Figure 6. Confusion matrices of the neural networks (NN) trained and tested with all events.
Figure 6. Confusion matrices of the neural networks (NN) trained and tested with all events.
Asi 01 00013 g006
Figure 7. The receiver operating characteristic (ROC) performance of NN trained and tested with all events.
Figure 7. The receiver operating characteristic (ROC) performance of NN trained and tested with all events.
Asi 01 00013 g007
Table 1. Average values of main event parameters; all values represent mean ± standard deviation.
Table 1. Average values of main event parameters; all values represent mean ± standard deviation.
tRCC5.92 ± 2.4018.85 ± 5.07
tRCCN4.90 ± 1.166.83 ± 1.58
midpos3.79 ± 0.715.40 ± 0.56
Table 2. Confusion matrix of the testing set of eight subjects (four adults and four children)
Table 2. Confusion matrix of the testing set of eight subjects (four adults and four children)
Adult118 (52.4%)2 (0.9%)98.3%/1.7%
Output ClassChild6 (2.7%)99 (44%)94.3%/5.7%
Target Class

Share and Cite

MDPI and ACS Style

Jovanov, E.; Talukder, B.M.S.B.; Schwebel, D.C.; Evans, W.D. Design and Feasibility of a Safe Pill Bottle. Appl. Syst. Innov. 2018, 1, 13.

AMA Style

Jovanov E, Talukder BMSB, Schwebel DC, Evans WD. Design and Feasibility of a Safe Pill Bottle. Applied System Innovation. 2018; 1(2):13.

Chicago/Turabian Style

Jovanov, Emil, B.M.S. Bahar Talukder, David C. Schwebel, and W. Douglas Evans. 2018. "Design and Feasibility of a Safe Pill Bottle" Applied System Innovation 1, no. 2: 13.

Article Metrics

Back to TopTop