This project is my solution to the problem of medication non-compliance. Medication non-compliance basically refers to when a drug is not taken properly. This could be because someone forgets to take an important medication, someone takes too much of a medication, or someone takes two or more dedications that should not be taken together. This problem ended up costing Americans over $300 Billion last year in totally avoidable medical bills and ER visits. Among the aging population 30% of all early deaths were from this problem.
My project tries to solve this problem my making it easily to manage medications and prevent medication non-compliance. This is done by storing all your medications in a machine that can dispense individual pill on-demand. By allowing the machine to store the pills:
- You don't have to worry about mis-reading a pill bottle label and consuming the wrong medication.
- You are always reminded to take the correct medication at the correct time.
- The machine knows what medications you are taking and can make sure they don't conflict.
This project takes this concept much further by adding WiFi and allowing it to connect to the cloud. This enables the following functionality:
- Connecting to pharmacy APIs to get prescription information. Big pharmacies like Walgreens and CVS have APIs where you can get a prescription's info based in its barcode. In theory the machine could even order a refill when it is running low.
- Connecting drug usage information to doctors and family. Doctors will be able to see a patients drug consumption history and improve diagnosis and future prescriptions.
- The machine can connect to a drug interaction database that could improve the prevention of incorrect (over) prescription and dangerous drug interactions.
Another key feature that differentiates this project form other medicine reminder projects is the rich UI. Most projects allow the user to set a simple timer, daily, hourly, etc. but this doesn't allow for more dynamic problems such as pain medications. For example, some pain medications have a maximum limit, without a required schedule. The UI for this machine is designed to easily manage this type of use case by locking the dispensing of a drug until the max rate timer has expired. This can be very hard to manage without a robust software UI.
The machine is primarily controlled by a RaspberryPI. The PI runs a web server that serves a web-page to kweb running in kiosk mode with a PiTFT resistive touch LCD interface. The web interface sends CGI commands that control servos within the machine and read an encoder. The PI also has a WiFi dongle that allows for a smart phone to connect to the internal web server and manage the machine remotely. All inventory info and scheduling is stored in a local SQLite database. A custom power management and servo control board was designed for this project as well. Below is a block diagram of the machine.
Here are the software libraries used in this project:
Here's the extended video about the project. It shows the interface in action and the internal mechanics that make version 1 store and recall individual pills.