Feed the birds via Internet using NodeMCU

We were looking for an idea of a weekend project and just asked ourselves why not connect directly to Mother Nature. Feeding the birds is nice and can attract them to your backyard. You enjoy hearing them singing for you and have less insects on your fruit trees in the summer. Although building a fully automated birds feeder requires a very simple mechanics without any moving parts involved, enabling yourself to control the process via Internet transformed our idea to an interesting geeky gadget. The idea was very simple – a reservoir with grain or other free-flowing food and a servo motor opening and closing an aperture in a food tank to allow a portion of food to fall into the feeder. A NodeMCU was chosen to control the servo motor and receive commands using MQTT protocol.

Architecture

The below diagram illustrates the architecture of the feeder. The NodeMCU controlling the feeder is not directly exposed to Internet and is hosted in a home network behind a firewall. Both NodeMCU and end user can subscribe to certain topics and publish messages on MQTT Server which is exposed to Internet and can handle substantial load.

Hardware design

This project is not focusing on great hardware design so if you ever decide to build your own feeder use your creativity and available tools and materials.

Hot glue a round piece of plastic matching in size the nozzle of a plastic bottle to make a food dispenser

Cut off the tip from a plastic bottle

Using plastic ties mount a small servo motor which will move the shutter when a servo motor changes the angle

Mount the tip from a small bottle to a bigger one to make sure you have enough stock of food to be able to operate unattended for a few days

Cut big enough holes in a plastic bucket to allow birds comfortably sit in your feeder. Make sure your bucket has a lid which will cover the food tank and electronics from rain. A construction putty bucket is just perfect for this

Use some creativity, duct tape and couple of screws to mount your food tank and electronics under the roof of your feeder. Make sure you make your NodeMCU easy accessible or add a usb cable to your design in order to be able to reprogram your NodeMCU later. Assemble all together and your hardware part is done (watch the video, it shows more details)

Electronics

All you need is

NodeMCU

Small servo motor

A 5v power supply with enough current to drive both NodeMCU and the servo

Connect servo motor as shown on the diagram below

The code below is a full program running on NodeMCU. It subscribes to an MQTT topic on cloud.iotalot.com and upon receiving a message it opens the shatter for small amount of time to supply a small portion of food