Introduction: Smart Pill Dispenser
Do you sometimes feel worried about your grandparents? Are you afraid that they'll forget to take their pills? that is why we made the Smart Pill Dispenser. Our Smart Pill Dispenser will help you help the elderly!
Note - In this Instructable we only have 2 types of pills but it will work with any number of pills you'd like.
Why Smart Pill Dispenser?
The Smart Pill Dispenser is a smart machine that will give your grandparents the pills they need, when the need it and in case they'll forget - you will get a notification about that!
How It Works?
The user will configure the relevant data about the pills - time of dispensing, amount of each pill and waiting time for notifying the family members that the pills were not taken.
Respective to the data, the machine will output the pill in the correct time into the drawer.
If the elder didn't take his pill within the required time then it will notify a family member about it via a telegram message.
Who Are We?
We are Danielle Guli Morad and Dekel Binyamin. Two Computer Scince students in IDC, Israel, who attend an IOT class in our third year.
Have fun building!
Mechanical Supplies -
- 1 x drawer
- 0.5m Tube (pill 1 diameter)
- 0.5m Tube (pill 2 diameter)
- Utility knife
- Hot glue gun
- 4 x Cuttable thin plastic
- Duct tape
Electric Supplies -
- 1 x ESP8266 WeMos D1 Mini board
- 1 x Arduino uno board
- 1 x Arduino board USB cable
- 1 x micro USB cable
- 1 x Breadboard
- 2 x Large Servos (MG996R)
- 2 x Small Servos (Micro Servo 9G SG90)
- 1 x Reed switch
- 14 x Jumper cables
Step 1: Prerequisite Programs
Step 2: Node-Red
Now, Install Node-RED following the instructions here: https://nodered.org/docs/getting-started/local
Connect to http://localhost:1880 and install the following modules (press menu -> palette -> install) :
- node-red-dashboard - https://flows.nodered.org/node/node-red-dashboard
- node-red-contrib-moment - https://flows.nodered.org/node/node-red-contrib-mo...
- node-red-contrib-chatbot - https://flows.nodered.org/node/node-red-contrib-ch...
Import our json code (copy the text from the txt file) by pressing menu -> import.
- Within the node-red code you will need to make 2 changes: Within the "date/time formatter" you need to change the "adjustment" according to your time zone
- Within the "SmartPillBotConversation" you need to change the "ChatId" (I will specify how to get your ID in the telegram bot setup segment)
Step 3: Arduino Code
Open the SmartPillDispenser.ino and make the necessary changes within it, these are marked with an arrow <---
The comments will let you know what each change does. After making the necessary changes you can upload the code to the esp8266.
Please follow the instructions in the comments of the code to properly connect the esp8266 to your laptop :)
Step 4: Telegram Bot
Setting up a bot in telegram for our use is very simple. (in depth tutorial with extra info here: https://core.telegram.org/bots )
In short you can use "father bot", https://t.me/botfather , to create you own bot. Get your chat id by messaging here: https://t.me/botfather , and writing /myid , plug this ID into the SmartPillBotConversation module within the nod-red code.
Chat id getter created by Iotwithus.com (THANKS!) -more info about bots and node red here: https://t.me/botfather Thats it! now set up the hardware and you are good to go! note that we made a debug mode within the GUI to help with testing while aligning the servos and the holes :)
Step 5: Connect the Wires
Build the circlets as shown in the diagram.
If you are unsure you may reference the Arduino code.
~ We had power issues due to the multiple servos on the 1 WeMos, so we added the Arduino Uno as a power source of one of the large servos, this resolved our issues.
Step 6: Customize the Tube
- Verify that the pill can go through the tube.
- Measure the servo height and mark the tube at that height (with a little extra space) - let's call that point A.
- Measure the size of the pill, and mark it's size on the tube from point A - let's call the new mark point B.
- Cut the tube across half way in point A. Make sure that you don't cut all the way through!
- 180 degrees from point A, cut the tube across half way in point B. Make sure that you don't cut all the way through!
- At the end point it should look like picture.
- Repeat steps 1-6 with the second tube.
Step 7: Separator
- Take the thin plastic and cut it into 4 D shapes around the servo's diameter.
- Glue each D to the servo.
- Make sure that the separator can go in and out the tube cuts you made without any problem.
Step 8: Place, Cut and Glue
- Place the 4 servos in the corners of the top of the drawer.
- Place the each of the tubes in the middle between two servos
- Mark around the tube and cut the drawer.
- Cut the drawer top based on the marks you made.
- Stop when you can see that the tube can go through the hole.
- Place the servos again and make sure that the cuts you made on the tube are exactly where the servo can go through.
- Glue the tube in the exact height that you managed to put the servo in.
- Glue the servos to the correct place.
Step 9: Reed Switch
- Make sure that the reed switch is capable of receiving input through the drawer.
- Glue the wireless part of the reed switch into the back corner of the drawer.
- Glue the wired part of the reed switch into the back of the drawer in the exact same corner.
Step 10: YOU ARE DONE!
You can now sleep soundly knowing your loved ones are properly taking their medication on time!
We hope you enjoyed the building process and would love to hear if you implemented any of your own features :)
Participated in the
Arduino Contest 2020