Arduino automatic feeder. Feeder for aquarium fish based on Arduino. To begin with, I collected everything in the form of a layout on the table and checked for performance, I also made additional settings

This project is based on the ESP8266 WIFI board and is designed to be controlled and monitored via the BLYNK app on your smartphone.

You can also add an IP camera to the project (or use an old smartphone with a camera as a server) for real-time monitoring. time via IP Webcam Pro via a widget in the BLYNK app.

Feed is delivered using a NEMA17 stepper motor in 1.8 degree increments - 200 steps per revolution. The motor rotates the auger in the plumbing adapter into which feed enters from the hopper.

The dosage portion can be adjusted, as well as visually display the filling in the BLYNK application. And there are also a lot of settings, in the application itself, which I will talk about towards the end of the post and demonstrate in a video on my YouTube channelYoutube - DenisGeek

Applications in the play store for smartphones:

Electronic part and components:

The schematic of this device is very simple. It consists of an ESP8266 board - which serves as a brain, as well as a means of communication with your Wi-Fi router, transmitting data through a special. API key on the BLYNK application server. Our "brains" control the stepper motor driver, and it at one time sets the movement for the NEMA17 stepper. The LM2596 buck board serves as a buck module to power the ESP8266 board.
There is also a remote button on the case, which is added through a 10K pull-up resistor to ground - it implements the function to start "feeding" in manual mode.


I ordered components for the project on Aliexpress:

ESP board 8266 NODEmcu LUA http://ali.pub/2k460i \ http://ali.pub/2k4622

Power supply 12 V 2 A http://ali.pub/2k464e

Stepper motor driver L289N http://ali.pub/2k4674

Nema17 stepper motor http://ali.pub/2k46a8

Buck Converter LM2596 http://ali.pub/2k46jk

If you don’t want to solder the ESP board, you can connect everything with breadboard wires http://ali.pub/2k46un

Auxiliary tool:

Soldering iron http://ali.pub/2k2wz8

Solder http://ali.pub/2k471g

Wire cutters http://ali.pub/2k4730


Everything else can be bought locally at a radio or hardware store (beam for frame assembly, junction box, clamps, self-tapping screws, etc.)



To begin with, I assembled everything in the form of a layout on the table and checked for performance, as well as made additional settings.



Then I threw everything into a plastic box bought at a hardware store.

Feeder frame dimensions:


The frame looks like this. Everything is very simple and universal, assembled from timber, plywood and self-tapping screws.



You can download printable files here: https://goo.gl/EwqCC1

The feed mechanism was printed on a 3D printer - an auger, glued from 2 parts with Dismokol glue.



The print was successful.



You can order a print, or try to adapt the auger from a broken meat grinder.


As a basis for the tank, a bottle of kvass "Taras" was used, as well as a connector for plastic pipes.



Here is a general view of the assembled device:



After assembly, it is enough to supply power to our unit, and also after 20 seconds, press the button to check and start the "feeding" and check the dosage.

And then we move on to the BLYNK application. Download it to your smartphone from the play store or from the site https://www.blynk.cc/

After downloading the application, login / register and get 2000 energy points to create your application.

Next, we scan the QR code and automatically pull up the template of my already configured widget:


After that, in the application you will need to specify your authorization token (which you received by mail after creating a new project - we also indicate it in the program code)



Also, if your account was registered a long time ago, then you may have more energy, or you can buy in addition in the application - 1000 for 1 dollar.

I got this widget, but it costs 3200-3600 (depending on the visual modules)


And the last option with 6 timers is very convenient.



I also add a table of bindings of virtual pins to BLYNK widgets



Suppose to add another timer in the blink application, you need to add the Timer item, and set VIRTUAL OUTPUT V6 or V7 in the settings.




The firmware with comments can be downloaded here: https://goo.gl/xuaZm9

As well as how to add an ESP8266 nodemcu board to the ARDUINO IDE and flash it, it is described in detail here



After all the manipulations, we load the sketch, first of all we connect the power to our system, wait 20 seconds and press the button to turn the auger for the test. If there is a reaction, then it is assembled correctly. Next, we launch the BLYNK application. First of all, we look at the status of the project - if everything is correct, then your feeder should appear on the network. After that, you need to set the time zone by clicking on the clock icon, and you can also immediately set the necessary timers. To synchronize the settings - press the "Timer" button in the on mode. If after a reboot (power failure) the timers do not work, you need to go into the application and press the "Timer" button to turn it off and on.



July 28, 2015 at 02:28 pm

Feeder for aquarium fish based on Arduino

  • DIY or DIY

Summer is the holiday season. I was afraid that three weeks at sea would lead to starvation of the inhabitants of the aquarium, and since my mother-in-law went with me, there was no one to entrust the task of feeding the fish.

After thinking a little about the problem, I decided to use the Arduino UNO, which was at hand, to make an automatic feeder. Fortunately, there was already a little experience in automation. And since the Ethernet Shield was purchased for the future, the idea arose of a terrible perversion: feeding control through a computer network. The fact is that at home I have a constantly turned on computer acting as a home server. It is connected to an uninterruptible power supply, and therefore there are high chances that even with short-term switching of the mains, the computer will meet us with the buzz of its fans, and for one it will descend to the control of this very feeder.

The fact is that in the examples from the Arduino IDE development environment for the Ethernet Shield, a web server was found, some alteration of which made it possible to issue the state of all analog contacts in JSON format.

A little experimentation with the query string in this web server made it possible to recognize URLs like:

The last two I adapted to turn on and off the light in the aquarium, and the first - for direct feeding.

Turning the light on and off is done by means of a relay module. I directly built this relay into a pre-purchased outlet. From all this, he subsequently made a small controlled extension cord.

The hardest part was making the feeding station itself. It became obvious that during the holidays the fish goes on a diet from which frozen bloodworms are excluded, and eats only granules.

Rummaged Runet in search of an acceptable design for hand-made production. The most acceptable was considered a rotating drum with food inside. At the same time, the drum has a slot through which the granules are poured out passing the bottom point. The most important thing at the same time is that this same drum does not accidentally stop in the “slot down” position, then the fish can have a “belly holiday”, and after a while the feeling that they live in a sartir instead of an aquarium. In short, there are problems:

  1. what to make a drum
  2. how to rotate it
  3. how to make it stop in time, making only one turn
After rummaging through the toys broken down by my son, I found a decent, as it seemed to me, gearbox with a motor. Around which he began to collect the mechanical part of the feeder. The drum was an ordinary plastic jar of oatmeal jelly, which for some time the wife indulged in. But when I assembled the design and tried it on a standard five-volt power supply, I realized that the reducer had too little reduction, and the behavior of the entire system was somewhat reminiscent of a centrifuge. It was too lazy to remake for another gearbox and I decided to go the other way - by lowering the voltage. But the three-volt power supply too quickly rotated the drum. Specially bought even a 1.5-volt power supply. I was delighted, but my joy was not long, because. when checking the work in the "semi-combat" mode, i.e. when turning the feeder on and off through the relay, it suddenly turned out that after 20-40 cycles - the Chinese power supply was safely dead. I had to urgently buy a Motor Shield and use its wide capabilities to control the speed of rotation of the drum.

At this point, two of the three problems went away, and I began to seriously think about solving the problem of exact stopping. A mechanical switch that would signal the passage of a turn seemed to me not a very good solution. I was confused by the additional mechanical load on the gearbox, which occurs only in one position of the drum. Therefore, I decided to use the system: LED + black mark on the drum + photoresistor. I took a photoresistor, assembled a voltage divider with it, and using one of the Arduino UNO analog inputs, I began to measure the voltage to determine the presence or absence of a label. The label itself was a small fragment of electrical tape, and the backlight was organized by means of an LED powered through a resistor (to limit the current). Then there was a boring accumulation of statistics, with different degrees of illumination of the drum (the light in the room). I determined what values ​​are taken from the analog input, and set the threshold values ​​for the options “there is a label” - “there is no label”. So the last problem was solved.

Then I tried the feeder with pellets and a slot, but in order not to feed the fish in advance, I carried out all the tests over a sheet of paper, where I not only determined the size of the slot (sealing it with fragments of adhesive tape), but also found out that some of the pellets wake up past the distance intended for this between two rails. I had to unpack the plastic packaging for some kind of cable and make something resembling brushes in an electric motor out of them, so that when the slot was raised, the feed would “shut up” with these transparent plates rubbing against the drum.

As you already understood, the purpose of this device is not at all a well-fed fish life, but some test of oneself. And I decided to go further. In terms of software development. In the hardware, I only had the performer of three commands, but on the home server, I decided to keep some statistics. Since I am a web programmer, out of habit, I took the MySQL database and created two tables in it. I added URLs and dates of requests to the device to one, wrote answers to the other, as a result I got statistics on whether the fish were successfully fed and what time the light in the aquarium turned on and off. (The fact is that the device gives a response only after execution commands. And does not issue if something went wrong.) Remembering some of my skills in Java, I took the URL class and with it made all these three http requests to the arduino.JSON response was parsed by the library downloaded from json.org. approached rapidly, because there was not enough time for the remaining perversions, and I decided to run the control java software itself using the good old cron "a.

It was in this form that the departure to the sea found both us and the fish. Three weeks later, we returned tanned and saw all our fish swimming around the aquarium merrily, and pretty well fed.

Microcontroller programming

In this series of articles, I will talk about my experience in assembling a "smart" automatic system for feeding a pet, in my case, a cat.


I want to immediately note that at the first step we will only talk about the "automatic" feeder, and it will become "smart" at the next stages (if you're lucky, and everything goes according to plan).


So, let's start with the concept and goals:

  1. Make a system that frees me from the obligation to feed my cat dry food (step 1)
  2. Equip the system with a weight sensor under the bowl and feed according to the scale readings: if the bowl is empty, add it, otherwise wait until the bowl is empty (step 2)
  3. Add a Wi-Fi module and a video camera to the system to transfer photos with your favorite cat, as well as provide remote control of feeding. In addition, collect data on how much the cat ate and build analytics (step 3)

The first step does not require a large number of sensors and manipulators, one servo motor is enough (for example, Micro Servo Towerpro SG90 9 g), so all control comes from the ArdruinoUno board, which is ideal for this kind of tasks.


Feeding systems in one way or another contain some container in which dry food lies, and a rotating mechanism that dispenses its amount. Having studied the experience of other "inventors", I would single out three main mechanisms:




All the materials that I needed to assemble the feeder at the first stage:

  • Glass jar
  • Arduino Uno
  • MicroServo (I have an allowed rotation angle of 180, but it doesn't matter)
  • piece of plastic
  • magnets
  • pins for connecting the board to the servomotor
  • USB charging at 5V

The logic of the mechanism is simple: a sector-type hole is made in the lid of the can (the center of the lid is not cut out), the same sector is cut out of plastic. A servo motor is attached inside the cover, for example, with adhesive tape. First, a cover is mounted on the engine axis, and a cut-out sector on the outside. So, when the axis of the servomotor is rotated, the cut sector is displaced relative to the hole in the lid of the can.


Also, do not forget to make a hole for the output of the servomotor wire to the outside to connect to the board. At step 1, feeding occurs on a timer, my cat is not a glutton, so the sector opens once a day for a short time, below is the code for Arduino:


#include #define servoPin 9 Servo myservo; void setup() //setup procedure ( myservo.attach(servoPin); //attach the drive to port 9 ) void loop() ( myservo.write(0); //put the shaft at 0 degrees delay(300); // wait 0.3 seconds myservo.write(160); //set shaft at 160 degrees delay(86400000); //wait 24 hours )

To fasten the jar to the wall, I used these magnets, each 4kg (I think it's better to use more powerful ones). Magnets are attached to the jar simply with glue, and to the wall with screws.


The board is attached to the bank with Velcro, it is convenient to remove and attach it back. Velcro is sold in any household, used for fastening pictures.


Since my only external module is a servo motor, no additional power is needed, it is enough to power the board, it can be connected directly to the network via a 5V usb charger.


Here's what it looks like when assembled:


Below I have outlined a few ideas for the further development of the feeder, there are many of them and it is not yet clear what exactly will be done next, this part is for discussion.

  • installation of motion sensors, photographing the cat at the moment when it appears in the field of view. The integration of a weight sensor and a motion sensor allows you to determine when the cat is just walking past the feeder, and when he came to eat. Accordingly, you can tighten the analytics when the cat prefers to eat and how much.
  • you can add a weight sensor to the feed container itself so that the feeder determines the moment when it becomes empty and sends a warning to the owner that, they say, it is empty, it needs to be replenished. Then, as an option, add the possibility of auto-ordering food from your favorite site with delivery.
  • You can add the ability of the feeder to work for two cats:
    • Or it will be two different feeders, each of which can scare away a “strange” cat
    • Or is this one, but somehow modified
  • We need to think about how to implement a drinker and integrate it with a feeder, add a filtration system.

I hope this will be useful to someone.

July 28, 2015 at 02:28 pm

Feeder for aquarium fish based on Arduino

  • DIY or DIY

Summer is the holiday season. I was afraid that three weeks at sea would lead to starvation of the inhabitants of the aquarium, and since my mother-in-law went with me, there was no one to entrust the task of feeding the fish.

After thinking a little about the problem, I decided to use the Arduino UNO, which was at hand, to make an automatic feeder. Fortunately, there was already a little experience in automation. And since the Ethernet Shield was purchased for the future, the idea arose of a terrible perversion: feeding control through a computer network. The fact is that at home I have a constantly turned on computer acting as a home server. It is connected to an uninterruptible power supply, and therefore there are high chances that even with short-term switching of the mains, the computer will meet us with the buzz of its fans, and for one it will descend to the control of this very feeder.

The fact is that in the examples from the Arduino IDE development environment for the Ethernet Shield, a web server was found, some alteration of which made it possible to issue the state of all analog contacts in JSON format.

A little experimentation with the query string in this web server made it possible to recognize URLs like:

The last two I adapted to turn on and off the light in the aquarium, and the first - for direct feeding.

Turning the light on and off is done by means of a relay module. I directly built this relay into a pre-purchased outlet. From all this, he subsequently made a small controlled extension cord.

The hardest part was making the feeding station itself. It became obvious that during the holidays the fish goes on a diet from which frozen bloodworms are excluded, and eats only granules.

Rummaged Runet in search of an acceptable design for hand-made production. The most acceptable was considered a rotating drum with food inside. At the same time, the drum has a slot through which the granules are poured out passing the bottom point. The most important thing at the same time is that this same drum does not accidentally stop in the “slot down” position, then the fish can have a “belly holiday”, and after a while the feeling that they live in a sartir instead of an aquarium. In short, there are problems:

  1. what to make a drum
  2. how to rotate it
  3. how to make it stop in time, making only one turn
After rummaging through the toys broken down by my son, I found a decent, as it seemed to me, gearbox with a motor. Around which he began to collect the mechanical part of the feeder. The drum was an ordinary plastic jar of oatmeal jelly, which for some time the wife indulged in. But when I assembled the design and tried it on a standard five-volt power supply, I realized that the reducer had too little reduction, and the behavior of the entire system was somewhat reminiscent of a centrifuge. It was too lazy to remake for another gearbox and I decided to go the other way - by lowering the voltage. But the three-volt power supply too quickly rotated the drum. Specially bought even a 1.5-volt power supply. I was delighted, but my joy was not long, because. when checking the work in the "semi-combat" mode, i.e. when turning the feeder on and off through the relay, it suddenly turned out that after 20-40 cycles - the Chinese power supply was safely dead. I had to urgently buy a Motor Shield and use its wide capabilities to control the speed of rotation of the drum.

At this point, two of the three problems went away, and I began to seriously think about solving the problem of exact stopping. A mechanical switch that would signal the passage of a turn seemed to me not a very good solution. I was confused by the additional mechanical load on the gearbox, which occurs only in one position of the drum. Therefore, I decided to use the system: LED + black mark on the drum + photoresistor. I took a photoresistor, assembled a voltage divider with it, and using one of the Arduino UNO analog inputs, I began to measure the voltage to determine the presence or absence of a label. The label itself was a small fragment of electrical tape, and the backlight was organized by means of an LED powered through a resistor (to limit the current). Then there was a boring accumulation of statistics, with different degrees of illumination of the drum (the light in the room). I determined what values ​​are taken from the analog input, and set the threshold values ​​for the options “there is a label” - “there is no label”. So the last problem was solved.

Then I tried the feeder with pellets and a slot, but in order not to feed the fish in advance, I carried out all the tests over a sheet of paper, where I not only determined the size of the slot (sealing it with fragments of adhesive tape), but also found out that some of the pellets wake up past the distance intended for this between two rails. I had to unpack the plastic packaging for some kind of cable and make something resembling brushes in an electric motor out of them, so that when the slot was raised, the feed would “shut up” with these transparent plates rubbing against the drum.

As you already understood, the purpose of this device is not at all a well-fed fish life, but some test of oneself. And I decided to go further. In terms of software development. In the hardware, I only had the performer of three commands, but on the home server, I decided to keep some statistics. Since I am a web programmer, out of habit, I took the MySQL database and created two tables in it. I added URLs and dates of requests to the device to one, wrote answers to the other, as a result I got statistics on whether the fish were successfully fed and what time the light in the aquarium turned on and off. (The fact is that the device gives a response only after execution commands. And does not issue if something went wrong.) Remembering some of my skills in Java, I took the URL class and with it made all these three http requests to the arduino.JSON response was parsed by the library downloaded from json.org. approached rapidly, because there was not enough time for the remaining perversions, and I decided to run the control java software itself using the good old cron "a.

It was in this form that the departure to the sea found both us and the fish. Three weeks later, we returned tanned and saw all our fish swimming around the aquarium merrily, and pretty well fed.

August 8, 2017 at 09:43

Arduino-Based Smart Automatic Pet Feeder - STEP 1

  • Microcontroller programming
  • tutorial

In this series of articles, I will talk about my experience in assembling a "smart" automatic system for feeding a pet, in my case, a cat.


I want to immediately note that at the first step we will only talk about the "automatic" feeder, and it will become "smart" at the next stages (if you're lucky, and everything goes according to plan).


So, let's start with the concept and goals:

  1. Make a system that frees me from the obligation to feed my cat dry food (step 1)
  2. Equip the system with a weight sensor under the bowl and feed according to the scale readings: if the bowl is empty, add it, otherwise wait until the bowl is empty (step 2)
  3. Add a Wi-Fi module and a video camera to the system to transfer photos with your favorite cat, as well as provide remote control of feeding. In addition, collect data on how much the cat ate and build analytics (step 3)

The first step does not require a large number of sensors and manipulators, one servo motor is enough (for example, Micro Servo Towerpro SG90 9 g), so all control comes from the ArdruinoUno board, which is ideal for this kind of tasks.


Feeding systems in one way or another contain some container in which dry food lies, and a rotating mechanism that dispenses its amount. Having studied the experience of other "inventors", I would single out three main mechanisms:

All the materials that I needed to assemble the feeder at the first stage:

  • Glass jar
  • Arduino Uno
  • MicroServo (I have an allowed rotation angle of 180, but it doesn't matter)
  • piece of plastic
  • magnets
  • pins for connecting the board to the servomotor
  • USB charging at 5V

The logic of the mechanism is simple: a sector-type hole is made in the lid of the can (the center of the lid is not cut out), the same sector is cut out of plastic. A servo motor is attached inside the cover, for example, with adhesive tape. First, a cover is mounted on the engine axis, and a cut-out sector on the outside. So, when the axis of the servomotor is rotated, the cut sector is displaced relative to the hole in the lid of the can.


Also, do not forget to make a hole for the output of the servomotor wire to the outside to connect to the board. At step 1, feeding occurs on a timer, my cat is not a glutton, so the sector opens once a day for a short time, below is the code for Arduino:


#include #define servoPin 9 Servo myservo; void setup() //setup procedure ( myservo.attach(servoPin); //attach the drive to port 9 ) void loop() ( myservo.write(0); //put the shaft at 0 degrees delay(300); // wait 0.3 seconds myservo.write(160); //set shaft at 160 degrees delay(86400000); //wait 24 hours )

To fasten the jar to the wall, I used these magnets, each 4kg (I think it's better to use more powerful ones). Magnets are attached to the jar simply with glue, and to the wall with screws.


The board is attached to the bank with Velcro, it is convenient to remove and attach it back. Velcro is sold in any household, used for fastening pictures.


Since my only external module is a servo motor, no additional power is needed, it is enough to power the board, it can be connected directly to the network via a 5V usb charger.


Here's what it looks like when assembled:


Below I have outlined a few ideas for the further development of the feeder, there are many of them and it is not yet clear what exactly will be done next, this part is for discussion.

  • installation of motion sensors, photographing the cat at the moment when it appears in the field of view. The integration of a weight sensor and a motion sensor allows you to determine when the cat is just walking past the feeder, and when he came to eat. Accordingly, you can tighten the analytics when the cat prefers to eat and how much.
  • you can add a weight sensor to the feed container itself so that the feeder determines the moment when it becomes empty and sends a warning to the owner that, they say, it is empty, it needs to be replenished. Then, as an option, add the possibility of auto-ordering food from your favorite site with delivery.
  • You can add the ability of the feeder to work for two cats:
    • Or it will be two different feeders, each of which can scare away a “strange” cat
    • Or is this one, but somehow modified
  • We need to think about how to implement a drinker and integrate it with a feeder, add a filtration system.

I hope this will be useful to someone.