In this Instructables I will be describing how to build an automatic dog treat/food dispenser using an Arduino Duemilanove (the Uno is the newest version of the same board). The timer interval can be adjusted via a potentiometer and can be set to any min or maximum value in the code. This project does not require extensive coding knowledge knowledge and leaves a lot of space to be modified. It is also designed to use as few parts as possible while trying to keep costs down and dogs happy :)

Step 1: Parts Needed

Step one is to gather the parts needed.


1 or more dogs (these are imperative for quality control and testing purposes! Cats can be used as a substitute in a pinch but results cannot be guaranteed)

1 Arduino board (any arduno board will work i used an older Duemilanove )
1 Standard servo
1 potentiometer (any valued potentiometer will work, i used a 50kohm)
1 9v battery and holder

1 switch
1 LED (not required but fun for blinking)

1 1/4 (6mm) x 3.5" x 36" Plywood
2 sheets of acrylic 11" x 14" (you can use any thickness or even substitute it with plywood however you wont be able to see into the case)

Wire cutter/Strippers
Soldering Iron
Glue gun

*NOTES* - templates are provided as a reference when cutting the various parts however always double check as they may not be 100% accurate.
<p>Does anyone have the &quot;Timer.h&quot; Code?</p>
Would it be possible to set this up with a motion sensor? <br>I'd like a cat feeder were the cat would have to activate motion sensor to release a few bits of kibble each time to slow down there eating. <br>Is this possible I have never seen anything like this?
Can you use a stepper motor? And if so what changes in the cose?
is it possible to make this dispense once a day say at 8 o'clock and if so what would the code be after this change, i'm a novice when it comes to arduino so i would really have no idea <br>
<p>I would recommend using a DS3231 Arduino real time clock. This allows you to drop food at one or multiple precise times a day (ex: dispense at 8:00pm and 7:00am)</p>
Yes, but you'd probably have to make it a digital timer (not analog with the potentiometer) and you would have to use the time library found at: http://arduino.cc/playground/Code/Time
Is there a way to get the feeder to drop a variety of portion sizes? Say, anywhere from 1/4 cup to 1cup?
<p>Make the segment the size of the smallest segment and make each portion a multiple of that size. Then, just have it dispense multiple times depending on how much you want.</p><p>If this doesn't work, ask yourself why you need such granular control over pet food portions. Then use a screw-type feed mechanism and a weighing scale...</p>
<p>I'd say change the thickness (height) of the wheel dividers so that a quarter segment is the largest portion size you wish to drop. If you wish some segments to drop smaller sizes, install filler panels so the quarter segment only accepts a smaller portion size.</p>
what is the longest time that you could run the intervals without having to change the components loads or otherwise do you know how i would incorporate a digital timer into arduino because like i said i have never used it before, thanks <br>
<p>how do i adjust the timing</p>
<p>Hi, thanks so much for sharing this project. I'm in the works to building this and making my own adjustments here shortly. I did have a question. In Step 5 when you're building the wheel, I'm having a hard time grasping how you attached the wheel element to the actual rotating servo gear. Did you have an X shaped servo arm and glue that the acrylic circular cut out, or did you do this another way?</p>
<p>Am from pakistan doing computer sciences in UET TAXILA. I wanna say that thanks alot for such a good idea :) i made it as a fourth semester project :) my design is a little bit different :) tanks alot :) :) &lt;3 dear &lt;3&lt;3 </p>
<p>Any help making this respond to email?</p>
<p>im sorry can u make it without using potentiometer ???</p>
<p>im sorry can u make it without using potentiometer ???</p>
<p>Any advice how to interface this with twitter?</p>
<p>Great project and just what I've been looking for!</p><p>I am a complete newbie to arduino and am hoping someone can help me out with altering the design to incorporate a timer to facilitate 2 feedings per day (morning and evening). I've been looking around a bit trying to understand the code but I'm in a bit of a time crunch to get this project working so any help would be greatly appreciated!</p>
<p>this project helped me a lot I wanted to make one but couldnt find a way to dispense the food , untill now!</p>
<p>Thanks for great project!</p><p>How should I change the code to dispense food twice a day (every 12 hours)?</p>
<p>Thanks for the design! It has worked wonders. Since I live in an apartment I didn't have easy access to saws so I made mine entirely out of cardboard (it doesn't make it look very cool though). I added the &quot;Timer.h&quot; library to your code which allowed me to make the system dispense food at set timed intervals. I only need to find a better way to suspend the feeder over the dish before it is perfect. Once again, thanks a lot for this awesome design!!!</p>
<p>hello my name is Gonzalo am from Mexico, very good post I would like to know what the current regulator which is connected to pins 10 and 11</p><p>thank you</p>
<p>seems like you could use an actual cd for the wheel, am I right?</p>
<p>can i use micro servo instead of standard servo? </p>
<p>Thank you for the instructions! I made this for a school project, and I'm happy with how it turned out! I had some minor issues here and there, but your instructions are very clear. The templates where a huge help too. Keep up the good work! :)</p>
<p>Have you thought about making adjustments so it can be a remote controlled treat dispenser that will only distribute a treat or two at a time? I train animals and the commercial models are really expensive and prone to jamming.</p>
Iv messed with arduino a little bit in the past but Im lost when it comes to &quot;code&quot; I'm trying to figure out how to set timer for every 10 hrs, iv read the other comments but I'm still lost as to where to input the any new code
<p>Hi,</p><p>I am really interested in making this, but I want it to be an operant task, like the skinner box.<br>Can I adjust the code so that the treats will only be dispensed after a certain amount of button presses? Like, let's say I want the animal to press the button 5 times before the treats are dispensed.</p><p>Thank you in advance<br></p>
<p>Joyce, for having built a slightly simpler version based on this design for a different purpose, I can say that yes, the code can easily be modified to do what you want. Or even make the number of pushes random. </p><p>In fact it is very flexible. If you do not have programming experience, ask for help here or on Arduino, and you should be able to get people to help.</p>
Thanks for the detailed response Stuart.
Can someone please explain the purpose of the potentiometer?
<p>The potentiometer is used to set the delay in dispensing treats. The relevant code is </p><p><em>for(;potIn&gt;0;potIn=potIn-20)<br>{<br>//this is to make the LED flash every 100+potIn miliseconds<br>digitalWrite(11,HIGH); //set led to on<br>delay(100+potIn);<br>digitalWrite(11,LOW); //set led to off<br>delay(100+potIn);<br>}</em></p><p><em>potIn</em> is the value read from the potentiometer (0-1024) at the beginning. So the code works like this:</p><p>1) Read potentiometer value (that code is not shown here, but lets say you crank it all the way to 1024</p><p>//----------------------------------------start Cycle----------------------------------//</p><p>2) Turn LED on</p><p>3) Wait 100 + 1024 (value from potentiometer) x milliseconds</p><p>4) Turn LED off</p><p>5) Wait 100 + 1024 (value from potentiometer) x milliseconds again</p><p>6) set the new value from potentiometer as the original value (1024) - 20 or 1004</p><p>7) if this new value is greater than 0, go back to step 2 using the new value from step 6.</p><p>//----------------------------------------end Cycle----------------------------------//</p><p>So basically the code takes the reading once (step 1) and then cycles between steps 2 and 7, subtracting 20 each time until you get to 0 which then triggers the treat to be dispensed. </p><p>Cycle 1: potentiometer value = 1024</p><p>Cycle 2 potentiometer value - 20 = 1004</p><p>Cycle 3: potentiometer value - 40 = 984</p><p>....</p><p>Cycle N: potentiometer value - 1024 = 0</p><p>Dispense treat</p><p>The more you turn the potentiometer, the higher the starting value in step 1 (up to 1024) and the longer it takes to get down to 0. I'm not exactly sure why he set it up this way but there you go. Hope that helps. </p><p>P.S. In case it's not clear, even though he calls it potIn (and I call it the potentiometer value) in each cycle, that value is only read once prior to the first cycle.</p>
<p>how can i make to activate it every 8 hours?</p>
Hey...great tutorial...! <br>But i want to change the interval to 4 hrs.....?
Hello, I am trying to build this dispenser with my son and have a question regarding the servo wheel. What is the purple part? Do we cut an inner circle also?
Is it possible to use a DC motor instead of the servo?
I want to put multiple treat dispensers that are controlled by a (human controlled) button, is that possible?
This reminds me of a smaller version of a deer feeder ... <br>
THANK YOU !!! <br><br>I have been using the arduino for about 2 years now and NEVER seen a tutorial this will constructed and put together.<br><br>you are a very good teacher and maker and I appreciate you taking your time to help others.<br><br>- Jeff
That is a very nice work!!!... But can you be able to make it to dispense food two times a day? For example one in the morning and one at night time? Maybe add a timer code to andruino. Is that possible?
yes, you can by using millis(); to figure out how much time has passed in miliseconds since the arduino was swithched on. It'll reset to zero after about 50 days, how ever you could do somethng like this:<br><br>startTime = millis()<br>if(milis() - startTime &gt; 4320000) //12 hours<br>{<br> //run the code to drop a treat<br>}<br><br>see this site for a reference: http://arduino.cc/en/Reference/Millis
cool thank you! i will start ordering my arduino and other parts. oh, by the way, i have two dogs (one small and one large) and i have been thinking if i can split the wire to run two servo for individual food servings at the same time. is that possible also?
You sure can. You have two choices here, you could either buy a &quot;Y&quot; servo harness which will split 1 servo output in to to, however the servos will do the exact same thing. <br><br>The better option (although slightly more complicated) is to use the Arduino. The Arduino Uno board provides up to 6 PWM (pulse width modulation) signal which means you could control up to 6 servos independently. <br><br>You would use the second option like this: in the sample declare the new servo with the code Servo servoName; using the built in Arduino library. Where it says mainServo.attach(3); you would type servoName.attach(pinnumber);
thanks again!
Cool, nicely done!
Very nice instructible! The construction is clever and has a good balance of simplicity and function. The only change that I would make, would be to install a pin to support the food wheel on the side opposite the servo. This would make the design stronger by reducing the strain caused by the overhang of the wheel.&nbsp; You have my vote. Good luck.
Thanks for the input :)<br><br>I did think about adding a pin to support the front of the wheel, however i am still thinking of a way to have it somewhat removable from the front panel. i guess i could figure out some sort of clasp attached to the front panel that is easily removed.<br><br>It didn't seem to be a problem when i tested it as the wheel is only a few millimeters from the front panel which prevents it from falling off, however i am sure given enough time it will scratch up the front panel.<br><br>

About This Instructable




More by crazydeadmoth:Hack/Mod a concave arcade style button Arduino controled dog food/treat dispenser 
Add instructable to: