loading

Do you have a fish at home? Are you like me, and you occasionally forget to feed your water loving pet? If so, this project is perfect for you. Its Simple, Cheap, and fun to make!

This project is great for students who leave ealy and may not have time to feed fish in the morning

Please vote for this project in the DIY University contest and the Age of aquariums contest

This is an really cool arduino project, that uses just two electronic parts. The arduino sketch is set up to feed the fish every 12 hours, but you can change it to whatever number you like. After building, all you need to do, is to clip your device onto your aquarium and forget about it! Thats all you do!

Lets start building!

Note: I started a YouTube channel to document my projects better, subscribe for more projects!

Difficulty: easy..

Cost (Not counting Arduino): easy..

Step 1: You Will Need...

For this project you will need

SUPPLIES

  1. Arduino
  2. Servo (any kind)
  3. Binder Clips
  4. An empty shampoo bottle
  5. Fish Food
  6. Jumper Wires
  7. Empty food takeout container (Clean or unused)

TOOLS

  1. Drill
  2. Hot Glue Gun
  3. Computer (to code)

Step 2: Shampoo Bottle

Using a empty shampoo bottle and your drill, drill a small hole on both sides of the shampoo bottle.

This is where the food will fall out, so you should test if food falls out by filling it up, and rotating it while holding it horizontally

DONT DRILL TOO BIG OF A HOLE!

Your fish will end up fat!

Drill a hole small enough so only 1-5 pellets fall out, depending on the size or number of fish you have

Step 3: Wiring and Programing!

Wire the ardunio according to the above picture.

Using jumper wires, follow this pattern

Connect Yellow or data to PIN 9

Connect Black to GND
Connect Red to +5V


Next use the code I have provided to upload to your arduino

Note: I'm not the best Programmer........ I'm still learning, If you see anything I can improve Please Tell Me!

// CONSTRUCTED'S Fish Feeder
// https://www.instructables.com/member/Constructed/
// Donate for more projects! 


#include  
 
Servo myservo;  // create servo object to control a servo 
                // a maximum of eight servo objects can be created 
 
int pos = 0;    // variable to store the servo position 

long FISHFEEDER = 43200000; // 12 hours between feeding
long endtime; 
long now;

void setup() 
{ 
 
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
  
  myservo.write(0);
  delay(15);
  
}
 
void loop() 
{ 
  now = millis();
  endtime = now + FISHFEEDER;
  
  while(now < endtime) {
   myservo.write(0);
   delay(20000);
   now = millis();   
  }
  

  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees 
  {                                
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
}

Step 4: Prepare Case

First Cut a square just big enough to squish your servo through, It should be very tight!

next get your hot glue gun and glue both the binder clips to the back of your case.

Try to line them up as best as you can, They will clip to the back of your aquarium

Next take some hot glue and glue a servo horn to the bottom of your shampoo bottle. Put the servo horn back onto the servo and go to the next step

Step 5: Your Done!

Simply fit all the electronics into the case, and wedge the servo in last. Now clip your automatic fish feeder to any aquarium and your done!.

Have fun and now you don't need to worry about feeding your fish!

Please vote and favorite this intructable, I really appreciate it.

Thank you

​Hi. I'm currently creating this Fish Feeder but I have a problem. If you know the solution, please help me, I need the solution fast for a project.<br>When I enter the code it tells me: The Sketch uses 2,314 bytes (7%) of the program storage space. The maximum is 32,256 bytes. The Global variables use 62 bytes (3%) of the dynamic memory, leaving 1,986 bytes for the local variables. The maximum is 2,048 bytes.<br>How can I solve that? Is it a problem of my Arduino or Servo? Please help. :)
<p>hie, i want a program to rotate the servo motor using push button ie switch so can anyone help me with the main loop code </p>
<p>Thanks for the code.</p><p>I would like to add the code to enable transistor which supplies power to the motor before motor start code runs, then turn it after motor stops.</p><p>set pin 7 high - run motor code - set pin 7 low.</p>
<p>I am using SimpleTimer library for setting up time interval between feedings.</p><p>In addition I turn off the Servo Motor between feedings so that it doesn't make any noise and also doesn't drain the battery.</p><p>Hope someone can find this code useful.</p><p>#include &lt;Servo.h&gt; // create servo object to control a servo</p><p>#include &lt;SimpleTimer.h&gt;</p><p>Servo myservo; // create servo object to control a servo</p><p>// the timer object</p><p>SimpleTimer timer;</p><p>int pos = 0; // variable to store the servo position</p><p>void setup() {</p><p> myservo.write(0);</p><p> Serial.begin(9600);</p><p> timer.setInterval(86400000, feedMyFish); // Feed every 24 Hours</p><p>}</p><p>void feedMyFish() {</p><p> myservo.attach(9);</p><p> for (pos = 0; pos &lt;= 180; pos += 1) { // goes from 0 degrees to 180 degrees</p><p> // in steps of 1 degree</p><p> myservo.write(pos); // tell servo to go to position in variable 'pos'</p><p> delay(15); // waits 15ms for the servo to reach the position</p><p> }</p><p> for (pos = 180; pos &gt;= 0; pos -= 1) { // goes from 180 degrees to 0 degrees</p><p> myservo.write(pos); // tell servo to go to position in variable 'pos'</p><p> delay(15); // waits 15ms for the servo to reach the position</p><p> if (pos == 0) {</p><p> myservo.detach(); // Turn off Servo motor between feedings</p><p> }</p><p> }</p><p>}</p><p>void loop() {</p><p> timer.run();</p><p>}</p>
<p>I want to use the same arduino code for my other project which involves Dc motor in it please guide me to write the arduino code for it at intervals of 6hrs each </p>
<p>Which material is made the shampoo's bottle?</p>
<p>What did you do with the bread board in the video? </p>
Hey.. where did you do the coding? Im sorry i really have no idea in using arduino but now our professor want us to develop a system using arduino. I just dont know how it works, how to connect the code so the goal will be achieve..
<p>to be honest I never learned arduino. I make it up as I go using bits and pieces of other code I know.</p>
<p>You just kinda pick it up from starter kits and peoples projects online. It's based off C++ tho.</p>
<p>Here's the correct code. I fixed it.</p><p>#include &lt;Servo.h&gt; // create servo object to control a servo</p><p> // a maximum of eight servo objects can be created </p><p>Servo myServo; // variable to store the servo position </p><p>long FISHFEEDER = 80; // 12 hours between feeding</p><p>long endtime; </p><p>long now;</p><p>void setup() </p><p>{ </p><p> myServo.attach(9); // attaches the servo on pin 9 to the servo object </p><p> myServo.write(180);</p><p> delay(15);</p><p>}</p><p>void loop() </p><p>{ </p><p> int position;</p><p> now = millis();</p><p> endtime = now + FISHFEEDER;</p><p> while(now &lt; endtime) </p><p> {</p><p> myServo.write(0);</p><p> delay(20000);</p><p> now = millis(); </p><p> }</p><p> for (position = 0; position &lt; 180; position += 1) // goes from 0 degrees to 180 degrees </p><p> { // in steps of 1 degree </p><p> myServo.write(position); // tell servo to go to position in variable 'pos' </p><p> delay(15); // waits 15ms for the servo to reach the position </p><p> } </p><p> for (position = 180; position&gt;=1; position-=1 ) // goes from 180 degrees to 0 degrees </p><p> { </p><p> myServo.write(position); // tell servo to go to position in variable 'pos' </p><p> delay(15); // waits 15ms for the servo to reach the position </p><p> } </p><p>}</p>
<p>hi will this code move the servo 0-180 degrees and back again , once in 12 hours ? or the code thats in the instructable ?</p>
<p>How to change the time interval between two feed?</p><p>How have you calculated the count long FISHFEEDER = 43200000;</p>
<p>They calculated it in milliseconds 3600000= 1 hour</p>
<p>This is great one!!</p>
<p>Made a smaller version with Arduino Nano &amp; a SG90 for my tiny fish tank. A takeout sauce container is perfect for this.</p><p>Thanks for the instructable.</p>
<p>Nice work</p>
<p>Great work....</p>
<p>thank yiu</p>
<p>Thank you!!! Very simple but yet powerful fish feeder</p>
<p>Hi, does this just run constantly until the arduino is unplugged or just for one day</p>
<p>Hi, Thanks for this code.. i used and make a lot of mod's :) </p><p>Implement an Android App to feed the fish Mannually ...also the automatic Feed.</p><p>And then to Feed, Send a Tweet .. Saying &quot; Thks for Feed Me &quot; :3</p><p>i'm going to update the code at my Github profile..</p><p><a href="https://github.com/fabianchoxD" rel="nofollow">https://github.com/fabianchoxD</a></p><p>Tnks again for this code.</p>
<p>Very interesting. Looks nicely done!</p>
<p>Thank you!</p>

About This Instructable

41,380views

78favorites

License:

Bio: Maker from USA. Follow me to stay up to date on my projects and possible kickstarters! Business email: constructed@mail.com
More by Constructed:Wrist Mounted Laser Gauntlet Prototype LED Aquarium Light Conversion How to Make a Micro Hexacopter 
Add instructable to: