loading

Hello every one

For a school project we had to carry out this project.

So that this project is not lost, we present it on this site

This is our "Chicken house" project

You will find the instructable on the following pdf

And you will find all the code on the following .rar

Enjoy

See you

Step 1: Automated Chicken House : Instructable

Step 2: Functions

The different functions of our project are :

  • The opening and the closing of the door according to the brightness;
  • The opening and the closing of the airing trap door according to the temperature;
  • The control of the water level;
  • The control of the seeds level;
  • The monitoring of these functions thanks to a graphical interface.

Step 3: Building of the Chicken House

Materials

The chicken house is composed of:

  • a wooden house

The majority of the materials that compose the chicken house are built in wood.

Step 4:

  • a door

The chickens have to go into the chicken house when the sun goes down and to go out when the sun rises.

Step 5:

  • an airing trapdoor

When the temperature is too high, an airing will open in order to ventilate the chicken house.

Step 6:

  • a nest box

The nest box is the place where the chickens lay.

Step 7:

  • a perch

The chickens sleep aloft on the perch.

Step 8:

  • a drinking trough

The chickens drink water.

Step 9:

  • an eating trough

The chickens eat seeds.

Step 10: How to Build a Chicken House Been Compatible With Automation ?

The chicken house is:

  • 800 mm wide;
  • 1600 mm long;
  • 1000 mm high.

To design the chicken house, we have used Solidworks. Underneath, you can see the 3D view.

To allow the chickens to lay comfortably, we have decided to create a nest box of 300 mm on 300 mm. The nest box is duplicated in 2. Indeed, each chicken can lay in full privacy. The nest box is equipped with a trapdoor to allow the farmer to take easily the eggs.

To allow the chickens to go into the chicken house when the sun goes down and to go out when the sun rises, we have used an automated door. The height of the door is more or less 450 mm. Because of this, the sliding door is 350 mm high. Effectively, when the chickens go in or out, they have to lower their heads.

To allow the aeration of the chicken house when the temperature is too high we have created an airing trapdoor of 400 mm on 140 mm. It is very important that the chickens feel good if you want to have tasty eggs. Furthermore, to prevent the entrance of small, undesirable, animals by this trapdoor, we have fixed a mesh in front of the trapdoor. It would be sad if one day you get up and discover that all of your chickens are disappeared.

The chicken house is mainly built in wood. All the wood used for the building is second-hand wood. We have used wood and more precisely second hand wood because we wanted to realise an environmentally friendly chicken house.

Otherwise, the roofing is made of plastic. We have used plastic sheets.

And for the flooring, we have used second-hand metal sheets.

To build the chicken house, we have used:

  • A circular saw and a jigsaw to cut the wooden rafters and the wooden sheets at good dimension;
  • A screw to screw the wooden sheets on the framework;
  • A hammer to nail the framework.

For the supply of provisions, we have used a conical, purchased, drinking trough for the supply of water and for the supply of seeds, we have used a second-hand hopper of pigs.

Thus, the building of a chicken house compatible with automation is cheap and easy to carry out and doesn't need big means.

Step 11: Automation of the Chicken House

Materials

The opening and the closing of the door according to the brightness
This function is about the opening and the closing of the door according to the sunlight variation.

Materials that you need

  • A photo resistor module

It’s a sensor that will allow you to get the intensity of the light.

  • A car window motor 12V DC

It’s the actuator of this function. It is connected to a 12V DC car battery.

  • Two bearings with a rolling pin
  • A rope
  • 2 channel relay
  • 2 end sensors

The car window motor is connected to the rope and the rope is linked to the door. With this system, you can open and close the door with ease. The 12V DC motor will stop when the door will reach the end sensors. You have to put one on the top and another one in the bottom

The opening and the closing of the airing trap door according to the temperature

This function is about the opening and the closing of the trap door on the top side of the chicken house according to the temperature inside the chicken house.

It is exactly the same operating that the function above-mentioned.

Materials that you need

A temperature and humidity sensor DHT11

  • It’s a sensor that will allow you to get the temperature and the humidity inside the chicken house.
  • A car window motor 12V DC

It’s the actuator of this function. It is connected to a 12V DC car battery.

  • Two bearings with a rolling pin
  • A rope
  • 2 channel relay
  • 2 end sensors

The car window motor is connected to the rope and the rope is linked to the door. With this system, you can open and close the door with ease. The 12V DC motor will stop when the door will reach the end sensors. You have to put one on the top and another one in the bottom.

The control of the water level & the control of the seeds level

These functions are about the checking of the level of the food and the water.

Materials that you need

  • 2 ultrasonic sensors HC-SR04

They are sensors that will allow you to get the levels of seeds and water. They are the best choice for checking the different levels because of their precision.

Step 12: ​The Monitoring of These Functions Thanks to a Graphical Interface

Material that you need

  • A screen
  • A computer

The computer allows you to open the executive file.

Step 13: All of the Functions

Common materials that you need

  • An Arduino

It is one of the most important hardwares of our project. The Arduino is a microcontroller with input/output plugs. You can use it to program a lot of sensors and actuators together. For this project, you can use an Arduino MEGA 2560. It isn’t an expensive model and it’s enough for the number of required plugs.

  • A Raspberry Pi Zero Wireless

It is one of the most important hardwares of our project. The Raspberry Pi zero wireless is a microprocessor. It’s like a little computer. You can use RealVNC to control it from a computer. Moreover, the Raspberry Pi is your graphic device. You can use Tkinter to do the graphical interface.

  • A breadboard
  • A lot of little wires
  • A HDMI/Micro HDMI adapter
  • A 12V battery

It is the power supply of our project

Step 14: Software - Arduino

The Arduino code is the heart of the acquisition of the data. The code has been cut into different parts. Indeed, we have created class for the door, the door with the light sensor, the airing trap door with the temperature sensor and the level of food and water.

Each class has been separated in two codes. One is a class with the name “.h”. It’s where the object is described. For instance, the code door.h describes the function that are used and the variables needed. The second one is a C preprocessor instruction with the name “.cpp”. It’s where the functions of the object are edited.

Door.h and Door.cpp are the program to open or close the door manually.

DoorTemp.h and DoorTemp.cpp are the program to open or close the airing trap door. It also includes the functions of the humidity and temperature sensor.

FoodQuantity.h and FoodQuantity.cpp are the program to check the levels of the water and of the food. It uses the ultrasonic sensors.

DoorLight.h and DoorLight.cpp are the program to open and to close the door according to the level of brightness detected by the light sensor.

Therefore, don’t forget to put the #include at the start of the code for the four other parts. If you forget them, the main code can’t use the sensors.

After that, you have to write the variables that are used. You have here the objects Door, DoorLight, DoorTemp and FoodQuantity. Pay attention that the object Door and FoodQuantity are called twice. Indeed, you need this object a second time to close the airing trap door manually and to receive the level of water.

The main code “Chicken House” got all the constants for the electronic devices. There are all the constants used for the Arduino and also for the Raspberry.

The loop of the code is waiting for a communication from the Raspberry. If the Raspberry sends a message with the name of the function. The arduino will activate the appropriate functions like open the door or close the door if it receives the string OPEN_DOOR or CLOS_DOOR …

Step 15: Software - Raspberry & Tkinter - the Graphic Window

The graphic program is an important part. It will allow you to see the different informations of your sensors. It is constituted by 2 files:

  • ChickenHouse.py

“ChickenHouse.py” is the centre of the program. It will launch the interface.

First, we need to import the different modules of python. The first one, chickenHouseApp, will be explained subsequently in the instructable.

“import serial” allow you to use the different serial ports and serial communications between your Arduino and your Raspberry Pi zero.

“import logging” is a module that will make sure that the graphical application and the datas are running smoothly and then it will put it in a file.

“logging.basicConfig” enables you to configure the file that it recovers the data.

“ser” has been used to give the correct serial ports for your computer. It’s “COM4” for your PC and “/dev/ttyACM0” for your Raspberry. You need to check that!

“logging.info” is waiting the arduino response before to start the rest of the program.

The two last lines of code will launch the interface and the second program.
The first import, from chickenHouseApp import *, got all the program chickenHouseApp contained in the file and use it in this main program. The main program, ChickenHouse.py, will work with all the datas of the file chickenHouseApp and it will start the interface.

  • ChickenHouseApp.py

We import a new module “Tkinter”. It’s an important module. It will allow you to use a graphic window. “Tkinter” brings you all the different class and important codes to make the graphic interface.

The first important phase is to declare all the constants of our program.

Then, you must write the constants below. They are important for the calculation of distance that apply to the food and the water level.

After that, we use two different class for the program. The first one is the class ChickenHouse. The first definition will launch the application and the second one will initialize the window.

An important thing to know is that the Raspberry is the leader in the communication between Raspberry and Arduino. It’s important in order to have a correct work with the both of them. It’s the Raspberry that will need the different information for the Tkinter program. Thus, the Raspberry will request the datas from the Arduino. It is a bad idea to work with an Arduino that sends all the datas to the Raspberry. It will not work well.

The second one is the class Application (frame). It is inside this class that you specified the size of the buttons for the graphical interface and where you applied functions on it.

“ExecuteArduino” is a function that permits to get a piece of information from the Arduino if you specified the name of the variable.

“showValue” is a function that is used to show a value returned by a sensor.

The other parts of the code are about the configuration of the interface. You can check it on the python program.

Step 16: Wiring

Underneath, you can see the different electrical circuits of our project.

  • DOOR OPEN
  1. Ka OFF => K1 OFF => Motor OFF
  2. Ka ON => K1 ON and K4 OFF => K2 ON (ground) => Motor ON DOOR

  • CLOSE

  1. Kb OFF => K5 OFF => Motor OFF
  2. Kb ON => K5 ON and K3 OFF => K6 ON (ground) => Motor ON

Step 17: List of Prices

The total price to automate the project is more or less 300 € but as we have used second-hand devices, the cost price is only more or less 110 €.

The price for the building of the chicken house is 0 €. Indeed, all the materials used to build it are second-hand materials.

<p>I read the title of this one and the picture of some weird, cyborg chicken flashed into my mind. &quot;Watch out for the gears, dear...&quot;</p>
<p>OK looks great . New though , bet you had <br>to throw in seed to get them to go inside . The entry is still clean. <br>Now the next step is some form of radio communication to tell you when <br>to go pick up the eggs. </p><p>How about an esp8266 based wifi system? <br>Or one of the 900 meg type radio transmitter/receiver chips? Pretty <br>cheap nowadays. Coding for arduino is all done for you as is esp8266.</p><p>I've been getting 500 meters line of sight with some of the 900Meg types </p>
<p>Can you add the &quot;.ino&quot; files please for arduino code . Makes it much easier to study and comment on</p>
<p>My error . I see they are included in the &quot;.rar&quot; file -Thanks</p>
<p>Very cool. My wife has been wanting to start raising chickens and a system like this could really cut down on the maintenance.</p>

About This Instructable

1,085views

19favorites

License:

More by aeegroupe9:How to make an automatic chicken House 
Add instructable to: