Pellet Fish Feeder powered by Arduino

April 3, 2025
Description
Description
- We have a large (12”) Red Oscar “rescue fish” that someone had returned to Petco. We decided to give him (or her, not sure) a new home. We normally hand feed Oscar his pellets making sure he eats one before getting another. We needed something to feed Oscar while we are away, but the available automated fish feeders won’t handle the large pellets he eats, and they typically just dump a load of food at preset intervals. If he doesn’t eat the food right away it gets soggy, then he won't eat it, and adds debris to the aquarium. This is bad, especially if we are gone for an extended period.
- We have a web cam set up to watch Oscar. He jumped out of the aquarium once. Fortunately, we were home, heard the commotion, put him back in the aquarium and now have a jump proof cover.
- I decided to design and build a custom feeder that would remotely feed one pellet at a time. We could watch with the web cam to make sure he eats that one before feeding another.
- The clamps that hold the feeder are designed to fit a 75 gal Aqueon aquarium with glass cover. Use the TinkerCAD file link if you need to modify those clamps for your aquarium.
- The feeder is designed to handle Hikari Chichlid Gold large pellets. Since they aren't uniform in size, I designed a screen to sift out the few that are too large and cause the feeder to jam. Uniform size is needed to keep the pellets from jamming. I just dump the pellets into the screen and wiggle it around. Any pellets that don't fall out the bottom don't go into the feeder. We can hand feed those to Oscar :-)
Functions
- The feeder securely clamps to the aquarium between the lip of the aquarium and the glass cover.
- A supply of pellets is stored in the hopper.
- Two buttons on top – one is used to index the feeder plate to align with the hole in the bottom of the feeder, and the other is used to dispense one pellet at a time. Turns out the indexing isn’t really needed but it is there regardless and could be used for a different function in the future if needed.
- The Arduino board and motor are programmed to dispense one pellet each time the button on top is pressed or upon power-up. This allows us to manually feed Oscar from the feeder while we are home and to train him to know where the pellets come from (he’s very smart..), or to use an Alexa/Amazon smart power plug to remotely cycle the power on and off, dispensing one pellet with each power cycle.
- It took many iterations of the hopper and feeder plate to be able to reliably dispense one pellet at a time. The odd shape (they’re not round) and the variation in size made this a challenge. They would jam, bridge, get lodged, etc. I ended up having to also make a screen that would separate out pellets that were too large and make the feeder jam. Programming the feeder plate to move backward ½ hole and then forward 1.5 holes turned out to make a big difference in reliability by dislodging the pellets before they have a chance to bridge or lodge causing a jam.
- For the next generation of the project I’d like to use the Arduino Cloud to remotely activate the feeder rather than the power plug.
Software
Just six months ago I started my new hobby of 3D printing but mostly I was just downloading designs from someone else. This was a chance to learn some new skills and tools:
- TinkerCAD looked to be the easiest to learn and worked well for designing all the 3D printable parts. It is free and there are lots of Youtube videos showing how to use the various functions. The ability to import and export STL files made this platform ideal for this project.
- The Arduino IDE was the next thing I had to learn. Having previous experience programming in other languages made this easier but syntax and functions had to be learned. “YouTube University” was a big help with this. I’m glad so many people are willing to share their expertise, whatever it may be.
- Cirkit Designer IDE, a free online tool, is very helpful for documenting circuits like the one used in this project.
Drawings and Code
Link to TinkerCAD individual parts
https://www.tinkercad.com/things/b6SYl4CPEbJ-pellet-fish-feeder-powered-by-arduino?sharecode=5289zuSdt8mVaZ-Pzl2fkPtIPKXrhxyJr6UFJI7ii5Q
Link to TinkerCAD assembly drawing
https://www.tinkercad.com/things/95DUwJmtbo4-fish-feeder-assembly?sharecode=xcuWlBTPUCLkXkKsXrPQo3g-9mjyb8P2ZeE7FoCh9U8
Link to Cirkit Designer circuit design and Arduino code
https://app.cirkitdesigner.com/project/478442dd-df8b-4970-87ea-5a8eee4afdd8
Purchased Hardware
- Arduino Nano board: https://www.amazon.com/dp/B0D5LYFRQP?psc=1&ref=ppx_pop_dt_b_product_details
- Amazon Alexa remote control wall plug: https://www.amazon.com/dp/B0CL9D9HM4?ref=ppx_pop_dt_b_product_details&th=1
- 10K ohm resistors: https://www.amazon.com/dp/B07HDGX5LM?ref=ppx_pop_dt_b_product_details&th=1
- Push buttons: https://www.amazon.com/dp/B07C7211PJ?psc=1&ref=ppx_pop_dt_b_product_details
- Wall power supply: https://www.amazon.com/dp/B0BVHRSNCH?ref=ppx_pop_dt_b_product_details&th=1
- Stepper motor: https://www.amazon.com/dp/B0BG4ZCFLQ?ref=ppx_pop_dt_b_product_details&th=1
- Circuit boards: https://www.amazon.com/dp/B081MSKJJX?psc=1&ref=ppx_pop_dt_b_product_details
- Bread board supplies: https://www.amazon.com/dp/B08Y59P6D1?psc=1&ref=ppx_pop_dt_b_product_details
Wiring
I first did a bread board of the project using an Arduino Uno, then put an Arduino Nano on the bread board as I wanted to use this smaller board in the final product:
- The ribbon jumper cables supplied with the driver board and motor connects the motor to the driver board.
- The driver board in turn connects to the digital outputs D8-11 on the Arduino board.
- The two buttons are wired to pins 2 and 7 of the digital inputs.
- Pulldown resistors ground one side of each button keeping the voltage low to the digital inputs, with 5V power supplied to the other side making the input go high when the button is pressed.
- 5V power and ground is supplied to the Adruino microcontroller, the motor driver board and the push buttons from a 5V wall plug power supply. In the bread board version I used the supplied female plug with screw terminals. In the final “production” soldered version I cut the plug off the end of the power cord, added some additional wire length and soldered it directly to the circuit board. This allowed me to save space in the “circuit board box” and extend the power cord so it would reach all the way down inside the cabinet below the aquarium.
Code
- If you haven't used the Arduino IDE (Integrated Development Environment) it is free open source software to download and use. Install on your computer, write or copy programming code into the development window, connect your Arduino board to the computer with a USB cable (usually provided with the board) and click the arrow button to compile the code and transfer to the Arduino board.
- The code has three main sections:
- The first section sets up variables like how many steps on the stepper motor for one revolution and how many steps to move one hole on the feeder plate.
- The second section tells the microcontroller what to do on power-up. In this case it will feed one pellet.
- The third section sits in a loop waiting for a button push to either feed one pellet or index the feeder plate so the holes line up with the hole in the bottom of the feeder.
- So there isn’t “creep” with the feeder plate when the number of steps on the motor isn’t evenly divisible by the number of holes in the feeder plate, I used 16 for the number of holes in the feeder plate. 2048 steps per revolution divided by 16 gives me the nice even number of 128 steps to rotate the feeder plate one hole at a time.
- Additionally, I found that by rotating the feeder plate ½ hole backwards before moving forward one hole helps to make sure pellets don’t get lodged causing a jam.
Assembly Instructions
- Refer to the TinkerCAD assembly drawing link.
- Put a dab of super glue on the bottom (shaft side) of the motor and Insert the shaft of the motor through the hole in the motor mount plate, aligning the motor on the two small pins on the underside of the plate. Feed the motor cable through the rectangular hole.
- Snap the above plate/motor assembly onto the main box that has the mounting tabs so the hole in the motor plate aligns with the cut out in the box.
- Press the circular pellet disk onto the motor shaft. The “button” on the disk should be facing up so the flats on the motor shaft fit into the disk.
- Put small dabs of glue on the four tabs on the large round pellet hopper, set it over the pellet disk so the round flat spot inside the container sits over the dispensing hole in the bottom box, and has an equal amount of clearance all the way around the pellet disk. You don't want the disk dragging on the container when it rotates.
- Glue the box that holds the circuit boards onto the main box top aligning the edges. The assembly will look like a miniature toilet when done. :-)
- A small dab of glue will hold the cover to the inside of the pellet hopper. This is to keep from dropping pellets into the middle of the hopper where you don't want them.
- Insert the two buttons onto the small circuit board so they align with the cover that snaps to the top of the electronics box and solder them in place.
- Solder all the wires to the various components per the wiring diagram on CirKit Designer. Make sure you put the power wire through the small opening on the bottom of the electronics box before soldering it to the main board. I cut the end of the power cord off and didn't use the adapter. It takes too much space in that little box and I was able then to add splice more wire to make it longer to reach down behind the aquarium and into the cabinet below to the power strip.
- The board with the Arduino controller slides into the vertical slot, wires toward the middle of the box. Make sure the programming port is on top in case you ever want to reprogram it. The motor driver board slides down into the shorter set of slots opposite the main board, and the board with the buttons just sits on top of the two horizontal rails. If you want to put a dab of silicone to secure the top board that is fine.
- Take each of the two printed screws, fold them in half and glue together.
- To install, set the feeder over the glass on the back so the hole in the bottom is over the opening in the back of the aquarium. Using the screws, spacer plates, and threaded block, clamp the feeder to the glass on the front side and the lip of the aquarium on the back side.
- Plug in the power and you are ready to go!! Note that the way I programmed it, every time you turn on the power it will feed one pellet.
Next Generation
I'm thinking the next version will use the Arduino Cloud service where you can write an app for your phone to run Arduino systems remotely. I think that will be a better solution than the Alexa smart plug, although that does work just fine.