DIY Fish (chicken?) Feeder

by boanjo in Circuits > Microcontrollers

2013 Views, 18 Favorites, 0 Comments

DIY Fish (chicken?) Feeder

pond_1.jpg
poseidon_fishfeeder_result.JPG
poseidon_fishfeeder_closeup.PNG
poseidon_fishfeeder_parts.png

This fish feeder is one of the parts in my garden pond control called Poseidon. Even if it is designed for 3mm KOI pellets it will work for other types of similar pellets or grain for fishes and birds. Almost 20 years ago when me and my wife moved to our house we thought that the included garden pond with a few KOI fishes wouldn't last very long. We were wrong... It's very relaxing and the automation possibilities are huge (probably main reason for me :-))! I immediately started to build my first fishfeeder and since then there has been quite a few iterations. Finally I've settled with the solution that works best and it's been up and running for 3 seasons without issues and this is what i want to share. The fishes loves the feeder too :)

Even if you can order the plastic parts printed, it for sure helps if you have a 3d printer capable of printing PETG or ABS.

For a full write-up on the other parts of my pond control see my github: https://github.com/boanjo/poseidon

Here is a YouTube channel for the full Poseidon project and one video for the fishfeeder (sligthly different web gui, connected over MQTT etc)

Supplies

poseidon_fishfeeder_parts.png

It should be possible to make this for around $50 (including PETG plastic)

3D Print the Model Parts

poseidon_model_fishfeeder.png
poseidon_fishfeeder_parts.JPG

This also includes the step file so you can download/clone the repo and customize the way you want. Or you just print the stl files that are zipped in the stl folder: Download ZIP The models are made with Fusion 360.

It's made up of the "housing" which is the main plastic part which you later add the Sewer pipe to, the screw, motor mounting plate and the screw lid.

Then there are 3 optional stl files. One top lid (lid for the top of the sewer pipe with a nice fit) + 2 mounting pieces that match mounting towards a fence which of course is highly individual.

Print the stl files in PETG or ABS (PLA might work, but can warp during warm sunny days). I use quite a large brim at least for the larger objects to avoid warping on the print bed but that depends heavily on your printer (i have Prusa i3 MKS3 and a Creality CR10 v2).

Postprocessing

poseidon_fishfeeder_tube.JPG

Do some light postprocessing of the printed parts and add some nice spray paint to it to match your surroundings. As you can see from the picture above i didn't use any primer on the sewer pipes (or rugged the surface enough) the first season and then it will drop a few flakes of paint for sure. I recommend using a PVC primer

Assemble the Motor Block

poseidon_fishfeeder_motor.JPG
poseidon_fishfeeder_schematic.JPG

You have a choice if you want to mount the micro controller next to the DC servo or if you prefer to have it in a box on the side. If you keep it inside the feeder then you only need to feed +5V/GND with a 2 wire cable. Otherwise you need to extend the 3 wire DC motor cable to the external box, just add a 3 pol screw connector instead. The DC servo needs 4 x M3 screws + nuts. The microcontroller needs one small M2.5 + nut to be mounted. You need to solder just 3 wires. The Wemos D3 pin to the orange(or white) PWM control wire of the DC servo. Then +5V and GND to their screw connectors respectively (from the power supply). You can now program the firmware to the microcontroller for testing.

Programming Firmware

web gui.JPG

Before we start to program, let's go through our options. I've chosen to use the Wemos D1 mini (lite) as the microcontroller as it fits nicely in a small area and it has excellent Wi-Fi range. You can of course use an arduino or whatever you are most comfortable with especially if you use an external box. In the Poseidon Pond Control (i.e. the setup I'm using) then the microcontroller is just a slave that connects to WIFI, listens to the MQTT messages and acts if getting order to feed + amount. So the controller and "alarm" logic is in another piece of software, which in many cases you want to be your Home automation (like Homeassistant, Domoticz etc). I like that division of concern and that project can work also for you even without all water level and quality sensors. So if you have a raspberry PI or already a Web server up and running, that would be my choice

  1. Poseidon project which also includes water level and quality control and monitoring (standalone without connection or potential downtime of other automation)
  2. Connect to a home automation via for example MySensors that is compliant with all major controllers. You don't need to add another radio like RFM69 or so. Use the Wemos as a gateway with attached devices and add it as a switch or a dimmer for the feeding. There are tons of information on the MySensors site. If anyone struggles with making such a sensor i can probably help with that.


However in this article i want to show how easy it is to add something more standalone but still with some cool functionality that you can build upon. I will use the Arduino IDE (you install wemos boards, google "wemos d1 mini install arduino") as that is still the most used DIY environment but I recommend you try platformio (installation https://platformio.org/platformio-ide) as that is a much more capable IDE and build environment. In this small piece of code published on my github you will get the web gui as in the picture above. The wemos doesn't have a filesystem and hence it's hard to serve html files as a normal webserver does. But you can still make interactive webpages (see the code) that can look nice. I've used jquery mobile to make it work good on all devices.


  1. Plugin your Wemos microcontroller with a Micro USB (or USB-C or later versions)
  2. Clone this repo and open the fishfeeder.ino in ardunio IDE
  3. Select the Wemos D1 mini lite (google "wemos d1 mini install arduino" if you haven't the board) board in the gui and the correct serial port (if you don't have any other devices connected it will have a name like COM3 or so on windows)
  4. Change the SSID and password in the top of the ino file to match your Wi-Fi (there are lots of examples how you can make the wemos first as access point and enter the SSID and password interactively before chaning it to be a wifi client. But it's going to be a bit more complicated code and i think it's a good idea to start to make some changes yourself). There is a #error just above the SSID that you should remove when it is updated (or you will get compilation error so you can't miss it)
  5. Build & Upload
  6. Select the "serial monitor" option
  7. When the Wemos is starting up it will connect to WIFI and then print what ever IP address DHCP in your router assigned for it "Use this URL : http://192.168.1.99". NOTE that the IP address will most likely be different for you but we use it as an example! Now you can open a browser on your phone or laptop (connected over the same local network (not 4G :-) ) and enter that address http://192.168.1.99 and you should see the page in the picture. You will see some stuff printed to the serial port but this is just for debug. When the feeder is operational i don't have anything connected to the wemos usb port.
  8. Instead of interactively using a web page you can feed a certain amount by: 192.168.1.99/FEED=19. So in this way you can add it to your Home automation too as an action at a certain timeout/trigger.
  9. When programming is ready you can remove the USB micro from the Wemos D1 mini. It will now work on it's own if you just add +5V and GND to it.

Assembly

poseidon_fishfeeder_assembly_2.png
poseidon_fishfeeder_assembly.png

Hook up the +5V transformer (a regular USB charger will be good enough). Insert the other end (no contacts just stripped 2 wire USB cable) of the cable into the hole at the side of the feeder, and screw it to (check polarity!) the terminal.

Now you can mount the feeder screw, and then using 2 small wood/metal screws just mount the motor block. Now is a good time to test the feeding from the web gui. If the motor is just making noise or not turning as it should it's probably another type of DC servo and you need to change the timing for the pulse width and blanking period. I've tried 3 different DC servo brands and types and they have all worked.

The lid for the motor should be really easy to screw or there is some waste from the printing process. Attach the straight tube to the angled on and then slide it until it stops on the feeder.


Next Step

poseidon_fishfeeder_closeup.PNG

Again this is just a quick example of what you can do. If you want to hardcode in feeding time and amount you could ditch the webserver and connect over Wi-Fi to an NTP server to get a real clock time and handle the alarms. Or... well what do You want to make?