Dog treat dispenser!

About This Project

This is a dog treat dispenser controlled by a raspberry pi and an Arduino using Cayenne. This is a very basic design and is only a prototype. I do not have a 3d printer, so getting a design that dispenses treats was very hard.

What’s Connected

Items used:

  • Arduino R3
  • raspberry pi 3
  • servo motor
  • 10k resistor (I used ten 1k resistors in a series because I didn’t have a 10k on me)
  • female and male wires
  • some type of mechanism to dispense treats that uses a servo motor (3d printer would be VERY useful for this, or you could do my low budget design)

Connections
From Arduino

  • GND → Raspi GND
  • GND → Servo (brown wire)
  • 5V+ → Servo (red wire)
  • D9 → Servo (orange wire)
  • D8 → 10k Resistor (mine are ten 1k
    resistors in a series) → Raspi GPIO 22
    From Rpi
  • GND → arduino GND
  • GPIO22 → 10k resistor → arduino D8

Code - #include <Servo.h>Servo myservo;void setup() { pinMode(8, INPUT); - Pastebin.com

Basically, the raspberry pi sends a HIGH or LOW signal corresponding to the button state in Cayenne to the Arduino which reads the signal as HIGH or LOW. If the signal is HIGH it sets the servo to push toward the treats. If it reads LOW, then it will go back to the default position allowing more treats to fall down taking the place of the last one.

Triggers & Alerts

None were needed.

Scheduling

No, but it is very easily possible if you want to give your dog a treat at specific times.

Dashboard Screenshots

Photos of the Project

Instructables and Hackster.io links

1 Like

Great! Can you use an Arduino UNO and ESP8266 for connection?

I’m sure you could use an ESP8266 + Arduino UNO to get the same results, but I do not have an ESP8266. You can also use a wifi shield. But the logic stays the same. Send a high or low signal for the Arduino to read and turn the servo based on the state,

You may wanna check this out to see some more info:

I forgot I still had that post there. I changed it to point you to the real “how-to” from @kreggly.

Cool project, thanks for your submission!

Are your dogs disciplined to patiently wait for that thing to dispense? I feel like mine would wait until I left the house and then make short work of that treat dispenser, all of the automation in the world aside :slight_smile:

I’m guessing the raspberry pi is just facilitating the internet connection to Cayenne, and that’s why you have both?

Thanks! Knowing my dog, he would probably do the same as yours, a hit and run! And yes, the Raspberry Pi is used as internet connection to Cayenne because I don’t have a wifi shield for arduino (I’m getting on soon though :smiley: ).