📜 ⬆️ ⬇️

Create a fully automatic farm (finished implementation)

We continue to review the activities of our Hackspace Club .

In the previous article , the idea of ​​creating a fully automatic autonomous farm near our mini-hotel in the Crimea was voiced. And we did it. Ideas were technically implemented.

7 experimental images, i.e. Ordinary chickens (age 4 months, girls), were launched for permanent residence in a cage equipped with everything necessary for life support. The rooster was decided not to settle with the birds, yet the resort area and its singing in the mornings will not be liked by many.
')
Chickens 3 weeks without a person. Grow and look satisfied. The experiment is proceeding normally.
Here is a video of the life of our birds in conditions without human intervention, offline, i.e. in the conditions of automated feeding and watering on a schedule, cleaning, heating and light The most interesting moments will be spread in the process here .


There are few words under the cut, a lot of photos and videos.

I described the automatic farm control unit in the previous article . The only thing that changed is that it added a DC-DC conversion chip to power the Raspberry PI. For it you need 5V and I purchased an uninterruptible power supply for 12V.



Solid-state relays at 220v 25A, to turn on the lighting, although there is a window, it may not be very light on cloudy days. And also to turn on the fecal pump and infrared lamp for heat. At night, even in the Crimea, it is cold, especially in winter. Therefore, the issue of heating the living creatures should be worked out in advance.



Controlled sockets that are controlled by a solid-state relay.



Drinking bowl turned out successful, hens will not be able to climb into it with legs. When filling the drinker, the valve on time was chosen so that the water would fill the drinker and the water would overflow for several minutes, thereby refreshing the water every day. At the same time, it turned out to be an interesting attraction for birds, judging by the online video, brave birds are trying to drink streams of spilling water.



Reserve drinker:



Water supply valve, controlled by 12V.



Capacity on 120 liters with the fecal pump.



Feeding trough view outside, the test helped to do, for which he thanks a lot.



The trough is inside the view, obviously there is simply no place to catch the stern, so the vibromotor did not begin to do, and there was already no time and energy.



The feeder is full, the feed contains about 40 kg.



The video camera on which I control the whole process is bad but the other one is not there yet. The first video in this article is recorded on it.



12V uninterruptible power supply. It feeds only Raspberry PI, feeder motors and water valve. The most necessary for the viability of chickens. I experienced when turning off the light for a day no failure occurred. Feeders fed drinkers watered.



The router on which I spread on the ports of control of the video camera and Raspberry PI.



General view of the chicken coop with three feeders, now there is an infrared lamp for heat.



Well, the most interesting. For all, judging by the comments of the previous article, this is a video of cleaning the pan with water. Along the entire cage, pipes are laid in which the bottom is made with an interval of 10 cm. Holes 3 mm in diameter. When water is supplied from all openings, water flows. When removing this video, the pressure was very weak, but the quality of the video was good, it was not shot at the remote camera.



The process of automatically turning on the fecal pump removed from a remote camera recently.



I did not use the program described in the previous article , I decided to use the standard Linux cron. Wrote for each remote device, whether it is a feeding trough, a drinking bowl, a light, an infrared lamp or a fecal pump. Small programs like this:

code
#include <wiringPi.h> #include <wiringSerial.h> #include <stdio.h> #include <time.h> int main (void) { time_t rawtime; struct tm * timeinfo; time ( &rawtime ); timeinfo = localtime ( &rawtime ); printf ( "datetime %s\n", asctime (timeinfo) ); int tt_hour = timeinfo->tm_hour; int tt_min = timeinfo->tm_min; int tt_sec = timeinfo->tm_sec; // printf ( "hour - %d\n", tt_hour); // printf ( "min - %d\n", tt_min); //printf ( "datetime %d\n", tt_hour); printf("kormcrom\n"); // 1 draiver motora int pin0 = 0; //11 noga int pin1 = 1; //12 int pin3 = 3; //15 int pin4 = 4; //16 // 2 draiver motora int pin7 = 7; //7 noga int pin5 = 5; //18 int pin6 = 6; //22 int pin10 = 10; //24 // 3 draiver motora int pin11 = 11; //26 noga int pin12 = 12; //19 int pin13 = 13; //21 int pin14 = 14; //23 int i; if (wiringPiSetup() == -1) return (1); pinMode(pin0, OUTPUT); pinMode(pin1, OUTPUT); pinMode(pin3, OUTPUT); pinMode(pin4, OUTPUT); pinMode(pin7, OUTPUT); pinMode(pin5, OUTPUT); pinMode(pin6, OUTPUT); pinMode(pin10, OUTPUT); pinMode(pin11, OUTPUT); pinMode(pin12, OUTPUT); pinMode(pin13, OUTPUT); pinMode(pin14, OUTPUT); digitalWrite(pin0, 0); digitalWrite(pin1, 1); printf("KORM cron On\n"); delay(25000); digitalWrite(pin0, 0); digitalWrite(pin1, 0); printf("korm cron Off\n"); return 0; } 


And in the Linux cron I set the schedule:

01 7 * * * root / home / ledon >> /home/log/led.log - turn on the light in the morning
10 7 * * * root / home / korm >> /home/log/korm.log - enable the 1st feeder
01 14 * * * root / home / korm34 >> /home/log/korm34.log - turn on the 2nd feeder
10 14 * * * root / home / water2 >> /home/log/water2.log - supply water to the drinker
01 19 * * * root / home / korm106 >> /home/log/korm106.log - enable the third feeder
01 20 * * * root / home / ledoff >> /home/log/led.log - turn off the light in the evening
30 14 * * 2 root / home / fekal >> /home/log/fekal.log - once a week to pump water from the tank

At the same time I write logs for each device separately.
In general, almost everything that was conceived was realized.
I spent the whole vacation for 2 weeks on this, I lost 10 pounds by weight. Before that, I hadn’t raised anything heavier than a pen for two years. But how nice it is now on the cameras to watch their work.
Now I put exactly the same Raspberry PI on my desk, debug the program on it, and only then upload it to the remote. I read, so in NASA do with rovers. But it is not known who is more at risk - NASA or I, if something goes wrong, my mother-in-law should ask to go 30 km. overload the Raspberry PI.

Now we are thinking about creating a fully automated pig farm, imagine buying small pigs, putting them in a pigsty, and after half a year - getting a whole boar for 120-150 kg. Fantasy? Well, about two months ago I thought about the chicken coop. And half a year ago, I could not even imagine that I would be bound to something with agriculture. But I think this kind of agriculture and you will like the dear habrary readers.
ps Here destray helped set up an online camera. We bring to your attention - hot tsipochka online without registration and SMS :) www.ivideon.com/tv/camera/100-d73dad0c45719a28e8d98ca56aa99060/0/?lang=ru

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


All Articles