Every dog owner has faced it at least once, a well known and common problem. My family and I have experienced it ourself, go on vacation and you're obliged to ask around to your friends and family if they want to keep your dog fed every day. It's not only annoying to ask around and actually find someone who is up for the job, but it's very time consuming for the person that is prepared to feed your pet every day. This tutorial will bring the kind of comfort in your life that you have been asking for if you have ever found yourself in the situation that I just pictured. The machine will automatically but also manually dispense food, you'll get a secure website which is customable and will provide you with live info like the weight of the feeding container, last feeding time, etc.
BOM document, for price
Step 1: Material
- raspberry pi 3 model B
- 12V DC motor 15RPM
- 20Kg load cell (5kg ones are also fine)
- HX711 load cell amplifier
- female-female connectors
- male-male connectors
- 8Gb SD-card
- 12 Volt 2A adapter
- 1k Resistor
- 3mm to 8mm link
- D-Shaft 8mm
- Cereal dispnser
- 1.5m x 1.5m Wood plates atleast 1 cm thick
- Bolts 6-8
- Screws 6-8
- 2 Zipwires
- Soldering iron
Look at fifth picture
Step 2: Setup Raspberry Pi
- You've got to write jessie on the SD-Card using win32diskimager.
- Add an empty file without extension called ssh into the boot folder.
- Setup a static ip (apipa): write ip=169.254.10.1 to the "cmd.txt" file (image above).
- Insert the SD-Card into the pi and connect using Putty.
Update and upgrade the pi:
Copy and paste: sudo apt-get update, sudo apt-get upgrade, sudo apt get dist-upgrade
Step 3: MySQL
Step 4: Scale
Make a Scale by Screwing 2 small sized wooden planks, one on each side.
Caution: You want to keep some moving space for the identical planks between the load cell and the planks, that way the load cell will move when added weight.
Be sure the load cell is right in the middle for a good balance.
- Measure how big the planks have to be, make them both identical
- Make holes in the middle compared to where they should be attached in the load cell
- Screw the bolts in the planks and inside the load cell with nuts between them
- Level the planks
How to connect:
Load cell -> HX711
- RED WIRE -> E+
- BLACK WIRE -> E-
- WHITE WIRE -> A-
- GREEN WIRE -> A+
Hx711 -> Pi
- VCC -> 5V
- GND -> GND
- SCLK -> 24 GPIO
- DLT - > 23 GPIO
There are several libraries available online, this one I used worked perfectly, you'll have to read a bit about it and figure out how the sensor exactly works.
Calibrate The weight:
Run the code with the get_weight function and get the average of around 10 values.
Subtract the average units with the data output to get calibrate the scale.
Measure weight units by putting a certain weight on the scale and dividing the output by the weight in grams.
Load cell has build in holes through the width of its body, shaped in a certain way that the pressure attached on top of it will bend it and create a resistance.
Step 5: DC Motor
Link the DC motor the way showed in the second image.
Step 6: Dispenser
Drill a hole with a diameter of around 10mm, just a little bigger than the 8mm D-Shaft.
Inside of the dispenser is a small carousel which is a bit too big if you want to make the DC motor run.
Screw the D-Shaft inside the 3mm to 8mm link and do the same for the other side with the DC-Motor.
Put up the stilts on the planks of the scale, screw the dispenser to the plank under it.
Get the right height so the motor is on level.
Zipwire the Motor onto the stilts-platform.
Step 7: Building
Measure the length of the sides, mine are around 60cm long, it depends on how big the base of your scale is and add half of the length of the base to get the right length.
Make a fundament with the same length of side walls and width of the scale base.
Make a slide by measuring the width of your base planks, and glue to the side of your side walls.
Screw bolds from the outside of the side walls to the inside of the scale base.
Make a hole inside the roof so the Dispenser container fits through.
Step 8: Website
Upload your webpage to your pi directory: /home/name/projectname
Make a service and let it start automatically: tutorial
Everything should be up and running!