Pill Dispenser / Cat Feeder Project help

crakkers

New Member
Hi I need help with a school project that my teacher cant help me with!

I wish to make an auto pill tray. Its a bit like one of those auto cat feeders.

imagine a bowl split into 7 segments
imagine the bowl rotates 1/7th of a complete rotation, once per day
imagine the bowl rotating below a fixed cover that has an opening the size and shape of one of the segments

Thats my project!

i am thinking about a stepper motor to drive the bowl a precise amount of degrees (1/7th of a circle) I think I need a motor driver / controller too. I'd like to have a buzzer to sound when its time to take the pills that needs to be switched off by the person when they have taken the pills.

So basically, for example at 8 AM the bowl rotates into place and a buzzer sounds until a person hits the reset button. 24 hours later the cycle repeats.

BUT, i dont know what to buy and how to connect it together.

Can you please help / tell me what to buy and join up?

Thanks

Crakkers
 

oracacle

Senior Member
you shouldn't need a stepper, a micro switch and some form of detent on the rotor would do the job.

if you really want a to use a bi-polar stepper and driver you can pick up a pack of A4988 or DRV8825 driver for a around £10 on amazon. They are targeted at 3D printers and normally need 12v for the motor side

on another note you could use a 28BYJ unipolar motors and something like a ULN2003 or a set of 4 appropriate transistors.

a lot will depend on what you are able to manufacture and power constraints.
 

techElder

Well-known member
I have actually done this.

Use a gear motor because it is slow, has some power and runs on 5 volts DC. You might have to fabricate a pulley to drive the pill drum.
LINK: https://www.amazon.com/Cylewet-Motor-Shaft-Arduino-CYT1037/dp/B01N9MS3UZ

Or get at set of gear motors with wheels to use to drive the pill drum (and have some extra to make a weird "bot thing."
LINK: https://www.amazon.com/Electric-Magnetic-Gearbox-Plastic-Yeeco/dp/B07DQGX369


How will you know when the time has arrived to "pop a pill?"

NOTE: People don't like to be bothered by buzzers. Just sayin' ... :D
 

Hemi345

Senior Member
That's a cool project. The gear motor Tex recommended would be easy since you could simply time how long it takes to rotate the bowl between segments and then program that in to switch the motor on and off with a logic level n-channel mosfet (although when the batteries start to weaken, the motor may slow down and not rotate at the same rate). A PICAXE 08M2 would handle that and the button and buzzer.

Depending on how much time you have to create this project, stepper motors can be frustrating if you don't have the wires connected correctly but are very satisfying to use when you get your program working. A package deal like THIS helps with the connections...lots of online tutorials available for that product. You could make a PICAXE 08M2 work, but a 14M2 will be easier so you'll have more than enough pins to control the stepper, buzzer and button. Bonus points: light up a red LED when the 7th day's worth of pills is dispensed and the project needs to be refilled :)

Do you have access to a 3D printer at school? You could print the cover and bowl with an integrated female coupling that matches the D shaft on the motor.
 

crakkers

New Member
I have actually done this.

Use a gear motor because it is slow, has some power and runs on 5 volts DC. You might have to fabricate a pulley to drive the pill drum.
LINK: https://www.amazon.com/Cylewet-Motor-Shaft-Arduino-CYT1037/dp/B01N9MS3UZ

Or get at set of gear motors with wheels to use to drive the pill drum (and have some extra to make a weird "bot thing."
LINK: https://www.amazon.com/Electric-Magnetic-Gearbox-Plastic-Yeeco/dp/B07DQGX369


How will you know when the time has arrived to "pop a pill?"

NOTE: People don't like to be bothered by buzzers. Just sayin' ... :D

Thanks for this.

Are you saying I could use the geared motor with the PICAXE motor driver linked to a 08m2 board or a 14m2 board?
 

crakkers

New Member
That's a cool project. The gear motor Tex recommended would be easy since you could simply time how long it takes to rotate the bowl between segments and then program that in to switch the motor on and off with a logic level n-channel mosfet (although when the batteries start to weaken, the motor may slow down and not rotate at the same rate). A PICAXE 08M2 would handle that and the button and buzzer.

Depending on how much time you have to create this project, stepper motors can be frustrating if you don't have the wires connected correctly but are very satisfying to use when you get your program working. A package deal like THIS helps with the connections...lots of online tutorials available for that product. You could make a PICAXE 08M2 work, but a 14M2 will be easier so you'll have more than enough pins to control the stepper, buzzer and button. Bonus points: light up a red LED when the 7th day's worth of pills is dispensed and the project needs to be refilled :)

Do you have access to a 3D printer at school? You could print the cover and bowl with an integrated female coupling that matches the D shaft on the motor.
Hello,

n-channel mosfet - what is that? Sorry I did did not explain, I am a product design student not an electronics student, so my knowledge of all this is nil(ish)

Thanks so far
 

hippy

Senior Member
n-channel mosfet - what is that?
It is basically a solid state switch; send it a signal and it will close its contacts, which allows current to flow through a motor which allows it to turn -
Code:
                     .-----[(O)]----- V+
                     |
                   |_|     Motor
Control signal >---|_
                   | | FET
                     |
             0V -----^--------------- 0V
The CHI035 PICAXE-18M2 High Power Board may be the best choice for this project as it has four FET switches which should allow it to drive a DC motor or stepper motor -

 

crakkers

New Member
It is basically a solid state switch; send it a signal and it will close its contacts, which allows current to flow through a motor which allows it to turn -
Code:
                     .-----[(O)]----- V+
                     |
                   |_|     Motor
Control signal >---|_
                   | | FET
                     |
             0V -----^--------------- 0V
The CHI035 PICAXE-18M2 High Power Board may be the best choice for this project as it has four FET switches which should allow it to drive a DC motor or stepper motor -


Ok, got that - Thanks
 

AllyCat

Senior Member
Hi,

Whichever type of motor you use, it will need a "reduction gear train" (probably at least 100 : 1), the dc motor because it will rotate much too fast, the stepper because its torque (turning force) needs to be magnified. Therefore it makes sense to obtain a motor with a built-in gearbox, but that may restrict your mechanical design (size and method of coupling to the turntable, etc.). So you might want to design your own reduction/drive train, perhaps using a belt drive (rubber band) or worm gear (which can "drive around corners"), or a normal "clock type" compound gear train (Rev. Ed. sell some useful compound 3:1 nylon pinions), etc..

A dc (commutator) motor will be easiest to initially "get going", but has the disadvantage that its speed depends on the supply (battery) voltage and the load, etc.. Therefore, to ensure the "turntable" always aligns properly, you may ultimately need a position sensor such as a mechanical switch (often called a microswitch), a magnetic sensor (Reed or "Hall Effect") or optical sensor, either as a custom product or "DIY" with a LED and photosensor (Photo/IR diode/transistor or Light Dependent Resistor, etc.).

Thus a stepper motor may ultimately be "easier" because it can go as slowly as you want and its movement is totally repeatable (as long as it's not overloaded). A type often discussed on this forum and available on ebay was originally intended for air conditioning control flaps, it has a high gear ratio and is often sold complete with a "driver" (current amplification) board. Or (probably too ambitious for this project) there are really tiny stepper motors intended for the zoom or focus drive rings on camera lenses, designed to work on 3.7 volts. Not geared, but IIRC about 20 pulses per revolution.

Cheers, Alan.
 

techElder

Well-known member
I'm real disappointed! I left room for you folks to come up with this simple suggestion, but no joy! :D :D :D (Just kidding.)

Get a 360 degree servo to drive the rotation. I'm purty sure the old PICAXE can do servo rotation. :D

That way you get rotation and indexing to the 7-day regimen at the same time. No switches or hall-effect sensors needed!

There are so many servos "out there" that it is difficult to pin only one down with a web link.

PS. I'm always puzzled why anyone would apply a stepper motor to a battery powered circuit. They have to use a lot of power just to hold position.
 

AllyCat

Senior Member
Hi,

Hmm, I'm sorry but I have to disagree. AFAIK "Continuous Rotation Servos" basically have their feedback potentiometer disconnected or removed, so they would need an independent sensor or detent. In fact there's a real risk that they may "creep" (and consume power) if the "central off" 1.5ms control pulse is slightly incorrect in width (or the servo thinks it is).

Also, I believe the permanent magnets and pole pieces of a stepper motor (combined with the internal friction) make it less likely to need any power to "hold position" than a normal motor, particularly with a large step-down ratio gear train. One of the "really interesting" things I learnt in physics at school is that if a (step down) gear train has a power transfer efficiency of less than 50% from input to output (which is particularly common with worm drives) then it is impossible for the output to drive the gear train "backwards" (i.e. for rotation of the output shaft to turn the input shaft).

But it is of course important that the electronic drive circuit for the stepper has a "power off" state (i.e. a pulse drive) and doesn't only feed the coils with the four possible phases of current flow (i.e. two alternative directions through each of the two coils).

Cheers, Alan..
 

The bear

Senior Member
"you shouldn't need a stepper, a micro switch and some form of detent on the rotor would do the job".

I'm with Oracacle.
 

techElder

Well-known member
Hmm, I'm sorry but I have to disagree. AFAIK "Continuous Rotation Servos" basically have their feedback potentiometer disconnected or removed, so they would need an independent sensor or detent. In fact there's a real risk that they may "creep" (and consume power) if the "central off" 1.5ms control pulse is slightly incorrect in width (or the servo thinks it is).
Doesn't necessarily work that way in practice, though. :D Actually, I would tend to use the DC gearmotor, but a regular servo would also work if the mechanical contact and positioning mechanism is more like a "ratchet". That way it could push the bowl around just exactly 1/7 of a rotation on each stroke before being shutdown.

Nothing will be perfect.
 

goom

Senior Member
Some hobby servos are set up for multiple rotations (typicall 4 to 6 turns). They are aimed primarily at sail sheeting control for model sailboats. Since they have internal position feedback, just like a regular hobby servo, the output shaft will rotate to a fixed and repeatable position with simply a servo/servopos command. See this link for an inexpensive example:


If used to directly drive the tray, resolution would not be great, so a 4:1 reduction gearing would be much better.
I think that this would be the simplest solution since it does not require any position sensing hardware and only a single programming command to move to any of the 7 desired positions.
 

AllyCat

Senior Member
Hi,

As the OP is not an electronics hobbyist and perhaps not a model-maker, there are a few characteristics of Servos of which he may not be aware. My main concern is how much power it might drain from the battery in the 23 hours 59 minutes each day when it's NOT driving the turntable. Servos are normally intended for "occasional" operation, for example demonstrating a model or robot, and then will be disconnected from the battery by a manual switch. It would be possible for a servo to be designed to disconnect its feedback potentiometer and drive amplifier from the supply when the position control pulses stop, but do they (all) actually do this?

Any except the continuous rotation type will need to be "wound back" at the end of each week, but this might be conveniently combined with the "pill-reloading" process. As it can have a maximum of about 150 discrete "positions" (i.e. two degrees resolution in 50, for each daily segment in a single revolution), it might be wise to avoid a "multiple revolution" drive train.

Cheers, Alan.
 

techElder

Well-known member
... but a regular servo would also work if the mechanical contact and positioning mechanism is more like a "ratchet".
Move the bowl mechanism, withdraw the servo "pawl", power down and be ready for the next push. However, I have no intention of going further with this without the OP becoming more attentive.
 

mikeyBoo

Senior Member
hi crakkers,
Sounds like these guys have give you some good advice. A simple DC gear-motor should work just fine. If you look at the image below, it shows how to build a simple indexer. Once you get that working, the next step would be to add a Picaxe. Good luck with your project & most importantly have fun!

Indexer.jpg
 
Top