Introduction: AquaFeeder: an Automated Fish Feeder
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:
- You are forgetful (like me)
- Are busy and working all the time (like me)
- Are on vacation and need to feed the fish when you aren't there.
- 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)
- Experience with Arduino and electronics
- Experience with coding
- Experience and skill in cutting and making stuff with cardboard
For Main Controller Circuit:
- An Arduino Board: I used a Mega2560 (Adafruit)
- A breadboard shield (Amazon)
- A Nokia 3110/5110 LCD Screen (Adafruit)
- 2 Servo Motors: 1 of them can be a micro servo too. (Adafruit)
- A DS1307 RTC breakout board (Adafruit)
- Lots of single core wire
- Jumper wire (Adafruit)
- 2 BC547 NPN Transistors
- 3 10K resistors
- 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)
- Mountboard (white cardboard)
- Firm Double layer Cardboard (I got it from an old box)
- Ice cream sticks
- PVA glue
- Double Tape
- 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:
- 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).
- 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.
- 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:
For example, if you want to set the time as 5.00pm, send this:
- 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
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:
- AquaFeeder first sounds an audible alarm.
- Then, one servo opens the lid of the aquarium.
- The other servo then rotates the fish food container so as to drop some fish food into the water.
- The fish feeding servo then goes back to its normal (upright) position.
- 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:
- The "Tower": This is the vertical column, labeled "1" in the picture above.
- 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.
- 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:
- Cut out a 2 pieces of mountboard about 1.5 inches in breadth and 3 inches longer thn the height of your aquarium.
- Then stick ice-cream sticks onto one piece of this mountboard in the pattern show by the 3rd picture above.
- 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:
- 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.
- 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.
- With a cutter make a slight incision on each T-shaped support. See the 4th picture above for help.
- Bend each T-shape piece by 90 degrees.
- 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:
- 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.
- 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:
- Insert the jib into the gap between the two columns of the tower.
- You should leave at least 2 inches of the jib to the left of the tower, as shown in the 4th picture above.
- 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:
- Cut out a piece of firm double-layered cardboard about 5 x 5 inches in dimensions.
- Put some PVA glue on the base support attached to the stand's tower, as shown in picture 1.
- 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.
- Tie a string at least 5 inches long to the servo motor.
- Attach the servo motor to behind the aquarium lid's hinge as shown above with double tape.
- Now tie a string around the aquarium lid, and stick it down firmly with tape and double tape.
- 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:
- Solder male headers to the Nokia LCD.
- 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.
- Make the Connections:
- Power Pins
- Connect pin 1 of the 4050, the LCD VCC pin and the LCD backlight pinto 3.3V.
- Connect pin 8 of the 4050 and the GND pin of the LCD to ground.
- Power Pins
- Connect the RST(reset) pin of the LCD to pin 2 of the 4050
- Connect the CS (chip select) pin to pin 4 of the 4050.
- Connect the D/C (data/command) pin to pin 6 of the 4050.
- Connect the DIN (data in) pin to pin 15 of the 4050
- Connect the CLK (clock) pin to pin 12 of the 4050.
- Arduino pin 3 goes to pin 3 of the 4050
- Arduino pin 4 goes topin 5of the 4050.
- Arduino pin 5 goes to pin 7 of the 4050.
- Arduino pin 6 goes to pin 14 of the 4050.
- 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:
- Arduino UNO: SDA - pin A4, SCL - pin A5
- Arduino Mega, Due: SDA - pin20, SCL - pin21
- 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;
- Solder two long wires (about 15 inches in length) to the thermistor.
- Cover up the thermistor and its leads completely with insulation tape and glue (to waterproof it).
- 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:
- Download the Adafruit PCD8554 Nokia LCD library and Adafruit GFX Library from below;
- Import the libraries into Arduino and restart the Arduino IDE (How to import libraries?)
- Go to Files < Examples < Adafruit_PCD8544 < pcdtest
- 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)
- Setting feeding times serially (also with Bluetooth)
- Audible alarm when feeding fishies.
- 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:
- Set the current time (if the time shown by AquaFeeder is wrong)
- 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:
- BlueTooth connectivity.
- An easy to use menu system.
- WiFi connectivity (with ESP8266) and internet synced time.
- A proper enclosure for the electronics (only after upgrading the electronic circuit).
Third Prize in the