Intro
When I saw the Alexa and Arduino Smart Home challenge, I thought it was a great opportunity to build something to make people's life better. So I talked to my friends Diego and Elias an we went through a brainstorm to choose the project in which we would spend the next week.
There were lots of ideas of smart plant monitors, lamps and health related things, but we chose to stick with one the would make both people and pet lives a little better, and then Pet Center was born.
Hardware
The electronic parts (see main circuit schematic below) used aren't expensive and can be easily found.
ESP-01 is a bit tricky to program, and you will probably need an USB to Serial converter like FT232RL, and some 10K resistors. The text in orange indicates the corresponding FT232RL pins. These resistors are recommended for trouble-free programing, even though in the main schematic I've included just the ones required to make the chip run after code has been uploaded (GPIO0 and CH_PD).
Pet entertainment part is done using a camera pan/tilt module, two SG90 servos and a red laser diode. We warn you though, it's much more effective with cats than dogs!
As for the smart pet feeding system, we assembled it with PVC pipes. A handwound steel wire spring and an old microwave oven 120VAC motor do the heavy lifting: as the spring rotates with the motor shaft, food goes down the pipe and reaches the bowl.
Software
This part was the most difficult, but we ended up developing the endpoint in Python with Flask-Ask. The endpoint had to be always ready to provide a response, and there are many ways to achieve this, but our choice was Google Cloud due to their always free virtual machine instance. We also used localtunnel.me to get a public https url. Code is available below too.
After we got a working endpoint, creating an Alexa skill with the new Skills Kit Console was a nice experience, and no coding was required.
A simple VUI was designed :
Alexa, upon user command, makes a request to our endpoint, which provides the correct reply to the user (through Alexa) and publishes a MQTT message to the public broker iot.eclipse.org under petcenter topic.
ESP-01 is subscribed to this topic under the same broker and relays the message to Arduino Nano, which activates either the entertainment servos or the food serving mechanism, depending on the user request.
See it in action!
Comments