Smart Chicken Coop Ready-Made Home Automation Project
In this review, I will tell you about my own example of creating a smart chicken coop based on the Chick project, which uses Wemos D1 mini controller with the ESP8266 chip.
Honestly, I would never have thought that twelve laying hens could easily provide for a family of three, plus there would be a surplus and a third of the eggs would need to be sold or given away.

But of course, there is a nuance. It is that stable egg production of hens depends not only on nutrition, but also on the climate that you create in the hen house. Temperature, humidity, duration of daylight hours can really increase egg production more than twice!

This is a general list of indicators and devices that are provided in the project. My project does not use all of them, so I will list what is involved:
- The controller temperature sensor together with a cooler for cooling it. This is a standard set for any project.
- Temperature and humidity. These are some of the main indicators for a chicken coop. A remote wired sensor will be used for them.
- The climate will be formed by two other devices, first of all, a heater. I will have two of them, 250 watts each.
- It is also extremely necessary to ventilate and remove excess moisture, so air ventilation is important here. And since I have a small chicken coop, a large computer cooler will do the job perfectly.
- Illumination is an important indicator to turn on the lamp device when necessary.
- I will also use an automatic feeder so that the chickens eat regularly and do not overeat.
- And of course, every smart chicken coop should have an automatic door or window for walking the bird, plus to save precious heat in the winter. For this, the window position indicator and the "Window" device will be used.
That's all for now and the next step is to design a chicken coop. This is my first smart chicken coop, so a small size of one meter twenty-five by two and a half meters was chosen.

The general idea is to make the chicken coop small and standing on supports. In this case, I see a number of advantages. Firstly, it will be easy to maintain. Secondly, there will be no extra volume, and therefore no expenses on materials and heating. Thirdly, its walls will be less susceptible to rotting. And fourthly, the chicken coop also serves as a canopy, under which you can hide in hot weather.

Ideally, of course, the supports should be made of concrete or metal, but I chose a test version of a hundredth beam, let's see how long they last. On six supports there are three joists, and on top of that there is a floorboard. Then there is a frame made of OSB-plate and a fiftieth slat.
At the front of the chicken coop is the main door for its maintenance. Above this door is a window for light and ventilation. At the back there will be a small window for walking. On top is an insulated roof, also on a frame base.

In general, only the frame itself is shown here. It is assumed that it will be insulated, for example with polystyrene foam, and on top of it there will be siding. For example, it can be clapboard.

There will be a perch and three nests inside. These nests are a separate structure that will be moved and removed.
There will be a slanted board inside, along which the eggs will roll into a separate section with a lid. In this case, the eggs will be easy to collect and the hens will not peck at them.
The finished drawings will look like this. The dimensions of the elements are chosen to minimize the waste of lumber. I started from the standard size of the OSB sheet.
First of all, the chicken coop itself.






And these are the perches.



Well, after ordering and preparing the lumber, I started assembly.

First I prepare the supports, for this I decided to thoroughly soak them with used oil.

The supports are installed on a gravel bed, and the joists are attached on top of them. And the foundation of the chicken coop floor begins to form on the joists. I had thirty-fifth tongue-and-groove board left for this.

The foundation is ready.

Using metal corners, I begin to assemble the frame.

Before installing the insulation and roof, I decided to paint the wood to protect it.

The chicken coop is also necessarily painted inside to close the pores and reduce formaldehyde fumes from the chipboard. A special approach is required for the floor. First, a protective impregnation and tinting, and then two layers of yacht varnish.


I assemble the roof frame and insulate it. Using two boards I made a profile for the wave of the ondulin roof.

As soon as the roof appeared, chickens immediately began to settle in it.

The frame is ready. And we can start insulating it. For this, I will use extruded polystyrene foam of a similar thickness to the slats.

I install perches inside.

After laying the insulation, I foam the cracks well. To fence the chicken coop area, I use a plastic-coated metal mesh. So, you can start siding, covering the chicken coop with clapboard.

When everything is ready, final painting. All that remains is to make the nests and try to place them. Further use showed that it would be convenient to place them on furniture wheels.

Also, in order to reduce chicken parasites, I treated the inside of the chicken coop with a lime solution. In fact, the most effective way to combat them is to prevent them, and for this you will need climate control to eliminate high humidity.
The chicken coop is ready and has already sheltered the settlers. However, now is the time to make it comfortable and efficient.

To do this, I connected it to electricity and installed a powerful 12-volt power supply in the distribution box. I need it because it will power not only the controller itself, located on the side, but also many other devices: lighting, ventilation, door drives and feeders.

This is what the controller itself looks like. In this chicken coop, there will be only one. After all, the chicken coop is small. But let me remind you that I don’t necessarily need to pull wires from all devices to this controller. If this were a large chicken coop, then it would probably be better to have its own executive controller near each device.
To the right of the main controller board are the other device relay module boards. These will turn on the heaters, exhaust fan, and feeder.
In the lower right corner there is a module for arduino known as a motor driver. It is designed to operate two devices. I will use it for the actuator drive motor, because I need to change the polarity and open and close the window. And instead of the second motor, I will use lighting in order to change its brightness using a PWM signal.
There will also be a light sensor inside the controller box.
Let's now look at the other components.

This is a humidity and temperature sensor.

This is an LED light.

Two infrared heaters. And a computer cooler as an exhaust hood.

There will be an actuator at the back of the coop that will open and close the window or door for walking.
In order to prevent the drive from breaking down, it is necessary to install two limit switches. They will turn off and on the drive motor at the extreme points without a command from the controller.
The next question in the chicken coop will concern the drinker and feed. The drinker of the chicken coop is implemented in the simplest way so far. This is a container and special nipple drinkers.

But the feeder will be automated, because here it is necessary to maintain a balance so that, on the one hand, there is no overeating, and on the other hand, so that feeding does not take up time.

To make the automatic feeder, I welded a metal frame onto which a water container will be installed.



It will be placed upside down. At the top I made a hole for pouring in the feed, and at the bottom of this bottle, a screw dispenser will be attached to its neck. There is a separate video on how to make it.



Depending on the season, this dispenser can feed either inside or outside the coop. I used a standard 50 pipe to direct the feed downwards.

Now that all the components are in place, it’s time for me to move on to the project settings and show what automatic operating modes I use.
I also strongly recommend that you watch the tutorial video step number 6 , which explains what automatic modes are and details how to set them up. In this case, it will be much easier for you to understand what I will tell you next.

This is what the general list of modes looks like. The first three are not independent modes. They were created to be used as templates in other modes. To make it easier to distinguish them, I made the names completely in capital letters.
I'll start with the standard "System" mode.

Here, tasks are defined only for the "Controller Cooling" device.

And here are the automatic notifications that will work in most other modes.
The next mode is "Backlight". From the name it is clear that here are tasks for the lamp. The main task is to provide a long daylight.

The first task "Light" is needed to turn on the lamp under the condition of low illumination outside, and immediately at full power. The schedule for this task is from three to six.
The next task is "Sunset". Its meaning is not to frighten the bird by abrupt switching off and to give it the opportunity to settle down for the night, gradually reducing the illumination over the course of one hour.
And the last task "Dark" speaks for itself, it will simply turn off the light anyway.
The next template mode is "Feeding". Here the operation of the automatic feeder will be determined.

I made six tasks to turn on the feed dispenser drive. Each task has its own time interval and time for which the dispenser will be turned on. Time in this case means the interval during which the server will try to turn on the feeder. As a rule, if the connection is stable, then this happens right there in the first minute. If for some reason the command does not pass during the specified interval, then the corresponding feeding is skipped.
The first two operating modes "Open" and "Close" contain only tasks for the door to open and close. They do not affect the operation of other devices and are convenient when cleaning the chicken coop.


But the following four modes are already the main working ones. I will tell you their meaning in general.

The Cool/Day mode works when it is warm enough outside to open the door for the birds to walk around. It is also a good idea to turn down the heat in the coop when no one is there.
The "Cold/Night" mode works when it gets dark, the birds enter the coop, and the door needs to be closed. In this case, it is necessary to create a warmer climate so that the hens can spend the night comfortably.
The Frost/Day mode should be used on special days when it is not advisable to let the bird out for a walk.
And the “Hot” mode will only work when the outside temperature is extremely high and good ventilation is required.
Now let's look at the tasks of each mode.
Cold/Day mode.
Ventilation. One task with operating conditions for temperature and humidity. That is, as soon as the humidity or temperature is exceeded, the exhaust will turn on until the minimum values are reached or the time interval ends.

Heating. Since the bird is outside, we will maintain a minimum temperature.

Door. Task for full opening.

The next mode is "Cold/Night".
Ventilation. There are already two tasks here. "Control" is a very similar task as in the previous mode, but with slightly changed conditions. And another task for ventilation - "Minimum". Without any conditions, turn on the ventilation every half hour to simply refresh the air.

Heating. Already higher temperature for a comfortable night.

Door. There will be two tasks here. The first is to slowly close the door so as not to harm the bird. There is a very small range of illumination here. That is, the decision to close the door will happen instantly. But, please note that at one time, that is, in one minute, the change in the position of the door cannot be more than three percent. Thus, the door will close little by little over the course of about thirty minutes.


The first task schedule is evening, that is, this is a slow closing algorithm.
Let me remind you that in the “Cold/Day” mode, the door opens instantly to maximum as soon as this mode is set.
The second task is a clear closing. It is necessary because if suddenly the controller reboots at night, then in this case the door will close immediately and quickly.
The next mode is "Frost/Day",
This means it is very cold.Ventilation. One task for ventilation and only in very extreme conditions of high humidity. Its removal will occur due to heating of the chicken coop.

Heating. There is, but not as powerful as it was at night. During the day the bird moves, so it should be fresh.

Lighting. Just turn it on. My coop gets little light through the window in the winter.

The door. Just close it. More precisely, don't open it, keep it closed.

The next mode is "Hot".
Ventilation. Two tasks. At night the hood is on continuously, and during the day it is completely off.

The heating is naturally turned off.

The door is open at any time of the day.

This is where the modes end, but it is obvious that switching them manually will be quite a task. Naturally, home automation should perform its functions completely and the desired mode should also be set automatically. This is what the smart network is for.
The smart network not only connects different projects with each other. In addition, it can also loop the automation of the project to itself. In this case, this is what happened with the chicken coop.

Here is a list of the chicken coop connections when it will be automatically set to modes.
The first priority is set to a frosty day. What is its logic?
Limitations. First of all, we need to check whether the "Cold/Day" mode has already been set. In this case, the door of the chicken coop will already be open and it cannot be closed. Because then some of the birds will remain outside. This is an important point. Even if it was warm outside in the morning, but it got colder during the day, the "Frost/Day" mode will no longer be set.

The second limitation is related to the fact that if you decide to set the "Open" mode, the automatic installation of other modes is blocked in this case.
And now the conditions when exactly this mode needs to be established.

First of all, it should be light already, and secondly, there should be a strong frost. And here we see that the last indicator will be taken from another weather station project.
The next link is to set the cold day mode.
There are no restrictions here, but there are conditions.

Similarly, first it must be light, and the second condition is the presence of heat. That is, the "Cold/Day" mode can change the "Frost/Day" mode, but vice versa - no.
And the next mode with equal priority is "Cold/Night". It will be set when it has already started to get dark outside and it is still quite cool. Everything is obvious here.

The last binding has the lowest priority over other bindings. It will set the "Hot" mode for any time of day, but with the obligatory condition of high temperature outside.

As you can see, home automation with SmartESP can solve quite complex tasks without using programming skills. All these complex strategies are set using modes and bindings.
This concludes my review of my smart chicken coop. I could never have imagined that year-round poultry keeping could be so simple. At the same time, I received a cheap, and most importantly, environmentally friendly product. Moreover, in such quantities that by selling the surplus, I was able to fully recoup the costs of electricity consumed in winter.