Arduino Pet Feeder
This automatic pet feeder is a simple build for those for want to dispense food out for their pets at set times. The times that food will be dispensed are set in the code and are marked, to easily allow for users to set their preffered times.
Take note to set the clock to the right time, as the clock will start counting when the clock is turned on.
Supplies
The materials to make the automatic pet feeder are relatively cheap and easily to put together. However the materials marked with the (*) sign are required to be 3D printed, and not many people would have a 3D printer at their own home. However, you don't have to buy one for this build, as you can use them for free or for a low fee at 3D printing clubs or schools. The program code is also listed in the files.
Materials:
- Arduino Uno (1x)
- Breadboard (1x)
- Jumper Wires (3x)
- Micro Servo Motor (1x)
- Empty Soft Drink Bottle (1x)
- Shoe Box (1x)
- Bottle Connector (1x)*
- Servo Mount (1x)*
Preperation
Even before you you put anything together, the most important thing to do is prepare your equipment.
This heavily applies to the Arduino Uno itself. We ourselves faced problems with our original board, that due to time restrains, forced us to swap it. Make sure to connect the Arduino to your computer, and test it by using an example program that's available in the Arduino IDE; the blinking onboard LED is a good one
It's also recommended that you 3D print both the servo mount and the bottle connector now. The problem lies especially with the bottle connector, as 3D printers sometimes have trouble printing small details on objects. This happened to us, as we found the servo connector point hole, was filled in.
Once you have these two parts sorted out, your good to go !
Testing the Motor
The first step is connecting your micro motor to the Arduino Uno. Your will have to inevitably disconnect and reconnect it later, but its easier to test in this test in state, and the process is relatively simple, as it only required 3 jumper wires to do so. The motor we used, the Micro Servo SG-90, followed the layout in the picture above: red for 5v, brown for ground, and orange for pin output. Simply, connect the wires from the designated outputs from the Arduino Uno to the corresponding motor inputs.
A way to see if the motor is properly wired, is to connect the setup to a computer with a USB cable, without even having to upload any code in. As soon as it's connected, the motor should turn on for a fraction of a section, and create an audible noise.
The best way to test it however, is to upload the provided code to the Arduino itself. Using the code as it is, the motor should spin 2 times 10 seconds after uploaded. ( the serial monitor will display the time, as well as when the motor should be spinning (feeding time). There will also be another feeding time 1 minute after the first one.
If this all works, the motor section is ready !
Assembling Dispenser
Connecting to the motor to the bottle is again, relatively simple, but it's nonetheless important that it's done well, as we don't want the bottle falling out.
The bottle connector should just be able to just screw onto the bottle opening. Joining the connector to the motor can be a bit trickier. If the holes aren't covered up, you can use the provided motor attachment, and screw it into the holes. If they are covered up, like in our case, then hot gluing the attachment to the connector is the most stable option
To test if this works, connect it to the motor, and run the code making sure that the bottle spins with the motor.
Attaching Dispenser to Shoe Box
The next step is to connect the dispenser mechanism to your box. This, requires the 3D printed motor mount. The servo mount we had was designed to be screwed in to the motor, but since the motor we had was a little smaller, we used hot glue.
There are also screw holes on the servo mount to screw into the shoe box. However, as they likely wouldn't hold in the shoe box, we used hot glue again. It is recommended that you position the mount at a slight angle, as to allow pet food to easily fall out.
Positioning the Arduino
With the dispenser attached, the next step is to do the same for the Arduino. As to not damage the board, instead on hot glue, blue-tac will be used. However, this will be far harder to properly to stick to the box.
In the inside of the box, stick the Arduino to the side has the most space, while being close to the dispenser. To connect the dispenser to the Arduino, we used a pre existing hole in the shoebox to put the wires through. This will also serve as the hole to put the USB cable through that will connect the micro controller to the computer. We recommend doing some cable management, just to make any future work on the device a bit easier. In our case, we used some spare blue-tac to glue the wire to the side of the shoe box.
Code Configuration
Your pet feeder is nearly ready! The final step, is to make sure that it's properly configured, meaning that its time is set correctly, and that it dispenses food at the necessary times.
The line of code marked with the "(1)" comment, sets the initial time of the device
The line of code marked with the "(2)" comment is where the existing alarm functions are placed. In the same manner that you modified the internal clock, you can change when the food will be dispensed.
The code marked with the "(3)" commend is the code behind the alarm functions. To create a new alarm function, simply copy and paste it, modifying its name. Then make make a function in the "(2)" area, similar to the existing ones, putting in your own times.
Finally, your pet feeder is done! Enjoy !