Arduino Dog Food Dispenser

1,836

29

11

Introduction: Arduino Dog Food Dispenser

Want to be able to feed your dog in a timely manner every day but always lose track of time? Look no further; this Instructable will teach you how to build your own Arduino-powered dog food dispenser. I made this for my Students Involved in Discovering Engineering (SIDE) Project for Ms. Berbawy's Principles of Engineering class. The project was a great experience to learn basic circuitry and coding and improve my CAD and Adobe Illustrator skills.


Note: This project's inspiration was an Instructable for an Arduino Controlled Dog Food/Treat Dispenser by crazydeadmoth. Multiple changes were incorporated in the design to facilitate easy maintenance, increase stored food capacity, and select the amount of food to be dispensed.

Step 1: Gather Materials and Tools

Materials

Electronics

Materials

  • 4 cabinet door magnets
  • pieces of 1/4' birch wood
  • pieces of 1/8' acrylic (any color is fine & TAP Plastics is a good reseller)
  • 1/8" acrylic rod (also available from TAP Plastics)
  • Mylar Sheet
  • Devcon 2 Ton Epoxy
  • Acrylic Glue

Tools

  • Laser Cutter
  • Wire Cutters
  • Wire Strippers
  • File
  • Soldering Iron
  • Computer (have Arduino IDE downloaded)

Step 2: Laser Cut the Plywood Pieces

I created Adobe Illustrator files for the plywood pieces. You can download the attached files and cut the pieces using the laser cutter. The pictures above tell you what each piece is used for.

Note: The files are made for 12" x 24" wood pieces.

Step 3: Laser Cut the Acrylic Pieces

I created Adobe Illustrator files for acrylic. You can download the attached files and cut the pieces using the laser cutter. The pictures above tell you what each piece is used for.

Note: The files are made for 12" x 24" acrylic pieces.

Step 4: Assemble the Box

Except for the top and the two side pieces, all other pieces have to be glued. The side pieces are held in place using magnetic latches and are easily removable for easy maintenance. The top piece snaps into the groves.

Start by mixing the 2-Ton Epoxy*. Spread the Epoxy on the finger joints of the front and bottom pieces. Attach the front to the bottom piece. Make sure to attach the pieces to the joints that extend 0.25". The 0.25" holes on the bottom have to be on the left side when looking from the front. I recommend spreading some epoxy on the inside part of the bottom joints. Next, apply Epoxy on the joints and edges of both wheel supports. Slide them into the holes in the bottom piece, making sure the wood piece goes in the bigger holes, and they are precisely 90˚ from the bottom. I used a set square to make sure it is 90˚ and used an elastic headband to hold the set square while the epoxy hardens. Spread the Epoxy on the finger joints of the back piece and attach it to the bottom piece. Make sure to attach the piece opposite of the front part, and the hole is on the same side as the holes on the front piece. Once all the Epoxy is hardened, attach the magnets using Epoxy halfway down on both sides of the front and back pieces. Measure how far down the magnets are glued and glue the other part of the magnet accordingly on the side acrylic pieces.

*Note: Make sure that when mixing the Epoxy, it turns completely white; otherwise, the pieces come apart very quickly.

Step 5: Assemble the Wheel, Ramp, and Wheel Axle

Wheel

I marked all the pieces to align the pieces to the marking while gluing to attach the wheel. From the center of the tiny circles on pieces 1 and 2, mark a 1.25" line on either side of the circle. Take pieces 3 and 4 and draw a line marking the halfway point of the longer side. Using acrylic glue, attach the shorter side of piece 5 to the marked line on piece 3. Attach piece 4 to the other side of piece 5, making sure piece 5 is aligned to the halfway mark. Now attach the longer side of piece 5 to align with the marking on piece 2. Do the same thing on the opposite side with piece 1. Take two connector pieces for the motor. Glue one connector on each side of the wheel, aligning the hole to the hole on the wheel's circle. Add a mylar sheet around the wheel, leaving the top part open for the food to fall in.

Ramp

File at a 50˚ angle on one of the longer edges of both ramp pieces. Spread acrylic glue on one filed edge and attach it to the other piece's filed edge.

Wheel Axle

Glue one of the axle pieces to the outside of the acrylic wheel support, aligning the holes together. Cut a 1" piece of the acrylic rod and glue it inside the second axle piece. Using a motor screw, screw the two-axle pieces together.

Step 6: Assemble the Funnel

Funnel
First, assemble the funnel base using the pieces marked, 5,6,7,8,9 in the picture above. The four small pieces (5,6,7,8) connect to piece 9 at the inside edge of the inner cutout on piece 9. Use acrylic glue to attach the pieces; the connected pieces should look like the third picture.

Note: You may have to file a few pieces to make sure they fit exactly inside piece 9.

Next, connect the pieces marked 1,2,3 & 4. This will be the top of the funnel. For Pieces 1 & 3, the short parallel sides are of the same length, and they go on the front and backside. Pieces 4 & 2, the right and left sides of the funnel touch the box's front. Using acrylic glue, join pieces 1 and 3 on the inside of pieces 4 and 2. It may help if you tape the pieces together before applying the glue. Once the four pieces are connected, file the shorter end to make it flat and join with the bottom piece, as shown in the 5th picture above.

File the longer edges at the top to make them flat.

Step 7: Glue the Ramp

To attach the ramp, you first have to file the bottom of the longer piece to make it flat. Next, spread Epoxy on all the edges of the ramp, and slide the ramp in between the wheel supports, on the side of the opening on the bottom. Make the ramp flush to the front piece and hold down for 2 minutes.

Step 8: Fix Wheel and Funnel

Both the funnel and the wheel are removable pieces for cleaning purposes.
To attach the wheel: Fix one connector onto the motor shaft. On the other side, screw the wheel axle and push the wheel axle through the wheel support and into the second connector on the wheel. Screw the axle pieces together.

To attach the funnel, rest it on top of the wheel supports. The outside pieces must touch the acrylic pieces on the box.

Step 9: Soldering

You will need to solder wires onto the 12-pole switches.

Take seven male-to-female wires and unsheathe the male side. Solder the unsheathed sides to poles 1, 4, and 7 on both switches. The poles on the switches should be labeled; if not, use the picture above. With the seventh wire, solder it to the ground pole on one of the switches. Now take a male-to-male wire and unsheathe both sides. Solder the wire connecting the ground poles of both switches.

Note: To help with wiring, it would be beneficial to use different colored wires.

Step 10: Mount the Electrical Components

Motor: Fit the motor into the hole in the wood wheel support and screw into the support. The motor shaft should be in between the two-wheel supports.

Arduino Board: Screw the Arduino UNO under the motor, on the outside of the wheel support.

LED: Put the LED into a LED holder, push them from the outside into the topmost hole on the front side.

Battery Holder: Screw the battery holder onto the wooden wheel support under the on/off switch. You might need to break off the bottom piece of the holder for the battery to fit.

Switches

12-pole Switches: These switches go in the front. Push the switch through the third hole and last hole from the inside, making sure pole 1 is on top. Screw on the tightening nut and add the knob. Repeat for the second switch.

*Note: If the threads do not make it through the wood, make the hole slightly bigger.

Rocker Switch: This switch goes in the back. Push the switch from the outside into the hole, making sure the O is on top.

Step 11: Wiring

Motor

Connect the red wire to the 5V port using a male-to-male wire.

Connect the orange wire to Digital port 9 using a male-to-male wire.

Connect the brown wire to ground (GND) using a male-to-male wire.

Amount Switch

Connect the wire from pole 1 to Digital port 2 using a male-to-male wire.

Connect the wire from pole 4 to Digital port 3 using a male-to-male wire.

Connect the wire from pole 7 to Digital port 4 using a male-to-male wire.

Time Switch

Connect the wire from pole 1 to Digital port 5 using a male-to-male wire.

Connect the wire from pole 4 to Digital port 6 using a male-to-male wire.

Connect the wire from pole 7 to Digital port 7 using a male-to-male wire.

On/Off Switch

Connect one terminal from the switch to the red wire of the battery holder. Connect the second wire from the terminal to the red wire of the power jack. Connect the black wire of the battery holder to the black wire of the power jack. All connections were made by crimping the wires with butt connectors.

LED

Unsheathe one end of two male-to-male wires. Using butt connects, crimp the wires connecting to the LED to an unsheathed male to male wire. Connect the black wire to ground (GND) and other wire to Vin.

