📜 ⬆️ ⬇️

Feeder for aquarium fish based on Arduino

I wanted to share my development of aquarium fish feeders.

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

After thinking a little over the problem, I decided with the help of the Arduino UNO, which was at hand, to make an automatic feeder. The benefit of a little automation experience has already been. And since Ethernet Shield was purchased for future use, a thought of a terrible distortion arose: feeding management 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 a bespereboynik and therefore there are high chances that even with short-term switching of the mains supply, the computer will meet us with a buzzing of its fans, and in one case it will descend to control 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 allowed to display the status of all analog contacts in JSON format.

Small experiments with the query string in this web server allowed us 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.

On-off light is done through a relay module. This very relyuhi I directly built into a pre-purchased outlet. From all this, subsequently made a small controlled extension cord.

image

The hardest part was to make the feeding installation itself. It became obvious that during the holidays the fish goes on a diet from which the frozen bloodworm is excluded, and only granules are eaten.

Rummaged runet in search of an acceptable design for hand-made production. The most acceptable considered rotating drum with food inside. In this case, the drum has a slot through which the granules fall out passing the bottom point. The most important thing is that this drum itself does not accidentally stop in the “slot down” position, then the fish can have a “belly feast”, and after a while the feeling that they live in a sartire instead of an aquarium. In short, there were problems:
  1. what to make the drum
  2. how to rotate it
  3. how to make him stop on time, making only one turn

Having rummaged in the broken-down toys, 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 usual plastic jar of oatmeal kissel, which the spouse indulged in for some time, became the drum. But when I assembled the design and tried it from a standard five-volt power supply, I realized that the gearbox has a very small reduction, and the behavior of the entire system is somewhat similar to a centrifuge. Redoing under the other gearbox was lazy and I decided to go a different way - lowering the voltage. But the three-volt power too quickly rotated the drum. Specially bought even a half-volt power supply. I was delighted, but my joy was not long, because when checking the work in the “semi-fighting” mode, i.e. when the feeder was turned on and off via a relay, it suddenly became clear that after 20-40 cycles - the Chinese power supply unit died safely. I had to urgently buy Motor Shield and use its wide possibilities to control the speed of rotation of the drum.

image

In this two of the three problems are gone, and I began to seriously think about solving the exact stop problem. A mechanical switch that would signal the passage of turnover seemed to me not a very good solution. Confused 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, collected a voltage divider with it, and with the help of one of the analog inputs of the Arduino UNO I began to measure the voltage to determine the presence or absence of a label. A small piece of electrical tape made the mark itself, and the backlight was organized by means of a LED powered through a resistor (to limit the current). Then there was a boring generation of statistics, at different degrees of illumination of the drum (the light in the room). Determined what values ​​are removed from the analog input, and set the threshold values ​​for the options "there is a label" - "no label." So the last problem was solved.

image

Then I tried the feeder together with the pellets and the slit, but in order not to feed the fish in advance, I carried out all the tests on a sheet of paper, where I not only determined the size of the slit (sticking it with scotch tape fragments), but also found out that some of the granules were waking past the distance between them two laths I had to peel the plastic packaging for some cable and make something resembling brushes in an electric motor, so that when raising the gap the feed would “shut up” with transparent plates rubbing against the drum.

As you already understood, the purpose of this device is not at all a full fish life, but some self-test. And I decided to go further. In terms of software development. In the gland, I was only the performer of three teams, but on the home server - I decided to keep some statistics. Since I am a web programmer, I took the habit of the MySQL database and started two tablets in it. In one put - URLs and dates of requests to the device, in another wrote answers, as a result I received statistics on whether the fish were successfully fed and how much the lights in the aquarium turned on and off. (The fact is that the device only responds after executing the command. And it does not, if something went wrong.) Recalling some of its skills in Java, I took the URL class and made all these three http requests to arduinka using it. JSON-answer parsil, library downloaded from json.org. The vacation approached swiftly because there was not enough time for the remaining perversions, and I decided to launch the java-software myself with the help of the good old cron.

Here in this form, and found us and the fish departure to the sea. Three weeks later, we returned tanned and saw all of our fishes swimming merrily through an aquarium.

image

Source: https://habr.com/ru/post/367799/


All Articles