Monday, December 21, 2015

TreatMaster V-1 - Remote Dog Treat Dispenser powered by Raspberry Pi


I designed a Treat Machine (TreatMaster V-1) between March to May, 2013. It is a Remote Dog Treat Dispenser that you allows you to trigger it via email. It is powered by Raspberry Pi. Read on if you wanna know more. I also made an upgraded version TreatMaster V-2. It is a lot more polished and allows you to control remotely through an iPhone App. Go here for more about TreatMaster2.


It started from reading online that there is a gadget that runs a full unix operating system. It is basically a complete computer at the size of a deck of playing cards. It is called the Raspberry Pi. It caught my attention with the potential, and being so small and neat. I had to have one to play around with. I bought it from Adafruit along with some electronic start up kits. As soon as I got it, I wasted no time to try it out. It was pretty simple to setup, and I was having fun playing around with it for the next 2 weeks. 

I was trying to think about what I could make, and came across this post (Judd-Treat-Machine). It was pretty straight forward and I thought it would be something that I could make for my dog. So I started work to build a Treat Machine for my tiny 4 legged buddy "Mac".


I used the code from the link above as a starting point. Python was rather new to me but it was not that bad, it just took some time to get used to the syntax and stuff.... but I figured it out after all. I added a few more features and security into the script. So basically:
  1. It polls Mac's Gmail to look for new email. 
  2. If a valid email is intended to give Mac a treat, it will
    • Play a recorded Audio to get Mac's attention.
    • Dispense some treats for Mac.
    • Take a photo of Mac while he is enjoying his treats.
    • Send the photo back to the sender who gave a treat to Mac.
  3. I also added a few other security features, like:
    1. No treat is allowed during night time. It will resume and give Mac a treat in the morning.
    2. Limited treat are allowed during the day. I didn't want Mac to have any health issues :).
    3. Limited treats are allowed by the same user, I didn't wanna get email spam.
This is an email example of response that you get after Mac gets his treat. You get a thank you email from Mac along with a photo of him eating the treat.


This part is slightly different from the Judd-Machine. I can't really do what he did. After some research, I decided to go with Auger Conveyor approach. It is a mechanism that uses a rotating helical screw blade that allows you to move granular materials. All I needed was a big enough Auger Bit that fit the size of Mac's treat and a high torque low RPM motor. 

This may have been overkill, but I found a really high torque 6RPM gearhead motor (12V DC) for $18.95 from eBay. It is so strong that I can't stop the rotation with my fingers.


Auger bit for $12 from HomeDepot.

At this point, I was glad that I studied 2 years of Electrical Engineering. At the least I know how to look at circuits and play with breadboard and components. I was surprised how much I remembered from my school days, and that I was able to put it to good use again!

I was playing with the GPIO (general purpose input/output) for the past few days and have a pretty good idea how to use them. The motor runs with 12V but the GPIO produces only 5V, so I needed a way to run a motor with a switch. I started to look at the relay switch circuit. I bought all the components from Fry's and hooked it up. It worked just fine. 

Once everything was tested working, It was time to solder it into the board. It could have been done a little more professionally but I was pretty happy with the end result. 

I took a container from a Dollar Store and converted it into my treat dispenser container. 

All of that looked very clunky but it did its job. It was pushing out treats, and I was able to program it to dispense a full meal. Mac was enjoying his treats while I was testing it. It was funny to see Mac as initially he was scared of the motor's sound, but after seeing what he would get, he got so excited. As soon as the motor started, he was right in front of the treat machine hoping that something dropped. The flaw of this machine is that I can't really control the consistent amount of treats to be dispensed. Sometime it has a few dispensed but occasionally it has none. Poor dog.


Finally, I found a cheap container rack and stuck everything in to it. and it looked like this:

So I really had a lot of fun making this, and learnt a few things along the way. Unfortunately, I didn't proceed to make the updated version until 2 years later :). Please check out my TreatMaster V-2. It is way smarter than this.

No comments:

Post a Comment