Step 12: Programming

Copy and paste the following program into Arduino IDE and upload to the board.

#include <Servo.h> //Servo library

int fill = 0;  //default motor starting position when the continer fills.
int empty= 135; // motor position when emptying the container
int amount = 1; // number of cups to feed
int interval = 4; // interval between feeds in seconds
Servo mainServo;


void setup() {
  // put your setup code here, to run once:
  mainServo.attach(9);
  
  pinMode(2, INPUT_PULLUP); // pin 1 on amount switch
  pinMode(3, INPUT_PULLUP); // pin 4 on amount switch
  pinMode(4, INPUT_PULLUP); // pin 7 on amount switch
  pinMode(5, INPUT_PULLUP); // pin 1 on time switch
  pinMode(6, INPUT_PULLUP); // pin 4 on time switch
  pinMode(7, INPUT_PULLUP); // pin 7 on time switch
 
}

void loop() {
  // put your main code here, to run repeatedly:
  amount = 1 ; // set to min value
  if ( digitalRead(2) == LOW){
      amount = 1; 
  }
  else if (digitalRead(3) == LOW) {
    amount = 2;
  }
  else if (digitalRead(4) == LOW) {
    amount = 3;
  }
  
runmotor();
  if (digitalRead(5) == LOW) {
    interval = 4;
  }
  else if (digitalRead(6) == LOW) {
    interval = 8;
  }
  else if (digitalRead(7) == LOW) {
    interval = 12;
  }
  
  
  delay(interval * 3600000);
}

void runmotor(){
  for(;amount > 0; amount--) {
    mainServo.write(empty);
    Serial.write("Motor run starting");
    delay(2000);
    while(mainServo.read() >100){
        mainServo.write(fill);
        delay(2000);
        mainServo.write(empty);
    }
    mainServo.write(fill);
    delay(2000);
    Serial.write("Motor run completed");
   Serial.println();
  }
 }<br>

Step 13: Thank You!

Thank you for checking out my Instructable! I hope you enjoyed it. If you followed along and made your own, I would love to see a picture of it! If you have any questions, please leave them in the comments below.

Be the First to Share

    Recommendations

    • Home Decor Challenge

      Home Decor Challenge
    • Furniture Contest

      Furniture Contest
    • Arduino Contest

      Arduino Contest

    11 Comments

    0
    lait66705
    lait66705

    Question 8 days ago

    What should I do if I want the machine to deliver the feed at a certain point in time

    0
    aditi.srinivas11
    aditi.srinivas11

    Answer 8 days ago

    I'm sorry I haven't exactly figured out a program for that. Although if your timings are a certain time apart say every 8 hours and you want it to dispense at 6 am, 2 pm, and 10 pm, you may start it at 2 pm and then it will dispense every 8 hours at those exact intervals. Again I'm very sorry that I don't have an exact solution.

    0
    lait66705
    lait66705

    Reply 7 days ago

    Thank you 👌👌

    0
    Ian Van Cauwenberg
    Ian Van Cauwenberg

    7 weeks ago

    Great work! The detailed descriptions and tons of pictures make everything easy to follow. The circuit schematic and component list come in handy as well. Doesn't look bad from the outside either with a nicely finished case.

    0
    aditi.srinivas11
    aditi.srinivas11

    Reply 7 weeks ago

    Thank you! My teacher had told us to make sure our project looked nice so I'm glad you like the case.

    0
    vibhutigoda
    vibhutigoda

    8 weeks ago

    Awesome work Aditi, so much detailing and intricacies, it’s more like an engineering project. Extremely commendable and proud of you. Keep going .

    0
    seamster
    seamster

    8 weeks ago

    This looks great, thank you for sharing the details of your project. Nice work!

    0
    aditi.srinivas11
    aditi.srinivas11

    Reply 7 weeks ago

    Thank you for checking it out!

    0
    Timothy_Decoopman
    Timothy_Decoopman

    8 weeks ago

    Thankyou Aditi, You really made a very detailing description. You have taken a lot of pictures which makes it easy to follow every step. Good Work
    0
    aditi.srinivas11
    aditi.srinivas11

    Reply 7 weeks ago

    Thank you! I'm glad it was easy to follow!