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.