Introduction: AquaFeeder: an Automated Fish Feeder

About: Tanmay Bhonsale a.k.a enceladus2000

AquaFeeder is a smart Arduino controlled robot that automatically feeds your fish at a given time, all by itself! It uses two motors, one controlling the aquarium lid, and the other dropping fish food. It also features an LCD screen that makes it easy for anyone to use the fish feeder. Furthermore, AquaFeeder is programmed to feed the fish twice a day at a user set time. Other features include:

  • A Clock.
  • A water temperature sensor.
  • Easy to read LCD display.

Well recently I acquired an aquarium, and was quite keen on keeping many fish. Unfortunately, amidst all my homework, electronics projects and classes, I kept forgetting to feed the fishes regularly. Obviously, my mother was annoyed, and threatened to get rid of the aquarium. And then one fine day, while daydreaming in class, I got a vision of the AquaFeeder, feeding the fish all by itself. About 2 weeks later, the very first Aquafeeder prototype was born, made using just an Arduino, two servos and an LCD screen, costing no more $40!

The AquaFeeder really is a useful machine; you could use it if:

  1. You are forgetful (like me)
  2. Are busy and working all the time (like me)
  3. Are on vacation and need to feed the fish when you aren't there.
  4. Want the best care for your fishes.

Also, if you have always wanted to keep fishes, but couldn't because you're busy, then AquaFeeder is the solution! In this Instructable I'll be showing how to make your own Automated Fish Feeder with more than $60. All steps have been written in detail so as to make it as easy as possible for anyone to make this themselves!

Here is a Teaser of AquaFeeder, that shows it feeding the fishes... Check it out!

As you can see in the video, one of the servo motors opens the aquarium lid. Then, another servo rotates the fish food container so as to drop it into the water. It then closes the lid. The feeder does this twice a day, at times that can be set using BlueTooth!

Step 1: Materials and Project Details...

  • Cost: ~$60 (including an Arduino UNO)

Time: Total 48 hours (2 weekends at least)

Difficulty: Intermediate

Skills Required:

  • Experience with Arduino and electronics
  • Experience with coding
  • Experience and skill in cutting and making stuff with cardboard

Materials:

For Main Controller Circuit:

  1. An Arduino Board: I used a Mega2560 (Adafruit)
  2. A breadboard shield (Amazon)
  3. A Nokia 3110/5110 LCD Screen (Adafruit)
  4. 2 Servo Motors: 1 of them can be a micro servo too. (Adafruit)
  5. IC4050
  6. A DS1307 RTC breakout board (Adafruit)
  7. Lots of single core wire
  8. Jumper wire (Adafruit)
  9. 2 BC547 NPN Transistors
  10. 3 10K resistors
  11. A 10K thermistor (Adafruit)

For Fish Feeder Stand: (This is the stand that holds one of the servo motors above the lid of the aquarium. The servo motor on this stand will drop the fish food into the aquarium when the other servo opens the lid)

  1. Mountboard (white cardboard)
  2. Firm Double layer Cardboard (I got it from an old box)
  3. Ice cream sticks
  4. PVA glue
  5. Superglue
  6. Double Tape
  7. A small nail

Step 2: How AquaFeeder Works...

This is for the people who want to understand exactly how AquaFeeder works.

The program on the Arduino runs in the following way:

  1. After booting, the the Arduino first positions both servo motors into their starting positions (feeding servo should be straight up and lid opening servo must be in closed position).
  2. Then it proceeds to the main screen, which shows:
    • The current time (in 24 hour format).
    • The last time the fish were fed.
    • The time the fish would be fed next.
    • The temperature as sensed by the thermistor.
  3. The program allows you to set the time via a serial connection OR by Bluetooth. Open the Serial window in the Arduino IDE OR a Bluetooth Terminal app in Android, and send the time in this format:
    y (hour),(minute),(second)

    For example, if you want to set the time as 5.00pm, send this:

    y 17,0,0
    
  4. If you want the times at whcih the fish should be fed, send the following command via Serial:
    ff (FeedTimeHour1),(FeedTimeMinute1), (FeedTimeHour2),(FeedTimeHour2)

    For example, if you want to set two feeding times as 11:30 and 17:45:

    ff 11,30, 17,45
  5. When either of the feeding times are reached, the Arduino first opens the aquarium lid, rotates the feeding servo to drop the food, and then closes the lid.

