Introduction: Fish Feeder Sensor Array
Introduction
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
Principle
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.
Drawings
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
Attachments
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.
Attachments
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.