Pet treat dispenser

April 10, 2025
Description
Description
I created this system to give dogs and their owners a more fun experience regarding treats. Gets the dog dopamine flowing.
The special part of the project is the “choice board”, which acts as the interface between the machine and the dog, and gives the dog the opportunity to select type of treat.
Functions
- Dog selects treat through “choice board”
- Owner selects treat through IR remote controller (I used 4 unused tv-remote buttons).
- Music and music-responsive lighting to get the dogs dopamine flowing when its time for a treat. When a button on the “choice board” is pressed, the music/light show instantly plays, helping the dog understand the relationship between the board and the treat machine.
Hardware
Machine electronics
- Arduino mega
- Voltage converter (5V output)
- HC-05 for communication with the “choice board”
- DF player mini for music with microSD ≤ 32GB
- 3W Speaker (4 ohm 6W) https://www.aliexpress.com/item/1005006848155088.html?spm=a2g0o.order_list.order_list_main.82.7ee21802UIHEJV
- 4x 28BYJ-48 stepper motors with ULN2003 drivers. one for each conveyor.
- 4x led strip ws2812b (13 diode strip for each conveyor).
- 4x IR transmitter-receiver modules. 1 for each conveyor. (black type) https://www.aliexpress.com/item/1005005401158349.html?spm=a2g0o.productlist.main.25.4880dyWodyWoZL&algo_pvid=ff276901-31b3-4a06-a029-5ebd92fea86e&algo_exp_id=ff276901-31b3-4a06-a029-5ebd92fea86e-12&pdp_ext_f=%7B%22order%22%3A%2214%22%2C%22eval%22%3A%221%22%7D&pdp_npi=4%40dis%21NOK%2159.58%2159.58%21%21%215.33%215.33%21%40211b80c217442041109715947e7bd6%2112000037952158413%21sea%21NO%213500969169%21X&curPageLogUid=ND3rfkDUb0ou&utparam-url=scene%3Asearch%7Cquery_from%3A
- IR-receiver for selecting treat through tv-remote. https://www.aliexpress.com/item/1005007972931363.html?spm=a2g0o.productlist.main.27.4da7bVBibVBiko&algo_pvid=8e575133-0c6e-4c5d-a6d4-16caaa7f3e36&algo_exp_id=8e575133-0c6e-4c5d-a6d4-16caaa7f3e36-13&pdp_ext_f=%7B%22order%22%3A%22238%22%2C%22eval%22%3A%221%22%7D&pdp_npi=4%40dis%21NOK%218.50%217.49%21%21%210.76%210.67%21%40210385a817442042105058978e833b%2112000043096196837%21sea%21NO%213500969169%21X&curPageLogUid=Mz5WL6FpLQ2Z&utparam-url=scene%3Asearch%7Cquery_from%3A
- 7-12V power supply
- 5x 470uF electrolytic capacitor
- 2x 1k ohm resistor
- 2x 2k ohm resistor
Machine 3d printed and other hardware
Aluminium frame:
- 6x (10mm x 500mm) aluminium rod
- 8x (10mm x 130mm) aluminium rod
- 6x (10mm x 145mm) aluminium rod
- 4x quad_joint_bottom.stl
- 4x quad_joint.stl
- 4x top_corner_joint.stl
- 4x M4 nuts
- 4x M4 35-40mm
Wooden box:
- 2x 33.5x80x2 cm (sides)
- 30x60x2 cm (top)
- 26x60x2 cm (bottom)
- 60x38x2 cm (back)
- 578x347x4mm (acrylic front)
For each Conveyor:
- 2x bearing_belt_tentioner.stl
- 28-byj-5mm-coupling.stl
- conveyor_belt.stl (or use fabric as belt. both work).
- 4x conveyor_frame_feet.stl
- 2x conveyor_gear.stl
- conveyor_motor_side.stl
- conveyor_normal_side.stl
- conveyor_support.stl
- 3x. top_cap_gear.stl
- 3x 635zz bearing
- 10x M4 20mm
- 10x M4 nuts
- 4x 5mm diameter alu/steel rods 50mm long
For each Conveyor IR transmitter-receiver module:
- sensor_house_cap.stl
- sensor_house_mount_1.stl (for conveyors on one side of aluminum frame, use sensor_house_mount_2.stl for other side). Meaning you need 2 of each for 4 conveyors.
- sensor_house.stl
Choice board electronics
- Arduino micro
- Power bank https://www.aliexpress.com/item/1005006820939965.html?spm=a2g0o.order_list.order_list_main.78.7ee21802UIHEJV
- HC-05
- 1x red LED
- 1x blue LED
- 1x green LED
- 1x 1k ohm resistor
- 1x 2k ohm resistor
- 2x 150 ohm resistor
- 1x 220ohm resistor
- 4x push button https://www.aliexpress.com/item/1005003340732790.html?src=google&pdp_npi=4%40dis!EUR!1.26!1.14!!!!!%40!12000043454311175!ppc!!!&src=google&albch=shopping&acnt=298-731-3000&isdl=y&slnk=&plac=&mtctp=&albbt=Google_7_shopping&aff_platform=google&aff_short_key=UneMJZVf&gclsrc=aw.ds&&albagn=888888&&ds_e_adid=&ds_e_matchtype=&ds_e_device=c&ds_e_network=x&ds_e_product_group_id=&ds_e_product_id=en1005003340732790&ds_e_product_merchant_id=108821505&ds_e_product_country=NO&ds_e_product_language=en&ds_e_product_channel=online&ds_e_product_store_id=&ds_url_v=2&albcp=21627925185&albag=&isSmbAutoCall=false&needSmbHouyi=false&gad_source=1&gclid=CjwKCAjwtdi_BhACEiwA97y8BJ6wFkyGC3nylrV2u-BKFexeIWPW2vvg6GMW174BUqkbMV2lQ-Nc4xoCRrcQAvD_BwE
Choice board 3d printed
- choice_board_1.stl
- choice_board_2.stl
- choice_board_electronics_housing.stl
- choice_board_electronics_cap.stl
- 4x choice_board_treat_container.stl
Choice button caps acrylic: 88x85x2mm
Software
- Arduino code written using VScode and the PlatformIO extension.
- Python for code used to generate light show based on mp3 file.
- All parts designed using Fusion 360.
- NaturalReader used for text to speech when dog selects treat from choice board. Did not find any good free options for Norwegian speech.
Wiring Diagram Machine (Better readability on github)
- When connecting HC-05 (bluetooth) and DF Player mini, remember to use the voltage divider shown in the diagram as they need 3.3V on their RX pin.
- Make sure to connect the DF Player mini capacitors as close to the module as possible.
- The 4 LEDs (ws2812b) each represent a strip of 13 LED's.
- Notice how the 9V power supply at the bottom of the diagram goes directly to Arduino Vin and GND, as well as to the input of the voltage converter. Then the output of the converter is set to 5V and used to power everything else in the diagram.
- I recommend using a perfboard with 5V terminals to provide power to all motors, sensors and LED strips.
Wiring Diagram Choice Board
- When connecting HC-05 (bluetooth), remember to use the voltage divider shown in the diagram as it needs 3.3V on its RX pin.
- 220 ohm resistor used instead of 150ohm for blue LED, as blue LED's illuminate more than red and green.
- The push buttons uses internal pull-up resistor, so no external resistors needed.
- I recommend using a perfboard with pinouts for buttons, LED's and HC-05.
Code with comments
https://github.com/Sneipen/Treatinator
Printing Instructions
- All parts but the conveyor belt (TPU, use a dark color) is printed using PLA
- Layer height is 0.2mm for all parts.
- Infill is 25% and 4 walls for all parts but 28-byj-5mm-coupling, which is 100% infill.
- Used support for sensor_house and choice board parts, as they have a lot of overhang (printed laying down).
Assembly Instructions
Aluminium frame
- build all 3 sections (bottom, mid, top). Remember to add quad_joint_bottom to the bottom section if you plan to fasten the frame to a wooden box like i did.
- add vertical rods and join the 3 sections. I did not use any glue.
Conveyors
- Glue a 50mm rod such that 12mm sticks out on one side and 12mm on the other side. Glue 28-byj-5mm-coupling to one of the sides. Glue a top_cap_gear to the other side.
- Glue a 50mm rod such that 12mm sticks out of one side and 25mm sticks out on the other side. glue a top_cap_gear to both sides.
- Add a bearing_belt_tentioner with 635zz bearing to both conveyor_motor_side and conveyor_normal_side. Add M4 screw and nut to somewhat keep it in place.
- mount stepper to conveyor_motor_side and attach to the gear with the coupling, no glue needed.
- Add the other gear and mount the conveyor_belt.
- Place conveyor_normal_side with a bearing into the gear rods.
- place on top of conveyor_support and tighten support screws. 2 screws/nuts is enough on each side.
- Tighten the belt. (If too much or too little tension, the motor wont drive the belt properly).
- Fasten LED strip of 13 diodes on top of conveyor_normal_side using glue or tape.
- Place the IR transmitter-receiver module inside of the sensor_house with jumpers connected and glue the sensor_house_mount. press fit the sensor_house cap to keep the sensor in place.
- Add reflective tape bits (aluminium tape or white tape) about 1cm wide and 3cm long with spacing to fit a treat of your choice along the edge of the conveyor_belt.
- mount sensor over the tape bits.
Mount conveyor structure to aluminium frame
- place conveyor_frame_feet on the aluminium frame.
- add glue to the input rails of the feet.
- push conveyor into the glue such that one pair of the feet is at the end of the conveyor.
Other assembly
- Speaker mounted to aluminum frame using zip ties.
- cables for LED strips etc taped to frame to make it look cleaner.
Choice board
- Press fit choice_board_1, choice_board_2 and choice_board_electronics_housing
- glue push buttons into slots
- wire buttons according to diagram
Wooden box
I cut angles as shown in assembly and STL files. However, this is not needed. Just make sure inner dimensions are large enough to fit the frame. Drill holes on bottom part to fasten frame to box.
Other information
All components that must be used due to compatibility are linked to throughout this document.
To make the machine respond to IR signal from TV-remote you must figure out what signals the buttons make. Follow this guide: https://projecthub.arduino.cc/krishna_agarwal/decode-ir-remote-control-signals-of-any-remote-using-arduino-9b8e30