Introduction: Fish Feeder Sensor Array


Why this project

My aquarium is a Juwel Rekord 800 and has a Juwel feeding machine. I bought the machine to be able to feed my fish on regular times when I'm not around. It's a great machine, but as an engineer I see some room for improvement.

For example:
– There is no way to see when there will be a next feeding.
– You have only 1 feed per day or 2 feedings per day with an interval of 6 hours.
– To store a time of feeding you have to physically push a button at that time.
– I have children who like to push buttons, so I have to reset the machine.

In short I don't know for sure when and much the fish are fed when I'm not around.

This subproject

This project is divided in several subproject:
- The build of the feeding machine
- The build of the sensor
- The link between Raspberry Pi and Arduino

The build of the feeding machine can be found here: Fish Feeder

The link between Raspberry Pi and Arduino can be found here: Fish Feeder Arduino Raspberry Pi Serial Link

This project only describes the build of the sensor.

Step 1: Sensor

See step 5&6 Fish Feeder


In the feeding machne an Arduino is used as a controller. A servo, connected to a digital pin of the Arduino, rotates the food container. A second servo opens and closes a hatch to avoid moisture from the aquarium entering the feeding machine and feeding container. The analog pins of the Arduino are used to measure the amount of food delivered to the aquarium/fish.

There are several methods to measure, therefore the design of the sensor is designed to be detachable and replaceable when redesign is needed. The most easy method is to use a beam of light and a light sensor.


The structure of the assembly in components is:

– 001 Main assembly

– 010 Feeding container
– 019 Feeding container coupling plate
– 020 Houding feeding machine
– 040 Housing Arduino
– 050 Cover
– 060 Sensor
– 080 Hatch

The drawings are in Dutch, my excuses. Please verify the drawings before starting your build. Also check the dimensions of your components (servo’s, Arduino, LCD).

To build the sensor you need drawing 060 & 080.

Step 2: Building

The building of the sensor is comparable with the building of the fish feeder.

The basic materials are:
- Plywood.
- Watertight glue.
- Watertight epoxy.

The wooden parts are glued with watertight glue and need to be provided with a watertight coating. Drill the holes for hinges oversized. Ensure that the holes of the hinges are provided with a coating. After the coating the diameter of the holes are smaller. For the axles I use a paper clip, they are abundant available, can be bended shape and clipped to the correct length.

Step 3: Electrics

After the construction is finished, the electric components can be fitted inside.

Use female breadboard wire to connect the wires to the led. When bending the wires of the led a bit, the led becomes fixed in the housing.

The inserting of the LDR resistors is a bit tricky as space is limited. See picture 10, the center wires are soldered together to +5V, the outer wires are connected to A1-A5. Clip the length of the LDR and bend the wire, see picture 11. Put the copper wire in the loop and twist both parts together. After twisting solder the copper wire and LDR pin. Use shrink-hose to electrically shield the bare wires. Add female breadboard connectors and the sensor array is ready.

Note : Observe carefully the slots in the fish feeder machine. The LDR wires need to be bent and shrinked to the correct corner!

Step 4: Test Program

The wiring of the LDR array is tight. To ensure that the resistance of the correct LDR is stored and displayed correctly, this test program can be used. By simply blocking the light to a certain LDR a certain value on the display will start to change.

In my case the connections are connected according the attached picture.

The resistance of the LDR 5506 is between 3,5kΩ and 10kΩ. The voltage on the analog pin by the voltage divider with 10kΩ can be calculated with the following formula:

Va = V * R1 / ( R1 + R2 )

V=5V, R1=10kΩ, R2=3.5/10kΩ

Va(R2=3.5kΩ) = 3.7V → Value = 758

Va(R2=10kΩ) = 2,5V → Value = 500

Step 5: Test Run

After mounting the sensor array, a paper clip wire can be inserted between hatch and servo. After a first test run it appeared the the screw of the hatch servo interfered with the clip of the feeding tube. If this happens, clip off a part of the screw and reverse the clip of the feeding tube, see picture 14.

The Arduino program runs a sequence of steps, see also attached program:
- Open the hatch
- Delviver food to the aquarium
- Close the hatch
- Calcalate the index of food

The program that runs on the Arduino measures the resistance of the LDR before releasing food in the aquarium. If the resistance of the LDR drops below the threshold the program assumes that food has been released. A counter shows how often this has happened. This gives a good indication in how much is delivered to the fish.

I have done several test, and the results are steady, between 40 and 50, see picture 16 and 17. Depending on your own setup, this index-number can be different.

Note : The attached Arduino program is a replacement of the FishFeeder program if you use the LDR-array.

Step 6: Design Improvements

The sensor and hatch are fully functional.

The hatch

The hatch is closing and opening properly. I’m now running a life test to verify if the hatch is tight enough to avoid moisture from entering the Fish Feeder machine.

The sensor array

The sensor registers if food is released from the feeding container. However there is room for improvement:

  • The light from the aquarium results in a large amount of noise in the sensor array.
    • It is possible to attach side skirts around the opening to avoid the aquarium light to enter the sensor bay. This greatly reduces noise.
    • A better position for led and sensor. I don’t know how to fix this without redesign.

I replaced the green led by a white led. This light is more intense and suppresses the aquarium light noise.


dick55 made it!(author)2016-04-06

Sensor principle not understood. How does your analog measurement correlate to amount of feed?

dick55 made it!(author)2016-04-08

Thanks. An interesting scheme. If I weren't so lazy I would share some alternative schemes I thought about; I'm sure there are many others.

Ben1998 made it!(author)2016-04-08

No doubt there are better and smarter alternatives. The sensor array is designed to be swapped out, depending on your needs. Feel free to experiment!

Ben1998 made it!(author)2016-04-07


Good question ;-)

In short the principle: A beam of light from the led is send to
the LDR array. If food is released from the feeding container, the
light beam is disturbed, resulting in a lower value at the analog
pins. The Arduino registers the 5 LDR analog pin values once before
feeding and multiple times during feeding.

- A small amount of food will result in a small width and short
period of shadow on the LDR’s

As opposite:

- A large amount of food will result in a wider and a longer
period of shadow on the LDR’s

After feeding the registered values are examined. If a value is
lower then before feeding, the programs knows the light beam is
disturbed and assumes food has passed, it will then increase the
counter of that particular LDR with 1. All 5 LDR’s are counted

The analog measurement is digitalized, 0 for no food, 1 for food.

- A small amount of food will result in a low, and a few increased
counter numbers.

As opposite:

- A large amount of food will result in a higher, and more evenly
increased counter numbers.

Please note : this is a way of quantifying the amount of food and
is not exact, it gives an indication.

For the welfare of your fish you need to check regularly your fish
& system.

About This Instructable




More by Ben1998:Aquarium Diorama With LedstripFish Feeder Arduino Raspberry Pi LinkFish Feeder Sensor Array
Add instructable to: