The main reason for this was to make something so I could feed the cat if I was going to be gone over night but that quickly turned into a full blown application. For the past few years I have wanted to learn more about Azure, Angular, smart devices, etc. so this turned into the perfect project to play around with all of those things.
There were a lot of new things that I ended up using just to try them out so somethings may not be the "correct" way but they worked for me. The application uses Express Js, Python, Azure's IoT Hub, Alexa skills, and Amazon's Dash Replenishment Service (DRS). All of these were relatively new to me so it ended up being a very fun experience for the most part.
In the end the feeder was able to do the following things
- Automatically run the feeder at scheduled times
- Upload information to a web page to view via a web interface or by asking an Alexa skill
- Trigger a feeding via a web interface or an Alexa skill
- Re-order food when the hopper gets low via Amazon Dash
- Allow for others to use the application by signing up and putting the application on their device.
Full disclosure I got a lot of my ideas from Darian Johnson's post but I wanted to extend what he did a bit more (I recommend checking out his other projects as he has a few interesting things). The thought behind it was for people who want to get into DIY projects like this but don't have a strong software background. Hopefully in the end it is as simple as signing up, following a few Raspberry Pi setup tutorials, copying a few files over and boom, instant smart device [individual results may vary :) ]
How-to: Software1) Sign up to get access token here
2) Download the source code from the github repository and set the configuration to how you have it setup. For me I had my various inputs set to the pins shown here. If you don't want to use something like the button then leave that line out and the code will ignore it.
OPTIONS = {
"SERVO": 18,
"BUTTON": 19,
"DISTANCE_IN": 23,
"DISTANCE_OUT": 24
}
FEEDER = PetFeeder(TOKEN, OPTIONS)
3) Copy and paste the Token, Device Key, and Device ID in the designated spots in main.py (if you want to be able to control it via the web or Alexa)
4) Run the code and you're done! Note that I am using Azure IoT which doesn't have a PIP install so the file "iothub_client.so" is a pre-compiled version for Python2.7 that can be downloaded. If you wan't to use a different version feel free to compile it yourself or wait until the Azure team releases it on PIP.
How-to: HardwareThis is really up to you but here is what I ended up with for my beta version. This was my first project and I don't really have a lot of tools at this point so there are a few parts that are a bit rough looking but in the end it serves it's purpose.
As you can see I have all the different components however I will likely never use the button but hey, it's there. The camera was a cheap $3 one from Ebay and it is surprisingly good for the price. Next time I will either make the case longer or taller to make better use of the PVC coming out of the front as it is a bit tight this time around.
Wrapping UpThere are a lot of little things I still want to do with this project and if you have ideas please let me know! I have a few things like multiple pet feeders for one account so you can feed a cat and a dog from one account. If you have questions or something doesn't work please let me know and I will fix what I can.
Comments
Please log in or sign up to comment.