Use circuito.io to build a smart food dispenser for your pet controlled directly from your phone.
Software apps and online services:
How does it work?
There are many ways to feed your pet: you can set it to fill up the bowl at a certain time, you can command it to fill up whenever it gets empty, or maybe to give your dog food after they follow a set of orders that you taught them.
In this specific project, we set the feeder to start beeping from time to time. Once the dog comes closer to the device, the PIR sensor recognizes it and the servo is triggered. In addition, we also decided to add the option to control the pet feeder from our mobile phone, using a pre-defined dashboard made with Freeboard. We saw this as a great opportunity to introduce you to the option of connecting your circuito project to the internet with ESP8266-01 - the wifi module currently available on circuito.io.
Step 1: Setting Up the Circuit
When clicking on this magic link, you'll be redirected to circuito.io, where you'll find that we've already selected for you the components we used in this project. The components you need are: PIR sensor, Arduino uno (or other), servo, speaker, esp8266-01, and a power source. This is the basic circuit for this project but you can also add many different sensors and other components to the circuit for example, you can add a weight sensor to monitor the amount of food in the bowl or add LEDs that will change according to different parameters.
Once you've selected the components you waLunant, click on Generate and our engines will start working on your circuit and will generate your circuito reply. The reply has three parts:
1. BoM - A list of all the components you'll need for the project, including auxiliary parts such as resistors and capacitors.
2. Step-by-step wiring guide - shows you how to connect all your components to the Arduino board using a breadboard.
3. Code - a sample code for your circuit. This code is not specific for the pet feeder project, but rather it is a sample code that creates an interaction between the different components in your circuit.
To Upload the code, follow these steps:
Download the code from the circuito.io reply Extract it to your computer Open with Arduino IDE Upload to your Arduino.
Once everything is set up, replace the sample code from the circuito reply with the code in this tutorial. Make sure to leave the //Include Libraries and //Pin Definitions at the top of the code, and also keep all the libraries that are on the original code from circuito.io.
4. Connectivity - this section will guide you how to configure the connection of your project to the internet.
Step 2: Connect and Troubleshooting
In the circuito.io reply go to Connect and click on “Create Your Dashboard”.
You'll be redirected to freeboard.io where a basic dashboard will be generated for you, and connected to your Arduino sketch using a unique ‘thingName’.
You can find your thingname in the firmware.ino.
You may also see this screen at first:
If you do, click on the settings icon at the top of the page.
- click IMPORT
- Browse to your Firmware folder downloaded from circuito.io
- Choose the dashboard.json file
This should update your dashboard to look like this:
- If it doesn’t work - try refreshing the page.
- Check that the dashboard is set up correctly with your firmware. Click on ‘Dweet’ under DATASOURCES. You should see this:
Make sure that the thingname is the same as the one in your firmware.ino.
- In the OUTPUT section click on settings
A window will open:
- click on JS EDITOR and look for this line:
- change the value to the given ‘thingname’ in your firmwae.ino.
- CLOSE and SAVE.
Step 3: Assembly
Now that you have the electronics set up, it's time to put the parts together.
We designed a 3d printed casing for the servo, the PIR sensor and the speaker. The .stl files are attached here. This part isn't mandatory and you can choose to connect it in a different way, it's really up to you, but look how nice and colorful it is :)
Congratulations! You're done!
You're pretty much set to go. You may need to make small adjustments in the code and calibrate the different sensors.
Read original post: https://www.hackster.io/circuito-io-team/iot-pet-feeder-10a4f3?ref=part&ref_id=8233&offset=6