1 / 5
Automatic Milk Bone Dispenser — zdjęcie 1
1 / 5

Automatic Milk Bone Dispenser

Zamów wydruk tego modelu

Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.

Zapisane na tym urządzeniu.

Fun project I built with my kids, when the button is pressed a single Milk Bone is released from the hopper.

Ocena
0 / 5
Polubienia
9
Pobrania
15
Wydruki
0
Wyświetlenia
479
Oceny
0

Aktualizacja u źródła:

Informacje o modelu

Źródło
Printables
Kategoria
Pets
Licencja
Creative Commons — Attribution — Noncommercial — Share Alike

Automatic Milk Bone Dispenser 

 

Description:

This project automatically pushes a single Milk Bone from a hopper. When powered on, the dispenser initializes by pulling the rack back for 2 seconds then releasing tension. When the arcade button is pushed, a servo connected to a pinion pushes out the Milk Bone and then retracts, allowing for gravity to ready the next bone from the hopper.  There is a variable delay as to not allow our dog to get too many treats at once. The dispenser wont re-arm until after it's cooldown period.

Backstory:

After watching the movie Honey, I shrunk the kids, my son and daughter were fascinated with "the automatic dog feeder" from the movie. So we worked together to design and name our own "Dog Treat Dispenser". Now our German Shepherd, Scout, can grab a snack when she wants. There is a timer in the logic to only allow her one Milkbone every x amount of time so she doesn't eat to much!

This was a great project to show the kids how an idea can go from a thought to code to design and then implementation. We learned about rare problems like, what if the the power goes out when the rack is half way? What to do when the power comes back on? What if our dog presses the button many times in a row?      We needed to think of how to programmatically solve these problems.

Hardware and Software Used

Hardware:
  • Arduino Duemilanove for initial programming and Debugging
  • Arduino Nano for implementation
  • Arduino Nano Screw Terminal Board
  • Wire
  • Arcade Button
  • Continuous motion Servo
  • Small nylon or metal bolts / nuts

Software:
  • Fusion360 for Rack and Pinion / Hopper design.
  • Arduino IDE for programming and uploading code to the Arduino

Wiring Diagram:

Code:

#include <Servo.h>

// Define servo and button pins as well as configurables int servoPin = 7; //set the digital output pin for the servo pwm wire int buttonPin = 4; // set the input button for pin int initialize = 0; // leave this at zero, this is a counter for first power on initialization int waittime = 5000; //Set the amount of milliseconds to wait until looking for another treat int extend = 2000; //extend time int retract = 2000; //retract time int initialization = 2000; // How long to pull the rack back for initial startup

// Create servo object Servo myServo;

void setup() { // Attach servo to pin myServo.attach(servoPin);

// Set button pin as input pinMode(buttonPin, INPUT);

// Enable pull-up resistors (optional) digitalWrite(buttonPin, HIGH); }

void loop() { if (initialize == 0) { //This runs once myServo.write(0); //it pulls the rack all the way back into ready position delay(initialization); myServo.write(180); //releases tension delay(100);
} else {} //after the program initializes once it doesnt have to anymore // Read button state int buttonState = digitalRead(buttonPin); //is the button pressed or no?

// Check if button is pressed. I am using a normally closed switch that opens when pushed, this helps to not need debouce and dealing with noise if (buttonState == LOW) { //if button is not pushed myServo.write(85); //idle threshold (normally 90 but mine doesn't move at 85) } else { //if button is pushed myServo.write(180); delay(extend); myServo.write(0); delay(retract); myServo.write(85); delay(waittime);
} initialize = 1; // this allows the initialization to be skipped in the beginning }

Printing Instructions:

  • Print with PLA or PETG
  • Layer Height .2
  • Infill of your choosing (Mine was 15%)
  • Supports are recommended for the base

Assembly Instructions

  • Using the servo shaft round accessory screw  the round plate to the Pinion (or glue)
  • Place the rack into the slot on the base (there are stops on either side so it must be placed in before the servo)
  • The servo should bolt in using the included holes.
  • The Rack and Pinion should now be meshed.
  • The hopper slides onto the top of the base
  • Place the arcade button into
  • Adjust and customize the code above using the Arduino IDE 
Wiring:
  • Using the "common" and "normally closed"  part of the arcade switch use wire to connect to the arduino on the ground pin as well as d4 (digital pin 4)
  • The continuous servo has 3 wires, connect the black wire to GND on the Arduino, the Red wire to 5V on the Arduino and the yellow wire to D7
  • The Arduino will be connected to power via the USB port to when ready connect that to a usb charger or computer.

Demo and Usage Instructions

When the button is pressed a large Milk Bone is ejected and a new one is positioned into the hopper.

 

Video:

Tagi