loading
1Instructables503Views19 Comments

Tell us about yourself!

Complete Your Profile
  • airscapes commented on Doug Costlow's instructable Pet Feeder2 months ago
    Pet Feeder

    Not sure I can help, I used the exact same model the as the original instructions say to use. Code makes it move forward and back. You must zero your servo with a little program found in the library, you run that program and turn the screw ever so slowly till it stops moving. Then reload the code you want to run.. may be the problem.. not an expert learned what I needed as I did the project using google..

    View Instructable »
  • airscapes commented on Doug Costlow's instructable Pet Feeder2 months ago
    Pet Feeder

    This is the simplest version I have. // This sketch will operate a servo in the auto cat feeder as soon as it boots.// The Arduino is powered on and off with an external timer and relay// this was done to save battery power, the Arduino, External 5v regulator, and servo power // are all provided 12v when the timer goes off and closes the relay. The boot and ontime of the servo// is approximately 13 seconds, the timer on time is about 15 seconds. A momentary push button can be// depressed and held to provide voltage for an demand run.// Updated 8-14-2016 Feeder now runs 2x day so reducing output changing for loop from a count of 18 to 10 which is 1/2 cup// Next update will be to install a switch, set a pin to pinMode(#, INPUT_PULLUP) then when gounded (switch closed) pin is low so se...see more »This is the simplest version I have. // This sketch will operate a servo in the auto cat feeder as soon as it boots.// The Arduino is powered on and off with an external timer and relay// this was done to save battery power, the Arduino, External 5v regulator, and servo power // are all provided 12v when the timer goes off and closes the relay. The boot and ontime of the servo// is approximately 13 seconds, the timer on time is about 15 seconds. A momentary push button can be// depressed and held to provide voltage for an demand run.// Updated 8-14-2016 Feeder now runs 2x day so reducing output changing for loop from a count of 18 to 10 which is 1/2 cup// Next update will be to install a switch, set a pin to pinMode(#, INPUT_PULLUP) then when gounded (switch closed) pin is low so set value for loop.#include <Servo.h> // include the servo libServo my_servo; // define my server objectServo door_servo;int ledPin = 13; // LED connected to digital pin 13 can remove before going liveint input_value = 1; // when power up set valueint pos = 0; // variable to store the servo positionint check_pin = 0; // temp var to read pin valueint loop_cnt = 0; // var to hold max number of loops (for loop)int lessfood = 0; // pin 0 will be input_pullup so when it goes low less foodint morefood = 2; // pin 2 will be input_pullup so when it goes low more foodvoid setup(){ pinMode(ledPin, OUTPUT); // sets the digital pin as output so I know it is working with no servo my_servo.attach(9); //Attach pwm signal wire to pin 9 door_servo.attach(8); //Attach pwm signal wire to pin 8 for door servo pinMode(lessfood, INPUT_PULLUP); // Switch to gound for less food (1/2 cup = 10 iterations) pinMode(morefood, INPUT_PULLUP); // Switch to gound for less food (1/2 cup = 10 iterations)}void loop(){ // soon as powered up run check_pin = digitalRead(lessfood); if (check_pin == HIGH){ loop_cnt = 10; check_pin = LOW; check_pin = digitalRead(morefood); if (check_pin == HIGH){ loop_cnt = 18; check_pin = LOW; } if (input_value > 0) { // Open door in front of auger door_servo.write(20); for (int cnt = 0; cnt < loop_cnt; cnt++) { if (input_value > 0 ) { digitalWrite(ledPin, input_value); my_servo.writeMicroseconds(1425); // Backup delay(250); my_servo.writeMicroseconds(1600); // Forward delay(350); } // end if } // end for digitalWrite(ledPin, 0); // Turn off LED my_servo.writeMicroseconds(1425); // Backup delay(250); my_servo.writeMicroseconds(1500); // stop servo delay(500); door_servo.write(90); delay(500); door_servo.write(20); delay(500); door_servo.write(90); delay(500); door_servo.write(20); delay(500); door_servo.write(90); delay(500); door_servo.write(20); delay(500); door_servo.write(90); delay(500); } input_value = 0; // All done so set value so nothing happens in the next loop.} // End void loop()

    View Instructable »
  • airscapes commented on Doug Costlow's instructable Pet Feeder2 months ago
    Pet Feeder

    I have since added an additional switch to allow for 2 feeding amounts as I have started using this at 2x a day and it was too much food. The code reflects this change. Not sure how it will paste into this comment Keep in mind, my arduino is only powered on for a few more seconds than it takes to run the code since it is controlled by an external timer.Good luck// This sketch will operate a servo in the auto cat feeder as soon as it boots.// The Arduino is powered on and off with an external timer and relay// this was done to save battery power, the Arduino, External 5v regulator, and servo power // are all provided 12v when the timer goes off and closes the relay. The boot and ontime of the servo// is approximately 13 seconds, the timer on time is about 15 seconds. A momentary push...see more »I have since added an additional switch to allow for 2 feeding amounts as I have started using this at 2x a day and it was too much food. The code reflects this change. Not sure how it will paste into this comment Keep in mind, my arduino is only powered on for a few more seconds than it takes to run the code since it is controlled by an external timer.Good luck// This sketch will operate a servo in the auto cat feeder as soon as it boots.// The Arduino is powered on and off with an external timer and relay// this was done to save battery power, the Arduino, External 5v regulator, and servo power // are all provided 12v when the timer goes off and closes the relay. The boot and ontime of the servo// is approximately 13 seconds, the timer on time is about 15 seconds. A momentary push button can be// depressed and held to provide voltage for an demand run.// Updated 8-14-2016 Feeder now runs 2x day so reducing output changing for loop from a count of 18 to 10 which is 1/2 cup// Next update will be to install a switch, set a pin to pinMode(#, INPUT_PULLUP) then when gounded (switch closed) pin is low so set value for loop.#include <Servo.h> // include the servo libServo my_servo; // define my server objectServo door_servo;int ledPin = 13; // LED connected to digital pin 13 can remove before going liveint input_value = 1; // when power up set valueint pos = 0; // variable to store the servo positionint check_pin = 0; // temp var to read pin valueint loop_cnt = 0; // var to hold max number of loops (for loop)int lessfood = 0; // pin 0 will be input_pullup so when it goes low less foodint morefood = 2; // pin 2 will be input_pullup so when it goes low more foodvoid setup(){ pinMode(ledPin, OUTPUT); // sets the digital pin as output so I know it is working with no servo my_servo.attach(9); //Attach pwm signal wire to pin 9 door_servo.attach(8); //Attach pwm signal wire to pin 8 for door servo pinMode(lessfood, INPUT_PULLUP); // Switch to gound for less food (1/2 cup = 10 iterations) pinMode(morefood, INPUT_PULLUP); // Switch to gound for less food (1/2 cup = 10 iterations)}void loop(){ // soon as powered up run check_pin = digitalRead(lessfood); if (check_pin == HIGH){ loop_cnt = 10; check_pin = LOW; check_pin = digitalRead(morefood); if (check_pin == HIGH){ loop_cnt = 18; check_pin = LOW; } if (input_value > 0) { // Open door in front of auger door_servo.write(20); for (int cnt = 0; cnt < loop_cnt; cnt++) { if (input_value > 0 ) { digitalWrite(ledPin, input_value); my_servo.writeMicroseconds(1425); // Backup delay(250); my_servo.writeMicroseconds(1600); // Forward delay(350); } // end if } // end for digitalWrite(ledPin, 0); // Turn off LED my_servo.writeMicroseconds(1425); // Backup delay(250); my_servo.writeMicroseconds(1500); // stop servo delay(500); door_servo.write(90); delay(500); door_servo.write(20); delay(500); door_servo.write(90); delay(500); door_servo.write(20); delay(500); door_servo.write(90); delay(500); door_servo.write(20); delay(500); door_servo.write(90); delay(500); } input_value = 0; // All done so set value so nothing happens in the next loop.} // End void loop()

    View Instructable »
  • airscapes commented on Doug Costlow's instructable Pet Feeder3 months ago
    Pet Feeder

    Thanks, I actually just added yet another option yesterday with the addition of a toggle switch to select more = 1 cup or less = 1/2 cup of food. very simple with the arduino as the controller. Hope to get me a 3D printer next year some time.. just not sure if I have the time to learn the software.. I keep finding things where I say.. If I had 3D printer I could fix that! ;-)Doug

    View Instructable »