loading

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

<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

36,011views

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:Homemade 3 Axis Gimbal Cheap and Easy Micro Quadcopter Worlds Smallest Drone! 
Add instructable to: