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


  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)


  1. Drill
  2. Hot Glue Gun
  3. Computer (to code)
<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




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:Turn Nearly Anything Into an Instrument How to Build a 210 Quadcopter Homemade 3 Axis Gimbal 
Add instructable to: