3D Printed automatic fish feeder + servo + Raspberry Pi
This Automatic Fish Feeder is perfect for long weekend vacations. It's currently set up for Wednesday thru Sunday, but feel free to fork this and adjust as you'd like.
Instructions are written in an easy-to-follow format so that even if you don't have a background in programming, raspberry pis, python or servos... you should hopefully be able to follow along to make this for your aquarium. If you have any questions, feel free to reach out via twitter @handsomezebra or email contact@handsomezebra.com
🤖🐟
- Servo Motor
- Raspberry Pi 3 B+
- 1k Ω resistor
- Breadboard
- 3D Printed Automated Fish Feeder from https://www.thingiverse.com/thing:497637/files
- Get your raspberry pi running with your preferred OS. I use https://www.raspbian.org/
- SSH or open the terminal to your pi.
sudo apt-get updates
(updates the list of available packages and their versions)sudo apt-get upgrade
(installs the newer versions of the packages you have)git clone https://github.com/thehandsomezebra/ServoFishFeeder
cd ServoFishFeeder
pip install schedule
nano feeder.py
- Ensure that
test=False
- Hit
ctrl + x
- Hit
y
- Don't change the file name. Hit Enter.
- Proceed to Wiring.
Common Servo Pin-out Wire Colors
Signal | + | - |
---|---|---|
Yellow | Red | Black |
White | Red | Black |
Yellow | Red | Brown |
- Now that you have it wired up, let's run it once to get it to the startposition.
- We only want the servo wired up -- don't connect it to the 3D print just yet.
cd ServoFishFeeder
python feeder.py
- Testing will run Wednesday, Thursday, Friday, Saturday and Sunday positions...then walk itself back to start.
- When
FEEDER READY TO BE FILLED
is displayed - you can connect this to your 3D print. - You may run the feeder test again.
python feeder.py
- If everything looks good, lets turn the test procedures off and set up the times.
nano feeder.py
- Adjust the location of the
#
to turn testing off.test=False
- Set the
whattime
variable in 24 hour format. You can see an example of 10pm and 9am in the code.whattime = "09:00"
- Hit
ctrl + x
- Hit
y
- Don't change the file name. Hit Enter.
- This is now ready to run!
python feeder.py
There's a few different ways to do this, but I prefer using PM2.
sudo apt-get updates
sudo apt-get upgrade
sudo apt-get install nodejs npm
npm install pm2 -g
cd ServoFishFeeder
pm2 start feeder.py
pm2 save
- 3D Printed Automated Fish Feeder: https://www.thingiverse.com/thing:497637/files
- Install NPM: https://www.npmjs.com/package/raspberry
- Install PM2: https://www.npmjs.com/package/pm2
- Python Job Scheduling: https://pypi.org/project/schedule/