When the current time is equal to either of the set feeding times, AquaFeeder starts the fish-feed protocol, which runs like this:

  1. AquaFeeder first sounds an audible alarm.
  2. Then, one servo opens the lid of the aquarium.
  3. The other servo then rotates the fish food container so as to drop some fish food into the water.
  4. The fish feeding servo then goes back to its normal (upright) position.
  5. The other servo then closes the lid.

NOTE: I will keep updating the code; possibly come up new features. Maybe fix any glitches in the current code that have not been found yet. Code last updated 25/4/14.

Step 3: Designing the Fish Feeder Stand...

What's this "Fish Feeder Stand" and why do we need it?

The fish feeder stand holds the standard servo motor just above the aquarium's lid. The servo motor on this stand will drop the fish food into the aquarium after the other (micro) servo opens the aquarium's lid. Depending of the design of the tank, you may even attach the "feeding" servo directly to the lid of your aquarium.

The fish feeder stand I made comprises of the following parts:

  1. The "Tower": This is the vertical column, labeled "1" in the picture above.
  2. The Servo Holder or "Jib": Labeled "2" in the above picture, the servo holder will be the part that holds the feeding servo (that holds the fish food) above the tank's lid. I call it the "jib" because it's similar to the corresponding part of a crane.
  3. The Base: Supports everything.

All these parts have been made with cardboard and ice-cream sticks (for rigidity). Of course wood or 3D printing may be a better option. but I have no experience in either of them.

When you are designing the fish feeder stand here are a few things you must keep in mind:

  • The "tower" must be at least 3 inches higher than the aquarium lid.
  • The feeding servo must be place in such a way that it doesn't hinder the opening and closing of the aquarium lid.
  • The base should have a large surface area and must be firm.
  • The tower, "jib" and base must be rigid and sturdy.

I'd recommend first roughly drawing a plan of a fish feeder stand like I did (in the pic above) and then commencing to the next step...

Step 4: Making the Stand's "Tower"...

Each column of the "tower" is made of two mountboards stuck together with ice-cream sticks in between (for rigidity). There are 2 such columns.To make 1 column:

  1. Cut out a 2 pieces of mountboard about 1.5 inches in breadth and 3 inches longer thn the height of your aquarium.
  2. Then stick ice-cream sticks onto one piece of this mountboard in the pattern show by the 3rd picture above.
  3. Now put some glue on these ice-cream sticks (as shown in the 4th picture), and stick other piece of mountboard to complete one column.

Make two such "columns" for the tower, and then continue to the next step...

Step 5: Making the Stand's Base Support...

The base support attaches the tower the the stand's base. To make them:

  1. Cut out 2 T-shape pieces of mountboard (with the dimensions shown in the 1st picture above) and 2 identical pieces from some firm double-layered cardboard.
  2. Stick the T shaped mountboard and firm cardboard together, such that they overlap each other. Do the same to the other pieces of mountboard and cardboard.
  3. With a cutter make a slight incision on each T-shaped support. See the 4th picture above for help.
  4. Bend each T-shape piece by 90 degrees.
  5. Now stick each T-shaped base support to each column of the tower we made earlier. See the 5th image above...

Step 6: Making the Servo Motor Holder (or Jib)

The jib will hold the feeding servo motor directly above the aquarium lid. To make the jib:

  1. Cut out 2 pieces of mountboard 1.5 inches in breadth. Their length should be at least 5 inches more than the distance between your aquarium lid's opening and the lid's edge.
  2. Just like in step 3, sandwich the ice-cream sticks between the two pieces of mountboard with PVA glue to finish the jib...

Before attaching the jib to the tower, stick some pieces of ice-cream sticks on one column (of the tower) as shown in the 3rd picture above. The idea is that when we stick the two columns of the tower together, there should be a gap in between to fit in the jib.

To attach the jib to the tower:

  1. Insert the jib into the gap between the two columns of the tower.
  2. You should leave at least 2 inches of the jib to the left of the tower, as shown in the 4th picture above.
  3. Now insert a nail to hold the jib to the tower. The jib will be able to rotate around the nail, so you can adjust the angle between the tower and jib later.

Step 7: Attaching the Stand's Tower to the Base...

Now we've got to attach the Tower to the base. To do that, follow these instructions:

  1. Cut out a piece of firm double-layered cardboard about 5 x 5 inches in dimensions.
  2. Put some PVA glue on the base support attached to the stand's tower, as shown in picture 1.
  3. Stick the stand's tower to the firm cardboard base (as shown in picture 2). Keep a weight to hold it in place until the glue dries up completely..

You can also use some super glue to secure the bond.

Step 8: Finishing the Stand...

We now have to adjust the angle between the stand's "jib" and the tower. Place your stand next to the aquarium as shown in picture 1. Adjust the angle between the jib and tower, such that the jib doesn't come in the way when opening or closing the aquarium's lid. Then fix the jib's angle permanently using some PVA glue and ice-cream sticks, as shown in picture 2 above...

Step 9: Attaching the Feeding Servo Motor...

Now its time to fix the servo motor onto your fish feeder stand. I attach a standard Radioshack servo motor to the end of the "jib" of my fish feeder stand with the help of double tape and rubber bands. Now attach the fish food container to this servo with some rubber bands.

Step 10: Attaching the Lid Opening Servo...

I used a micro servo motor for automatically opening or closing the aquarium lid.

  1. Tie a string at least 5 inches long to the servo motor.
  2. Attach the servo motor to behind the aquarium lid's hinge as shown above with double tape.
  3. Now tie a string around the aquarium lid, and stick it down firmly with tape and double tape.
  4. Then tie the servo motor's string tightly to the string on the aquarium lid. Secure everything with tape.

Step 11: Making the Display Circuit...

The circuit I used for the Nokia 3110 screen is adapted from Adafruit's tutorial on using a Nokia LCD with Arduino. To make the Nokia LCD circuit:

  1. Solder male headers to the Nokia LCD.
  2. Insert the LCD and IC4050 onto the breadboard. Note that in the pictures above, I took out the LCD to make it easier to lay the wires.
  3. Make the Connections:
    • Power Pins
      1. Connect pin 1 of the 4050, the LCD VCC pin and the LCD backlight pinto 3.3V.
      2. Connect pin 8 of the 4050 and the GND pin of the LCD to ground.
  4. Connecting the LCD to IC4050
    1. Connect the RST(reset) pin of the LCD to pin 2 of the 4050
    2. Connect the CS (chip select) pin to pin 4 of the 4050.
    3. Connect the D/C (data/command) pin to pin 6 of the 4050.
    4. Connect the DIN (data in) pin to pin 15 of the 4050
    5. Connect the CLK (clock) pin to pin 12 of the 4050.
  5. Connecting the Arduino
    1. Arduino pin 3 goes to pin 3 of the 4050
    2. Arduino pin 4 goes topin 5of the 4050.
    3. Arduino pin 5 goes to pin 7 of the 4050.
    4. Arduino pin 6 goes to pin 14 of the 4050.
    5. Arduino pin 7 goes to pin 11 of the 4050.

The last picture above is a Fritzing diagram showing the connections.

Step 12: The Servo Controller Circuit...

The servo controller circuit consists of only 2 BC547 NPN transistors. Follow the Fritzing diagram and pictures above to make the circuit on a breadboard.

Step 13: Connect the RTC Breakout...

I have already made a guide on how to make your own RTC breakout board here. An RTC breakout board can also be bought online from Adafruit and SparkFun. After making the RTC board, follow the Fritzing diagram above to connect it to your Arduino board.

NOTE: The above diagram only shows the connections for an UNO board. For users with others boards, follow this list:

  1. Arduino UNO: SDA - pin A4, SCL - pin A5
  2. Arduino Mega, Due: SDA - pin20, SCL - pin21
  3. Arduino Leonardo, Micro: SDA - pin2, SCL - pin3

Step 14: Connect Servos to the Arduino...

Before proceeding, check all your connections twice. Then follow the above Fritzing diagram to attach both servos to the Arduino circuit.

Step 15: Making the Temperature Sensor...

The temperature sensor consists of a simple 10K thermistor. I will be using this sensor to monitor the temperature of the water in the aquarium. Monitoring the temperature is very important when you want the best for your fishes. According to fish care website:

In aquatic environments, the temperature matters…a lot! All of the inhabitants living in our pond or aquarium are cold blooded. Plants, fish, bacteria, algae, snails, corals, and the rest – their temperature is the water temperature. Their metabolic rate is determined by water temperature.

To make the temperature sensor;

  1. Solder two long wires (about 15 inches in length) to the thermistor.
  2. Cover up the thermistor and its leads completely with insulation tape and glue (to waterproof it).
  3. Connect the thermistor to the Arduino as shown in the above Fritzing diagram.

Step 16: Test the Nokia LCD Display...

Before testing the servos I'd recommend testing the Nokia display first. Follow these steps:

  1. Download the Adafruit PCD8554 Nokia LCD library and Adafruit GFX Library from below;

  2. Import the libraries into Arduino and restart the Arduino IDE (How to import libraries?)
  3. Go to Files < Examples < Adafruit_PCD8544 < pcdtest
  4. Upload to code to your Arduino board.

Step 17: Upload the Test Code...

After you've set the fish feeder stand next to your aquarium, fitted the servo motors, and tested the Nokia Display, it's time to actually TEST your automated fish feeder. The code given below is just a test program that, immediately after Arduino boots proceeds to feed the fishes.

It's quite possible that you'd have to spend upto an hour testing out suitable positions for the fish feeder stand and desirable servo positions. Therefore, keep the fish food container closed until you are sure the feeder won't spill too much (or else you'd risk overfeeding the poor fishes).

Before uploading the code given in the attachment, read the comments and edit some variables (like the positions of the servo motors) to suit your design. After adequate testing , when you're ready to ACTUALLY feed the fishes, open the fish food container, and add a paper "scoop" (I dunno what to call it), to help minimise fish food spillage.

Then upload your code and watch..................

If everything works well, you're ready to go on to the next step!

Step 18: Upload the Final Code...

If the fish feeder test program worked great, then its time to upload the actual program! First, You'll have to download the Time and DS1307 libraries, and import them into Arduino IDE. Then upload the code given below...The code is in the attachment below.

CODE UPDATE! (25/4/14)

What's new:

  1. Setting feeding times serially (also with Bluetooth)
  2. Audible alarm when feeding fishies.
  3. Minor bug fixes.

Step 19: Adding Bluetooth (with HC06)....

I used an HC-06 Bluetooth module to AquaFeeder for one to easily connect with their Android phone wirelessly. This Bluetooth connection allows one to:

  1. Set the current time (if the time shown by AquaFeeder is wrong)
  2. Set the times at which fish should be fed.

To add Bluetooth connectivity, just connect an HC-06 to the AquaFeeder, as shown in the Fritzing diaagram above...

Step 20: Done!

As of now AquaFeeder works very well. I am still working on it, searching for bugs in the code and improving usability. Here are a list of features I'd like to add in the near future:

  1. BlueTooth connectivity.
  2. An easy to use menu system.
  3. WiFi connectivity (with ESP8266) and internet synced time.
  4. A proper enclosure for the electronics (only after upgrading the electronic circuit).
Automation Contest

Third Prize in the
Automation Contest

Move It

Participated in the
Move It