My aquarium holiday automatic fish feeder (for granules)

Started 26aug2019 – updated 18Oct2019
This page is in group Aquarium pages and shows my aquarium fish feeder design.

This DIY feeder passes (like) 15 mg (milligrams) of food granules on every action. My tiny fishes need that much, and not much more.

Fig.1 – From hand feeding to machine feeding when away (Press for more pixels)

Fold handling with Collapse-O-Matic plugin

I am using Collape-O-Matic (here) on many pages.

Expand All (for searching)
Collapse All

Typical fold

This text 123456789 will only be found with browser search when the fold is expanded

Why not just buy one?

There is no need to make a feeder unless you want to have some fun and love designing and solving unforeseen problems. The perhaps less fun alternative is to run to your local pet shop and buy one, in which case this note probably is not for you. (But you could go to that shop and spy on the different solutions. I spied after I had made this one, on the net. There certainly are some nice designs out there!)


Some of the points of the specification were added after the unit had been built. I have no boss, this is for myself, so nobody can complain about that order.


  1. The feeder shall be allowed to be permanently installed (even if the main usage would be for holidays)
  2. The feeder shall drop the food down through the standard feeding hole on the top of the aquarium
  3. The feeding drop point shall be adjustable to some extent
  4. Damp (moisture) from the aquarium shall not be allowed to condense on or inside any part to such a degree that it would hinder flow of granules. The solution shall be passive (no fan)
  5. Food shall be (my type of) granulated pellets that will flow easily
  6. No food granule shall be substantially larger than the others
  7. The hole in the food compartment shall be large enough to allow the food to flow easily
  8. It shall not be possible to empty more than one feeding per activation. Food shall not be allowed to flow for a longer time than the set time (set in SW)
  9. The food compartment shall be large enough for some weeks of usage
  10. It is “allowed” to have a neighbour come in and see if any fishes have died, like once a week, and remove the feeder, without any prior knowledge, if there is a critical problem
  11. The feeder shall be fixed to the aquarium’s top and shall not be allowed to move
  12. The feeder shall just be lifted away with no permanent remains
  13. The construction shall withstand years of operation
  14. It is “allowed” to have the activation unit not built into a nice enclosure (or body or skin). This way a non-specialist may be able to overdose by accidentally pressing on some mechanical part

Controller and SW

Some of the parts on how the fishes behave and how the SW would work have been altered on second reading. You get the whole story:

  1. The amount of food shall be permanently set by SW in the controller (once the parameters have been found). Not settable from the menu
  2. Food shall not automatically be disposed of when the internal skimmer pump is running
  3. It shall, from the menu, be possible to set one or two feedings per day (at the same time every day), separated by two minutes one minute. The double serving shall be smaller than twice a single serving. Two servings shall be for every other day. This parameter shall survive a processor restart. Default is a single serving
  4. It shall be possible to do single feedings from the menu (or from some button). If this is done then automatic feeding shall not be done that day
  5. The activation unit (motor, servo, electromagnet, solenoid etc.) shall not be monitored by the SW. Testing is done manually with the previous point. (Automatic detection would only have detected a single point of failure in a rather long path of possible failures. Update: see “Monitoring the solenoid“, below)
  6. The controller shall have a watchdog restart


  1. The electrical interface to (/from) the activation unit shall use what is available from my output control box and an extra power supply like 5V or 12V DC and one or more of:
    • 1-2 open drain outputs
      • Update: The current may be measured and sent to an A/D converter. See “Monitoring the solenoid”, below
    • I2C digital bus
  2. Should the activation unit be left permanently activated then no part of the feeder shall be destroyed or cause any safety problem
  3. There are no specs for size or weight or looks. But it may look like a prototype
  4. No spec for the sound (noise) level of the activation unit since it will be in use so little every day


Fig.2 – Granules fish feeder, design (download PDF here or full resolution (19 MB) here)

Even if the above figure is almost self explaining, here is the rather tedious design description:

Design description

I have made this unit in my basement shop from material that I found in my boxes. None of the parts have been made with a 3D printer. As much as I would like to have one. (But that would give me yet another hobby, that I am really not in search for..)

The bottle holder block (h), lever (r) and funnel (cone) inside the bottle’s cap (f1) are made from POM (polyoxymethylene) plastic. The white base I made from some other type of plastic, which when being cut smells like some kind of glue. The aluminium parts would hold the solenoid and offer ample cooling for the worst case continuous power consumption (3 Watt).

The plastic bottle (f) holds the granules. When being pressed inside the hole of the holder block (h) the whole unit must be held upside down (standing bottle). That is, if the bottle contains food. I press till I see the lever move, to make the piston (p) act some press on the cap and stop all flow when it’s turned back into standing position (bottle pointing down). For the cap’s internal coned funnel (f1), see separate chapter (below).

When the solenoid moves down 5.5 mm the lever (r) goes with it and the piston (p) opens for flow. If it does not open enough then there will be build-up of a pile of granules that would stop the flow, effectively forming portions of food. I have found that relying on this alone is not precise enough, so if I press the solenoid by hand to test I would like this not to happen; there should be continuous flow in that case. I had added a headed pin on top of the piston (p) before I added the funnel (seen in fig.3). I kept this after the cone had been inserted, so now this pin will make some physical dislocation of some of the granules and thus help starting the flow. It will also help the piston to hit the right place when it’s pushed by the solenoid spring back up again.

The bottom compartment (x)(f2) that takes the granules I made from plastic from some kitchen utensil that had found its way to my reuse box. Quite nice for the purpose. However, I needed to attach a small tube (it’s just pressed on the end ring) with a cross inside (z), to make at least some laminar flow of the granules, to finally actually hit the aquarium’s feeding hole. The tube and crossing are of soft plastic that would not easily get moisture from the feeding hole to condense on them. They are not terribly blank or shiny and would not appear as cold as the plastic. I have now tested it over weeks and there is no problem with moisture, even without silica gel (below).

The piston (p) is pressed on an iron cone that I made from a screw. In addition I added a wire as a belt. The piston also is some plastic part I found in my box.

Still, any moisture that might (or will) find its way into the bottom compartment I air out in the opening (a) (in picture (F)). The steel funnel that I use for manual, everyday feeding cannot sit in the hole for more than some minutes before its walls are full of drops. Most granules would be trapped in the drops and then continue build up. (See Fig.1 left part.)

The bottom compartment may be adjusted to have its tip point to the aquarium’s hole with a screw (y) in the in↔out axis, and the two screws (j) will do the left↔right adjustment (also mentioned in chapter below). The (y) screw also holds some foamed plastic that would stop the granules from popping out of the funnel into free air. I needed to fasten this with double sided tape, since I once saw that after some test feedings (every 10 second) the lever (r) got stuck onto it. That single detail would have starved my fishes to death. So this is fish safety critical design. (Aside: I have worked with safety critical fire detection systems for a full career..) I did discover a solution to detect stuck or not working solenoid, though! See “Monitoring the solenoid”, below.

The bottom compartment is held in place by a coil string that I found in my string box. It is attached to some solder ears held by the (j) screws. The holder block (h) may also be adjusted up↕down with the screws (i). The solenoid position may also be adjusted with its screws, plus the screw holes in the lever (r). The screws that you see with a star washer certainly need them! Without them there wouldn’t be many test feedings before the screws lost their grip.

The cable comes in at the bottom (E) and is connected to the solenoid and a reverse diode. Circuit diagram below.

The bottle may be held in place with a couple of plastic screws, seen in the bottle holder (h). The cap is so long and the hole it goes into just tight enough that I haven’t used these screws yet.

The fastening is done with two not-through 6.5 mm diameter (⌀) holes in the 8 mm PVC of the aquarium’s top, and the same type of holes in the base (E). Then some POM plastic (?) loose 6.0 mm ⌀ tubes are used for locks.

Dimensions and weight

The base is (L*W*H) 60 x 40 x 30 mm and the top of the bottle holder block ends at 78 mm. Including the bottle it ends at 145 mm. The unit without the bottle weighs 210 grams.

Cap’s internal funnel or cone (f1)

Fig.6 – Cap’s internal funnel or cone (press for more pixels)

I made the cone (f1) out of POM plastic and glued it with glass silicone into the inner ring of the top. I tested this gluing and it’s good enough for the purpose.

The cap needed the cone inside (f1), if not the granules would simply not start to flow or soon become clogged. Now, when writing this note I found an article called Mechanics of the sandglass (A A Mills, S Day and S Parkes, Department of Geology, The University, Leicester, UK in Eur. J. Phys. 17 (1996) 97–109) here that gives a formula of how fast the sand moves through an hourglass. In their formula there is a “constant of proportionality K (that) depends on the shape of the reservoir: the values for hourglass-, cone- and silo-shaped vessels were found to be 7–10, 8 and 19 respectively. The presence of a horizontal annulus around the aperture considerably extends the period by reducing the rate of flow: K is of the order of 21 for such a construction.

What I am trying to say is that the cone and reservoir shapes are important. Also, that the “aperture is at least 5 × the particle diameter“. For the granules I use I have measured them to be about 0.6 mm ⌀; 5 times it yields 3 mm! By luck, or by trial and error I ended up with that value:

The cone starts with a wide opening and then it’s steeper until the opening. The opening is (as said) 3 mm ⌀ which makes for (3/2)2*π= 7 mm2. I also have a cap with 4.5 mm ⌀ funnel (16 mm2) but this was too wide for the food granules that I now use (made from a stainless steel piping tip decorating set for whipped cream. I simply sanded it down to 4.5 mm ⌀ opening).

Correction of washers of (j)

Fig.7 – The washers cannot take the screw’s tip away from the bulb (press for more pixels)

As compared to the other pictures here, this is the newest – and the correct placement of the washers, the dashed arrow shows this. I discovered that I had lost the possibility to control the left↔right plane of the compartment’s (x) position above the aquarium’s feeding hole with the (j) screws. The end of the screws need to hold the compartment by touching it by the star in the figure. Bear in mind that the two holding screws (j) sit in long holes so that the needed adjustment is possible. (Earlier we have seen that the (y) screw does the in↔out adjustment).

The outlet (z) finally fastened

Fig.11 – Now the outlet and internal cross cannot fall off (press for more pixels)

On the first real test (off on vacation) I was thinking much about the possibility that the outlet and internal cross could fall off, since they were just pressed onto the funnel. I now have fixed it with a 0.5 mm ⌀ isolated wire wrap cable from the eighties that goes through five 0.6 mm holes. Two in the tube, two in the plastic funnel and one in the cross. Double crossing of the food’s path is no problem for the falling of the granules as the worst it can do is to slow down the food, which is what I want anyhow. (None of it had fallen off during that vacation, though. And the fishes seemed just fine.)

Silica gel inside bottle

Fig.12 – Silica gel inside bottle (Press for more pixels)

I also added a small sack of silica gel desiccant inside the bottle to suck away the last moisture that might (or rather will sooner or later) get there. I had saved silica gel from “all over the world”, and had some bags in a bottled jar. I read that it basically was not poisonous and is even allowed as a food additive. However it is often added with colouring chemicals. I found a bag that says DMF FREE (dimethyl fumerate) and WITHOUT CoCl2 (cobalt (II) chloride). How reassuring.. I could hope that it is labeled DO NOT EAT as a general warning only, that it’s not been produced as food to eat. I am not very worried.

Since the bag that the silica gel came in was too full of holes in my opinion I packed some balls in some coffee filter paper together with a steel washer and rolled it into a tampon, in such a way that a single mini staple would close it sufficiently. I then slid it into the bottle and glued a neodymium magnet on the outside. Bingo, there it hangs!

After a year or three (?) I assume I will have to heat it to have moisture go away from it. I just assumed the ones I used were rather dry. I wouldn’t know since there is no colour indicator.

Adjustment of lever’s track

Fig.13 – Sliders (c) to fine tine lever (r) track (Press for more pixels)

Since the feeder has been made by hand and since I also went on to other projects, I made only this first prototype. When I pressed the bottle’s cap down into the hole I saw that it was not necessarily position in the center of the 3 mm hole. I simply had too much slack in the track that the lever moves up and down inside. So I cut a groove in the block (h) on each side of (r) and cut two pieces (c1) and (c2) of plastic cutting board to press into position to steer the lever, see dotted circle. (The right sided piece (c2) is not in the picture since (r) was displaced towards one side only.) There had to be enough friction to have (c1) sit firmly, that’s why it looks rather coarse on the magnified picture. I used a hand plane and some fingers, not exactly precision, but little enough per cutting.

This really did not solve any present problem since the cap’s hole has angled slopes so that the pin on (p) really gets in place. It had, after all, been tested for a month with no dead fishes. But I wasn’t satisfied with what I saw.


Fig.3 – The connector box (left) and piston’s pin seen (press for more pixels)

The feeder is connected further up to a box and controller, described here. The small box seen above takes two control outputs in the braided cable, 12V comes in over the black connector, and the feeder is the grey connector. A LED inside the box is controlled separately; I will use it to show that the feeding has been done “today”. The box above and the feeder will be added in the scenario seen here.

Fig.5 - Circuit diagram

Fig.5 – Circuit diagram (download PDF here)

Monitoring the solenoid

The diode (1N4007 @ 1A, peak 30A) takes care of shorting the high voltage that the coil will kick back with when the voltage is removed. I don’t want an old fashion car engine ignition coil radio transmitter here! The driver MOSFET transistor also has a reverse zener diode inside, but it’s best to have the diode here as close to the inductance as possible, to make the unavoidable antenna as short as possible. But I must admit that when connecting two diodes in parallel it’s not easy to know which will take the surge. I could have used a shottky diode that most probably would conduct before the MOSFET’s diode, to avoid the current going in the connectors and the cables. I’ll think about it. Stay tuned. (The one I use in the relay box and simulator box is 1N6263 and it surges max 50 mA, which I think is too little for this inductance.) Update: I did see a problem that I had not seen before, solved with a Schottky diode and two capacitors, see description below Fig.8 here. Now, was the source of the noise current in my cable, caused by me not having a Schottky in the feeder? No it cannot have been:

Fig.8 – Solenoid moving, withheld and always inside. (Press for more pixels)

I measured the current over a 3 Ohm serial resistor and got the curve (above). The plunger goes in during the first top and is fully set at the dip. I was surprised, even if I expected something to happen. I found an excellent explanation (*). There they state that “The solenoid excitation current have a prominent dip during power up due to the back EMF generated by plunger movement.” Also that I could have gone down to a lower voltage once the solenoid is activated, if it were to be permanently engaged. Mine will not.

(*) Detection of Plunger Movement in DC Solenoids by Manu Balakrishnan and Navaneeth Kumar N at Texas Instruments (June 2015), see

An even more interesting idea from Balakrishnan et al is that if I detected the plunger dip I could have monitored the solenoid to see that the plunger had become engaged! I could have monitored the feeder, and made a first class fish safety-critical solution! However, even if it is such a good idea, I will not do it here. After all, I am not administering chemotherapy for human cancer patients.

Also, I did measure the current when I held the solenoid back. The dip is gone, and I only see the rising part of the curve. It’s up after about 5 ms, no dip. The last test was when I had pushed and held the plunger inside the solenoid during the pulse. In this case the current rose in about the double: 10 ms. Both curves are seen in the above figure. Still no dip. Great! (Oscilloscope: My SIGLENT scope log.)

Shortest engagement time

