The Automatic Medication Dispencer

 by janw
Contest WinnerFeatured
SDC11157.JPG
SDC11156.JPG
SDC11159.JPG
SDC11160.JPG
SDC11161.JPG
SDC11136.JPG
SDC11139.JPG
SDC11132.JPG
I wanted to make something for the health contest, but I had no clue where to start until my girlfriend got ill. I noticed how easily she forgot to take her prescripted medication and that made me think. A lot of people, especially elderly people, take a lot medication on a daily basis to stay as healthy as possible. Some of that medication needs to be taken on a exact time, or they don't function as well.
So I decided to make a machine that automatically gives the right pills at the right moment and also sounds an alarm so that the person who needs those pills knows it's time for his or her medication.

It is my first 'big' project that combines a clock/calender, memory and movement.

If you like it, then please vote for it in the Health contest.
 
Remove these adsRemove these ads by Signing Up

Step 1: What does it do?

SDC11157.JPG

The 'machine' has seven drums (one for each day of the week) with 4 compartments that you can fill with your medication. When filled, you put them back in the machine and connect them to it.

On the front of the machine is a lcd-screen and 2 buttons. There you can set the time and date and program when you need the medication.

When it is time for your medication, the machine drops the correct pills and sounds an alarm until you take the pills and push a button. After that it goes back to "sleep" until the next alarm.


1-40 of 165Next »
janw (author) says: Dec 30, 2010. 1:43 PM
Note to everybody who are interessed in the code: I am rewriting the Bascom code for this project and will publish it as soon as I have finished it. But a newborn baby around, they work doesn't go very quickly.
heebey says: May 15, 2013. 7:02 PM
Is it possible at all to get the code for this project?

Thank you.
esoolo says: Apr 14, 2013. 3:06 PM
The system could also have only one stepper motor, if all the dispensing drums were linked to each other via a pair of pins like the disks in a combination lock: http://www.instructables.com/id/3D-Printed-Combination-Lock/
simjan says: Mar 20, 2013. 4:51 PM
Hi, just wanted to know what kind of motors are you using?
I take it you are using bipolar stepper motors? also how many phases are each of the motors?
janw (author) in reply to simjanMar 21, 2013. 2:20 AM
Good question. It took me a long time to figure out what motors they were (I got a batch of them very cheaply for somewhere). The motors have 3 coils with internally connected common. So 4 wires: 1 common and 1 for each coil. They have only 15 steps so they really 'jump' from step to step but that was not a problem in this machine but I wouldn't recommend them for CNC stuff.
Alapakiboy says: Mar 30, 2012. 8:34 PM
Hello,
Im helping my friend develop something similar for her senior project and she is planning on using it for grandmother afterwards. Would it be possible if you can help us out with the parts list & how the programming was done. We are planning on adding few more features in it as well and ur help would give us more time to spend on the new features. Your help would be greatly appreciated.
I have built an RC controlled lawmower recently that I can share the instructions for if you like to build one..heeh
Here is my email: alapakiboy@yahoo.com
Thanks,
Mike
jevans10 says: Feb 3, 2012. 7:42 AM
Great Job! Do yoiu mind adding me to the list please?.

ebmstsscjs@yahoo.co.uk
rainbowangel says: Jan 16, 2012. 9:46 AM
please give me the codes...:( for avr...coding is very tedious..going wrong all time..anyone who did it can u give the codes?. id is rainbowangel2013@gmail.com
need it urgently as i am doing this as my project:)
Rahul16 says: Jan 22, 2011. 10:07 AM
hi, i have completed the coding and used PROTEUS Software to simulate the design. but the clock is slow compare to real time clock. can u tell me what frequency oscillator is used for both atmega and ds1307. and also specify current rating for power source for microcontroller and stepper motor driver.
thanks.
rainbowangel in reply to Rahul16Dec 27, 2011. 10:37 PM
if you have the code for this pill dispenser..will you please mail it to me?need it urgently for my project..to my mail..
vinay.pisharody@yahoo.com
please sent it:) need it asap...
janw (author) in reply to Rahul16Jan 22, 2011. 12:12 PM
Hi congrats with your simulation. I am still hoping to rewrite the code but my little newborn daughter sucks up a lot of my time so it will take time.

The clockspeed of the atmega is 8Mhz and is generated by the internal oscillator.

