I have been playing around with microcontrollers for a while and wanted to try to branch out from tutorials. Before Covid-19, I didn't really have a set schedule and worked pretty long hours. My dog's feeding schedule was really starting to suffer and was leading to some visible discomfort. My area is also prone to flooding during hurricane season. Unfortunately, there were a couple of cases where I could not make it back home to feed my old girl. I needed to find a solution so, if I was unable to make it home, my dog would not go hungry. Instead of buying one for $30-$40, why not build one for $100+? Just kidding.
The feeder!My dog feeder uses an Arduino microcontroller. There were a few key features that I needed that most other versions of dog feeders did not have. Namely, a solution for power outage recovery feeding and addressing the issue of food getting stuck in the dispensing mechanism. My area also suffers from random power outages. The outages never usually last very long, so I didn't see a need for power redundancy. I also wanted something that was easy to take apart and clean. Be careful when washing the 3D printed parts, you can use warm water, NOT hot water unless you plan to print with ABS or PET-G.
The full list of features is as follows:
- Two feedings per day
- Accurate timekeeping with real-time clock
- Manual time change of real-time clock
- Manual feeding option
- LED indication of hall sensor and real-time clock failure
- Overview of feed times, current time, and feeding completions on the main screen
- Easy to navigate menu
- Power outage feeding resume (will feed when the power comes back on)
- Feeding times and completions safely stored in EEPROM
- Servo "jiggle" in the event of food getting stuck while dispensing
Demo Video coming soon!
What else do you need?- 4x M3-0.5 x 16 mm screws (encoder wheel)
- 4x M3-0.5 x 10 mm screws (servo bracket)
- 12x M3 hex nuts
- 4x M3 lock nuts
- 16x 1-1/2 inch (38 mm) Multi-purpose wood screws
- Wood glue
- 6x 0.315 x 0.118 inch (8 x 3 mm) magnets
- 1-1/2 x 1-1/2 inch (3.8 x 3.8 cm) wood for legs and servo mount
- 1/2 x 6 in (1.27 x 15.24 cm) wood for back and base
I recently obtained a 3D printer and thought, what better way to learn and put it to use than printing out custom parts for my pet feeder. Everything printed is PLA+ and was printed using an Ender 3 Pro using Cura as the slicer. The STL's for all the parts can be found on the Github project page. Link down below. Read the README file for printing instructions and slicer settings.
The housing is designed with convenience and simplicity in mind. No screws or nuts needed. Simply pop the components in and out. Each insert has 4 tabs that hold the components in place.
Even though I did initially mess up the LCD screen slot, I went back and fixed the model in Fusion 360. I was just too lazy to go back and reprint it. I used some extra M3 0.5 x 6mm screws I had lying around to secure it. There are four spacers at each corner of the LCD slot with holes in them so you can secure the screen if needed. Unfortunately, I never took pictures of the enclosure lid before I put everything in.
The encoder wheel attachmentThe wheel encoder wheel serves two purposes:
- Provides the Arduino with position feedback from the servo
- Attaches the rubber paddle to the servo
One feeding portion is equal to 1/6th (60 degrees) turn of the wheel. Use a food scale to measure out the amount of food your pet receives per feeding and then adjust the portion number until you get a range that satisfies that amount. I believe one feeding for me was about 173 grams of food. A portion size of 17 gave me a range of 170-177 grams per feeding. It all depends on the size of your kibble. Make sure the horn is sitting between the 8 M3 hex nuts.
This custom servo bracket also holds the hall sensor and mounts the servo onto a piece of 1-1/2 x 1-1/2 inch (3.8 x 3.8 cm) wood. The length of the wood will depend on where the servo sits (more on that later). There's plenty of room for error with the mount so don't worry too much about getting the length perfect.
Make sure you have chosen a powerful enough servo and set it to its max voltage. The one I chose produced 6.5 kg.cm @ 6 Volts
This makes up the food delivery system. The food comes down from the dispenser through the funnel and onto the chute and into the food bowl. Unfortunately, I did not take pictures of the chute rail before mounting it.
*Disclaimer* I did not take pictures of every step of the assembly process. Some of these pictures will have skipped steps, but I will still take you step-by-step for the frame assembly.
Makesuretopre-drillholesforanyscrewthatyouuse.Youdowanttosplitthewood!
This is the cereal dispenser I bought off of Amazon. There are some that have multiple dispensers if you have multiple pets and need multiple feeders, I only needed one. The brand is Honey Can Do, but I'm sure any brand will work.
The first thing I started on was removing the knob from the rod that connected to the paddle wheel on the dispenser. I used a hand saw to remove the knob. You can use a power tool if you happen to have one. Do not cut the rod further down where the silver part ends. Cut right at the base of the knob.
After you saw off the knob, remove the remaining material by cutting the 3 supports seen in the last picture above. This took quite a while. I imagine it will be faster if you have the right power tool. Once you remove those three supports, the remaining piece left on the rod itself should come off with a little elbow grease. You will have to sand down the part of the rod closest to the knob so that it will fit nicely into the encoder wheel.
Next, we start building the frame's base. I took the 1/2 x 6 inch (1.27 x 15.24 cm) wood and cut them into two 8 inch (20.32 cm) pieces. This will make up the base and the back of the feeder's frame. Apply some wood glue and use 2 of the multi-purpose nails to join them in an L shape. You will need to add a couple of right-angle supports to reinforce the back panel and bottom panel connection. Use 4 multi-purpose screws and some wood glue to secure them to both the back and bottom panels. I do not have a picture of this step, but you can see them in pictures further down.
From here you have to cut the dispenser stand to a height of about 4.5 inches (11.43 cm). It doesn't have to be perfect. Try to get it as close as you can. The funnel allows for some wiggle room. Once you have the stand cut down to size, place it up against the back and make sure it is sitting flat on the base. Once you have it in position, use a pencil or pen to mark the center of where the dispensing end of the container will be. You will then need to drill a 2 inch (5.08 cm) hole all the way through the base panel. It is critical that you measure twice and cut once with this one. That will be the hole seen in the picture above.
Once you drilled the hole in the base panel, we are ready to attach the dispenser stand to the back panel. What you want to do is set the stand against the back panel (shown in the first picture below). There are two cubby areas under the ring of the dispenser stand. This is where you want the holes to be (see picture below). Use a pencil or pen to mark the height of where the two holes should be on the back panel. You want them as close to the center of the dispenser stand as possible. There are two screws that connect the top ring of the stand to the lower part that you cut off. Be careful not to hit those when drilling. Again, remember to measure twice and drill once. Or twice, in this instance.
Now that we have the holes drilled, we can attach the stand to the back panel using the 5/16 inch hex bolts, 5/16 inch hex nuts, and 5/16 inch washers. You want to go ahead and push the bolts through making sure you place washers at the hex end of the bolts before pushing them through. After they come out the other side, place the other set of washers on the threaded side and then start to hand tighten the hex nuts. This is going to be a little tricky. After you hand tightened the nuts you will have to use a socket to hold the nut and tighten them further. Only about 1/4 turn or so. Be careful not to overtighten.
Now that the stand is safely secured we can now add the 1/2 x 1/2 inch piece of wood that the servo is going to sit on. The length of this is going to depend on where your servo will be sitting. Go ahead and assemble the feeding mechanism by attaching the servo to the horn on the encoder wheel and the encoder wheel to the rubber paddle inside the plastic container. Set the container down into the top ring and measure where the servo sits from the base panel. Don't worry about it being perfect. The servo bracket allows for quite a bit of wiggle room. Use wood glue and a single multi-purpose screw to secure the wood stand.
The next step is attaching the legs to the base panel of the feeder. The length of the legs is going to depend on how high your pet's food bowl is. My dog has her food bowl on a raised stand; therefore, I needed my feeder to sit quite high. Use 4 of the multi-purpose screws and some wood glue to secure them in place. I do recommend putting a cross beam between the two front and two back legs and another cross beam between the cross beams as shown below for added stability. Use a total of 6 multi-purpose screws and some wood glue to secure the pieces to the legs.
The next steps are:
- insert the funnel into the hole we drilled in the base panel
- attach the servo to the servo bracket
- secure the bracket to the wood stand
Attach the servo to the bracket using the 4 M3 x 10 mm screws and 4 of the M3 hex nuts. Once the servo is secured, we can secure the bracket onto the wooden servo stand. Use two of the multi-purpose screws to lightly secure the bracket onto the wood stand. Do not overtighten or you will damage the bracket. Make sure you do the steps in that order. The funnel is going to raise the servo a bit and it fits pretty snug against the end of the plastic container so it's impossible to put on if the plastic container is already sitting in the top ring stand.
The final steps will be to attach the chute's slide-in bracket and the slide itself. You want to position the bracket slightly behind the hole in the base panel. You want it as far forward as you can get it so that the slide clears the frame of the feeder. Use two of the multi-purpose screws to secure the bracket to the bottom of the frame's base panel. It's best to do this with the slide in the bracket as the bracket has some flex and you're going to want a pretty secure fit between the slide and the bracket.
Unfortunately, I never took pictures of the soldering process. There isn't much to it though. Just solder each component to its corresponding pins and you should be good to go. If you would like to use pin headers instead, you can also do it that way. There is enough clearance under and above the Arduino slot to allow for the pins and connectors. I definitely recommend soldering everything together before setting all the components in their respective slots.
I powered my Arduino through the unregulated external power pin (pin 30). This requires an input voltage between 7-20 volts because this voltage is fed through the Arduino's onboard regulator. If you wish to power it via USB, you just have to make sure that you are supplying it with 5 Volts, NOT the 7-20 Volts.
Be sure to solder the 10k Ohm resistor between the Vcc and Signal pins on the hall sensor. Otherwise, you're not going to get a reading. Also, don't forget to connect all of the components to common ground. I made the mistake of missing one of the grounds and my system would work for a while, but the hall sensor would eventually begin to fail. That was a really good day for my dog.
I did end up making custom connectors for the hall sensor and servo connections. I soldered the wires to male pin headers. These hang out of the bottom of the enclosure. For the hall sensor, I made a custom female adapter by cutting, stripping, and soldering a few Dupont connector wires I had lying around.
For the Vcc and ground rail, I cut the power rail section off some extra perma-proto breadboard I had lying around. Anything similar that you have around will work. Just double-check your connections before setting the rail in its slot. This is the hardest thing to get out once it's in. I also learned that the hard way.
That's it! Hope you guys have as much fun building this as I did. It looks challenging at first, but the more you get into it the easier it gets. Let me know if you have any questions about anything. Happy tinkering!
Comments