Another matter is that 35 ms is about the shortest pulse I should give it. The plunger is fully inside after about 22 ms. I generally like to have above 50% margin, which takes me to 22 + 11 = 33 ms. So, if that would cause too much food, I must find other ways to hold the granules. In a 50 ms pulse I see no additional current increase.


A ration a click

Fig.4 - A 35 ms feeder click movie

Here the solenoid opens for granules for 35 ms. It’s about 15 mg (milligram) of 0.6 mm ⌀ granules that is ejected every time (*). If you run the movie by hand you will see that the granules fall down quite a long time after the solenoid has closed. (Download the movie from here (6 MB)). I will study to see that is actually going on with a slow motion movie. Stay tuned. But the above operation is very repeatable. But not linear, since I guess the granules need some time to become disturbed and start flowing:

  • 35 ms ejects 15 mg
  • 50 ms ejects 18 mg

(*) I know because I have a set of pan balances scale with the lightest weight in the box at tiny 2 (two) mg, and it makes a difference when it’s added.

Feeder feeding twice

Fig.10 - A two feedings movie

Fig.10 – Two 35 ms feedings being separated by 1 minute. Probably seen best as full screen. 19 MB

The movie shows four cardinal tetras and eight black neon tetras. They should all have got their moment of fame. They seem to hang around the feeding corner quite a lot, perhaps especially when they are hungry. But then, when are they not hungry? If I follow the advice to let them eat until they seem full (max one minute, nothing to fall on the gravel), then one of them seems to grow big and just die. I guess, that’s the voracious one, doomed to go. I have only seen it with the cardinal tetras so far. With automatic feeding when we are away I guess it’s more important that they get some of sort than how much.

Aside: The last part of the movie tells some technical details about how I made it. Here, with some more data added: PORTRAIT 9:16 MOVIE. On a Mac: Two movies shot as portrait (3840 × 2160, H.264, AAC, each split into 10 seconds by Preview as 122 MB times two), into iMovie. Still parts from Pages exported as PDF, into large jpg files with Preview, into iMovie working with all content there as tilted (not very practical, and with this scheme titles cannot be used), then exported to mp4 (1920 x 1080p, H.264, AAC,, high quality coding, 70 MB, 27 seconds), then rotated to standing by QuickTime Player into mov (1080 x 1920, H.264, AAC, 34 MB). Finally mov into mp4 (1080 x 1920, H.264, AAC, 19.2 MB) with HandBrake. All this to avoid black sides: since my first movie became like that, you may download it from here (47 MB). That movie was shot as landscape and edited in iMovie completely, and cropped to get those black sides. The wall and the right side of the aquarium were not interesting. But I found no other way with my new portrait shots to make a portrait movie. Also, some Q&A on Apple support seemed to confirm this. If  you have any better suggestion, please help with a comment (below) or mail me. This is further discussed Some macOS / OSX notes (chapter Portrait mode movies from iMovie). There, Rich at Apple support community mentions an alternative method.

Social media

In Norwegian:

Summary in Norwegian

Hjemmelagd foringsautomat for små akvariefisk. Den plasseres i ledehull (slik at den står i ro) over matehullet på toppen av akvariet. Automaten er lagd for bittesmå pelletskuler og er bygd ved at en 12V solenoide drar en kork (med en knappenål på toppen) 5,5 mm ned. Lagd av aluminium (også for kjøling av solenoiden om den feilaktig skulle bli stående aktivert), POM-plast og en annen plasttype. For at pelletsen skal flyte ordentlig er det nødvendig med en indre trakt inni korken i flaska med granulat, og trakt og “kryss” for ensretting av granulatet ved tuten av det nedre kammeret, slik at maten kommer dit den skal. Pluss, så god motstand mot fuktinntrenging som over hodet mulig. Dette var en av hoveddesignkriteriene, og det ser ut til at  løsningen funker.

Når jeg har brukt den i ti år, kanskje jeg leverer den til Reodor Felgen. Den tid, den sorg.

Foringsautomaten styres fra akvariekontrollboksen min. Se My aquarium notes og My USB watchdog (and relay output) box.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.