Automatic Fish Feeder

by draedo5552 in Circuits > Arduino

165 Views, 3 Favorites, 0 Comments

Automatic Fish Feeder

IMG_4453.jpg

Do you have pet fish? If so, do you despise feeding them daily or simply forget? Well, I am one of those people, so I have created this Instructable for an automatic fish feeder using an Arduino Uno. This super easy project feeds your fish 5 shakes of food every 24 hours. This can be modified for your needs. Enjoy!

Supplies

Micro Servo (I used the MG90S servo, you can also use the SG90) x1


Arduino Uno (or Elegoo Uno, same thing just a different brand and slightly cheaper, I used this brand) x1


Arduino jumper wires (male to male) x3


3D printer


glue (super glue or hot glue recommended)



SG90 Micro Servo or MG90S Micro Servo JUST NEED ONE KIND


Elegoo Uno or Arduino Uno AGAIN JUST NEED ONE


Wires

3D Print the Parts

IMG_4442_2.jpg

Print these files. It is only three parts. 1 is the servo mount. 2 is the container. 3 is the container lid.

Upload Code

IMG_4449.jpg

If you don't have the Arduino create agent installed you will need to do so here.


After that is done you will need to upload the code to your board.



#include <Servo.h>


Servo myservo; // create servo object to control a servo 

int servoPin = 9; // the pin it is attached to


void setup() {

 myservo.attach(servoPin); // attaches the servo on pin 9 to the servo object 

}


void loop() {

 for (int i = 0; i < 5; i++) { // repeat 5 times

  myservo.write(180); // set servo position to 180 degrees

  delay(1000); // wait for 1 second

  myservo.write(0); // set servo position to 0 degrees

  delay(1000); // wait for 1 second

 }

 myservo.write(180); // return to starting position

 delay(86400000); // wait for 24 hours (86400 seconds)

}


Circuit Assembly

Screen Shot 2024-07-25 at 1.00.33 PM.png

Attach the red wire of the servo to the 5v on the Arduino. Then the brown one on the servo to the GND pin on the Arduino. Last the orange pint to pin 9 on the Arduino. You may follow the schematics above is this is unclear.

Assembely

IMG_4447.jpg
IMG_4448.jpg
IMG_4454.jpg

This step is pretty straightforward, you will need to insert the servo into the mount and glue it there.

Then you will need to screw in your servo horn which is the piece on top of the servo.

IMPORTANT!!! YOU MUST MAKE SURE THE SERVO MOUNT IS MOUNTED PROPERLY!

To do so you will need to run the code once with the servo and the end position will be the home position of the horn. You must ensure it is parallel with the servo at the home position as shown in the image above.

You will then glue that to the container which has a groove in it for the specific piece. If the cap of the container is too loose you may want to wrap a thin layer of tape on it for connection.

Lastly, you should mount this on the fish tank. you may need some cushion or glue if it is too large for your tank.

Finish!

IMG_4450.jpg
IMG_4452

So now you just need to power it! I used the same chord used to upload the code to power it. I used an adapter and plugged it into the wall so the battery does not die. This should go off every 24 hours. Enjoy!!!