The DS1307 uses a 32.768Khz crystal as requested in the datasheet.

I used a 12V 2A supply for this project. I had it lying around and it was enough so I have to recalculate how much the project really needs to give you the exact current
Rahul16 in reply to janwJan 22, 2011. 2:22 PM
hi again, actually i m troubling with stepper motor rotation. the program i designed is just for rotating stepper motor for certain angle. and when alarm clicks again it goes back to initial position and rotates for same step angle. i need your help in this part , i want it to remember the position (angle) it had already rotated and start from same angle in place of going to back to initial position (angle). hope u understood my problem. please help me with this part of programing.
janw (author) in reply to Rahul16Jan 23, 2011. 3:59 AM
It shouldn't jump back indeed. The steppers I bought came without any information and have 4 leads. By testing them, I found out that they have 3 coils + a common GND and that they have 15 steps in a full rotation. Instead of giving pulses to a stepperdriver, I connected PB0 to PB2 to each coil via a motordriver.

The pinnumbr of the port is placed in variable i and then you can state something like (This is how it works in Bascom):

PORTB.i = 1 to activate a coil and PORTB.i = 0 to deactivate it. By placing it in the variable i, the program will always know what the last coil was and by increasing, you go forward, by decreasing you go back.
Rahul16 in reply to janwJan 22, 2011. 1:48 PM
thanks for info, so u mean i dont need to connect external oscillator for atmega. and one more thing the main input consist of two supplies (12 v and 9 v). so the current rating is same for both. i thought giving it a advance feature like remote control setting of alarm time using IR Remote and adding a digital thermometer . hows that?
janw (author) in reply to Rahul16Jan 23, 2011. 4:03 AM
You do not need an external oscillator indeed. You only need 1 of the 2 supplies, go for 12V, the 9V is for a backup battery.

Adding a temperature sensor is very easy. use an I2C one and just hook it up to the same lines as the DS1307. The datasheet will provide you with the correct way of adressing it.

I have not much experience with IR controles but I am sure that you can figure it out.
cpetrep says: Oct 3, 2011. 3:04 PM
Could you send me a copy of the specifications?
The sizes of the drums and the code
I am trying to complete a project for my digital II class similar to this.
purejunk86@gmail.com
Thank you
bryandhispup says: Aug 3, 2011. 6:38 PM
I could really use one of these but I know Diddly about circutry and microcontrollers and etc... good thing I was friends with all kinds of people in HS and I didn't burn my bridges with the "nerds". I just hope one would be willing to make this for me about cheap as free... LOL Great Job!
endl3ss says: Jul 23, 2011. 9:52 PM
very awesome machine.. Great Job.. i sent you a pm^^..
braidex says: Jun 6, 2011. 3:55 AM
hi, this is a very nice project...please can you send me the complete code, circuit diagram and how you designed the hardware, anything to help me do this project....this is my email:(braide4all@yahoo.com).....thanks
eangrohl says: Mar 21, 2011. 4:02 AM
Sir, could you send me the schematic diagram of the project, please? Or the circuits you used. I want to know how it is built. We have similar project. Thank you sir.
janw (author) in reply to eangrohlMar 21, 2011. 12:23 PM
hi,


The schematic is in step 4.
Rahul16 says: Jan 9, 2011. 11:44 PM
HI. can i use 16f877 microcontroller in place atmega8. suggest me some microcontroller which can replace atmega and please provide pin connection too. please
janw (author) in reply to Rahul16Jan 10, 2011. 8:33 AM
I only use AVR microcontrollers so i have no idea if you can use a 16f877. You have to look into the datasheets to see whether they are compatible.
ironmambob says: Jan 8, 2011. 6:21 AM
I've been a family medicine doctor for over 30 years. This is a great boon to the elderly and cognitively or memory limited. I'll try to make one, or if you have one available buy one for my mother in law.
Katie5757 says: Dec 30, 2010. 6:19 PM
Methinks you are reinventing the wheel here..
If someone is so confused that he/she cant remember to take his/her pills, then how the heck is he/she going to work out how to fill up this darned thing.
As an intellectual/electronic exercise yessss.. but you can have a watch tell you when it is pill time.. if that person doesnt know which pill to take, then he/she shouldnt be in charge of anything, let alone such a device...
I take one pill a day.. and that can elude me.. so I have a little chart, that I tick off the minute I swallow it.. on a bit of cardboard.. 7 days.. anyone interested, of course I will share.. but ho hummmmmm.. .. get real.
I am somebody's grandma.. nuff said.
Soose in reply to Katie5757Jan 6, 2011. 6:03 AM
I've lived through this with four elderly ill people, as have neighbors and friends. A caregiver has a list of meds and when they are to be taken. It's too much for the elderly person (or the ill younger person who might be confused by meds) to remember or to sort through. They might be independent in living skills except for this one problem.

The goal is to keep them as independent as possible, while keeping them safe from overdoses or underdoses. And to relieve the caregiver of extra chores reminding and overseeing the meds.

In all the cases I'm familiar with, the caregiver loads weekly pill boxes (the ones with compartments for AM, PM, etc, and for 7 days/week. It can take 20 minutes to 30 minutes but it's done only once a week, saving lots of time.

There comes a time when the elderly person starts forgetting what time of day to take their pills, then forgets what day it actually is. With all the week's pills laid out in the boxes, there is a problem. Some days they might take multiple days worth of pills; or for several days forget altogether even with reminders and calls. Solving this one problem with an automated dispenser can keep them living independently longer. And save the caregiver multiple trips in the week to dispense pills, or prevent having to hire someone to make multiple trips.

I really appreciate this Instructable. We have the need at the moment and the skills to create this project and it will do all of the above, for a while. If we can do this, confusion about meds will not be the one problem that sends an elderly person into the nursing home prematurely.
salandstef in reply to Katie5757Dec 31, 2010. 11:10 AM
For another opinion....

I take about 20 pills a day and have friends that take more and this box would be welcome by many in a similar situation. The problem for myself is that I could never make this box but it would be great if someone could refine it and produce them at a reasonable price.

Thanks for noticing the need and taking the time to come up with a solution.
janw (author) in reply to Katie5757Dec 31, 2010. 2:37 AM
Methinks, it's fun to reinvent the wheel from time to time and I never stated that the person who takes the pills should fill the machine.
jimsondefrancia05 says: Jul 2, 2010. 2:24 AM
pls send me the details on the codes and what language do you use? here my email jimsondefrancia05@yahoo.com
janw (author) in reply to jimsondefrancia05Jul 2, 2010. 8:34 AM
I use Bascom AVR to program
Rahul16 in reply to janwJan 4, 2011. 9:57 PM
could u please tell the algorthim of the program, or flow chart? just i need the concept of behind programming.
staka8 in reply to janwNov 3, 2010. 2:27 PM
would ask you if we could send a detailed project with instructions and how to program the eprom

staka
staka8@gmail.com
mwagner63 in reply to staka8Nov 20, 2010. 2:48 PM
Can you send me a copy of the specifications also?
my email is mattwagner92597@aol.com
thanks
mwagner63 in reply to staka8Nov 20, 2010. 2:48 PM
Can you send me a copy of the specifications also?
my email is mattwagner92597@aol.com
thanks
janw (author) in reply to mwagner63Nov 21, 2010. 3:49 AM
What specifications other than what is in here would you like to know.
mwagner63 in reply to janwNov 23, 2010. 1:43 PM
The sizes of the drums the code and everything else. You gave an outline not a detailed instruction. no offense it is a great idea.
janw (author) in reply to mwagner63Nov 26, 2010. 10:13 AM
I added pdf's with the the drawings of the drums and stuff.
spiderx says: Dec 30, 2010. 10:43 AM
From looking at the animation, it looks kind of iffy. Sure, the meds will dispense, but how to do you make sure only one dosage gets dispensed at a time? It seems to me there can be certain states of the motor where it will have two compartments open at a time.
janw (author) in reply to spiderxDec 30, 2010. 1:33 PM
it only opens one compartement at a time, but there is indeed a lot of wobbling gooing on. I actually want to build a new one with gears instead of steppermotors so that I can have a more fluent motion.
But I have so many other project gooing on so it will have to wait for a while.
jaycaplan says: Dec 30, 2010. 11:37 AM
This is certainly a good idea, but it has already been done and patented. I have been using The Sharper Image Pill Dispenser for about 8 years. Unfortunately it has been discontinued. But there are quite a few dispensers available at: www.epill.com
Sharper Image pill dispenser.jpg
1-40 of 165Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!