Professional Documents
Culture Documents
Signature: …………….
Date 17/02/2022
This report may proceed for submission for assessment for the Award of Bachelor of science in
Electrical Engineering at the University of Dar es salaam.
Date: ……………………….
i
ABSTRACT.
This project analyses about the design and implementation of an automatic chicken coop door
which will open for allowing chickens to get in and out the coop as well as closing the door without
the use of human force. Also, the system will be added an automatic system which will select only
chickens to enter the coop while other animals will be prevented to get in.
This work aims to simplify the time table of a chicken keeper as it will not be interfered with
chicken schedule. Hence, chicken breeders will be able to conduct other economic activities with
no disturbance from the chicken schedule. On top of that, the design will protect the chickens and
their eggs inside the coop from being attacked by predators since the system will prevent predators
to enter the coop. Therefore, the system ensures safety of chickens inside their coop, even the
breeder will be in peace condition about the safety of his or her chickens.
The report involves analysis of different methods step by step which were used to design the
system up to the point of its completion hence this will help to understand the design in details.
ii
ACKNOWLEDGEMENTS.
I would like to appreciate the department of Electrical Engineering of university of Dar es salaam
for providing me with the chance of conducting the project and superb instructors who helped me
with my project.
I am grateful to my respected lecturer and supervisor Dr. Francis Mwasilu for his cooperation and
guidance throughout the project as a project supervisor. I appreciate him for helping me with my
project by sharing his suggestions, instructions and experiences.
I am also heartily thankful to our lecturers of department of EE for their worthy suggestions and
valued instructions during mid-oral presentations held at the university.
Last but not least I would like to express my sincere gratitude to my project coordinator Mr. Shaban
O. Kasinge for his updates and guidance about preparation of this report and all others who have
directly or indirectly contributed for bringing this project to this stage.
iii
TABLE OF CONTENTS.
DECLARATION. ............................................................................................................................ i
ABSTRACT. ................................................................................................................................... ii
iv
2.3. Proposed system. .................................................................................................................. 8
2.3.1. Automatic chicken coop door with security system by using infrared sensors. ............ 9
2.3.2. Automatic chicken coop door with security system by using RFID tags. ................... 10
2.3.3. Automatic chicken coop door with security system by using camera with machine
learning. ................................................................................................................................. 10
2.4.2. DC motors.................................................................................................................... 15
CONCLUSION. ............................................................................................................................ 28
REFERENCES. ............................................................................................................................ 29
APPENDICES. ............................................................................................................................. 30
v
LIST OF FIGURES.
Figure 1: Block diagram of proposed system by using camera. .................................................. 11
Figure 2: Camera module (a) An ESP32-CAM (b) An OV2640 (c) An OV7670. ...................... 14
Figure 3: Brushless DC motors (a) NEMA 17 stepper motor (b) Servo motor. ........................... 16
Figure 4: Raspberry Pi 3 ............................................................................................................... 18
Figure 5: ATmega328P Arduino boards (a) Arduino Uno (b) Arduino Nano. ............................ 20
Figure 6: Sensors (a) Ultrasonic sensor (b) IR sensor. ................................................................. 22
Figure 7: Components diagram for proposed system. .................................................................. 26
Figure 8: Flow chart of proposed system. ..................................................................................... 27
vi
LIST OF TABLES.
Table 1: Specifications of OV2640 vs OV7670. (Tessie, 2021) .................................................. 14
Table 2: Characteristics of brushed DC and brushless DC motors. (Millett) ............................... 15
Table 3: Specifications of servo and stepper motor. ..................................................................... 17
Table 4: Specifications for Arduino Uno and Arduino Nano. ...................................................... 20
Table 5: A comparison between Raspberry Pi and Arduino board. (Ibro, Wong, & Zyla, 2019) 21
Table 6: A comparison between an ultrasonic and a PIR sensor. ................................................. 23
Table 7: Time schedule for the project for semester I. ................................................................. 30
Table 8: Cost estimation. .............................................................................................................. 31
vii
LIST OF ABBREVIATIONS.
BLDC Brushless DC
BLE Bluetooth Low Energy
CMOS Complementary Metal-Oxide Semiconductor
CPU Computer Processing Unit
DC Direct Current
EEPROM Electrically Erasable Programmable Read-Only Memory
ESP Electric Selective Pattern
GPIO General Purpose Input Output
HDMI High-Definition Multimedia Interface
I/O Input Output
IR Active Infrared
LCD Liquid Crystal Display
LED Light Emitting Diode
MCU Microcontroller Unit
ML Machine Learning
RFID Radio-Frequency Identification
PCB Printed Circuit Board
PIR Passive Infrared
SRAM Static Random-Access Memory
USB Universal Serial Bus
UXGA Ultra-Extended Graphics Array
VGA Video Graphics Array
viii
CHAPTER ONE.
GENERAL INTRODUCTION.
1.1. Background.
Chicken breeding or keeping involves raising of domesticated birds especially chickens to produce
meat or eggs for food. Chickens raised for eggs are known as layers, while chickens raised for
meat are called broilers. It has originated from the agricultural era. It has been a feature of human
society for thousands of years. To ensure that it continues to make positive and sustainable
contributions to stable human society, it is essential that production and marketing are tailored to
local conditions and associated value chains, maximize nutrient cycling and efficient utilization of
all products and maintain genetic diversity.
Smallholder chicken keeping has an important role to play in feeding the world and to maximize
the benefits, it should be accompanied by improvements to local health services and holistic
programs that highlight the links between chicken keeping, human health and nutrition and
sustainable ecosystem services.
1.2. Introduction.
Chickens are prone to being attacked by many predators. In order to keep chickens safe and alive,
a good solution is to have an enclosed structure for the chickens to go in during the day and night,
hence, chicken coop is needed. Chicken coop is a structure where chickens are kept safe and
secure. Rather than having to go out every night to lock them up in this structure, or early in the
morning to let them roam the pasture. A good solution would be an automatic door installed on
the chicken coop. The door can be designed to include many different functions. These functions
will be involved in how it opens and closes, how it is set to open or close and how it prevents
predators to enter the coop.
In having a fail proof door, it will automatically open and close to allow the chickens to roam
pasture during the day and be safe from predators when they are in the coop during the day and
night. This door will avoid substantial risks of predators roaming the pasture all the time. The door
will increase productivity of the hens to lay eggs, and decrease the “costs” that are incurred if
chickens were loss to predators. (Inks, 2012)
1
1.3. Problem statement.
Existing chicken coop doors causes different problems to chicken breeders and chickens
themselves as follows;
➢ Chicken breeders encounters the situation of delaying to arrive and starts other economic
activities like cultivation due the tendency of waiting the time to open for chickens. Again,
they need to open the door in the morning even if they are lying cozy in bed, wrapped in
warm sheets (for resting days).
➢ Also, they need to close the door at every sundown, so if they happen to be detained
somewhere else or need to leave for an emergence and can’t return on time, their chickens
may be left vulnerable to predators.
Due to the problems associated with the existing chicken coop doors, technical solution to these
problems were proposed to solve the problems. Proposed solutions are as follows;
➢ Design of an automatic door will solve that scheduling issue. This electronic door will open
when chicken approaches near the door and close when chicken go away from the door.
Opening and closing of the door will be activated in between sunrise and sunset, at night
the door will be off closed for the secure of the chicken.
➢ Also, during the time of activation, the door will operate to allow only chickens to enter
and leave the coop, hence other predators cannot enter the coop through the door.
1.5. Objectives.
Purpose of conducting this project is to fulfil the objectives which are divided into two parts,
namely; main objective and specific objectives.
The main objective of this project is to design an automatic chicken coop door with security system
against predators that will be open and close automatic without human force and ensure the safety
of chickens while they are in the coop.
2
1.5.2. Specific objectives.
In order for the main objective to be archived, other preliminary objectives should be adhered first
so as to help in archiving the main objective. The following specific objectives will lead to the
achievement of the main objective.
i. To design control circuit for opening and closing the coop door.
On completion and successful installation of this project, it will offer the following significances.
i. It will help to reduce the disturbance of timetable of the chicken keeper from being
disturbed by chicken schedule.
ii. Facilitating the opening and closing of the coop door without human force.
iii. Providing security of the chickens in the coop from being attacked by predators.
1.7. Methodology.
In order to accomplish this project different methods and techniques will be employed, under time
consideration. Below is the list of methods that will be followed during this project.
i. Literature review
ii. Preliminary design and analysis
iii. Designing of the circuit
iv. Building a prototype
v. Testing a prototype
vi. Report writing
3
➢ Literature review.
This part involves searching for knowledge from different types of work have been done so far
about automation of doors and useful information from various books, international journals,
World Wide Web as well as consultation to supervisor.
In this section, initial design of the project will be analyzed. The analysis will involve listing of
devices that will be used in this project and the flow chart of the system (working flow).
Knowledge from preliminary design will be used to design the circuit of the proposed system.
➢ Building a prototype.
After designing of the circuit, the designed circuit will be installed by using hardware materials
and assembled together for testing and assessment.
➢ Testing a prototype
The prototype of the proposed system will be tested so as to see if the desired outputs are produced
as required. This method will be used to verify the proposed system if it works as it supposed.
➢ Report writing
At each step of conducting this project, information and data collected will be recorded which will
help in the writing of the report of this project.
4
CHAPTER TWO.
LITERATURE REVIEW.
2.1. Introduction.
This has been done by studying the various existing systems, their advantages and disadvantages
together with the different proposed systems and its advantages compared to the existing systems.
Proposed systems are discussed one by one, comparison between the proposed systems and
selection of the best one. Also, literature review through consultation to supervisor and internet
browsing.
Existing systems are of different design, but they have more challenges than the proposed system.
Existing systems seems to have less protection to the chickens while are in the coop. From the
field of study, the present systems that have been implemented are namely as follows;
Manual chicken coop doors are exactly what their name states; a door is manually open and close
every day and night respectively to keep chickens safe. The system involves of man power to
provide mechanical power to move the coop door from its initial state of being close or open. A
man supposed to be at home to open the coop manually and wait for the chickens to return and
then close the coop.
5
➢ Operation of manual chicken coop door.
Human force; here is a person who use his arm to open/close the coop door manual.
Chicken coop door; a chicken coop is small house where chickens are kept, a coop door is the
means of keep those chickens inside their house and secure those chickens.
Door output; the output of door is a tendency of the door to be opened or closed after the human
force being applied to the door.
There are certain advantages of having a manual door for the chicken coop as follows;
i. Having absolute control of the door. A chicken keeper decides what time the door opens
and closes and personally make sure that none of his or her chickens are stuck outside
before the door closes.
ii. The system is less expensive in terms of its installation as it does not need more money for
buying electronic devices compared to the automated one.
Using manual door have some downsides to the chicken keeper and chickens themselves as
follows;
6
iv. Manual doors can be slammed shut by a gust of wind, so if one of the chickens is entering
or leaving the coop when this happens, it will trap or most probably kill the chicken
outright.
As its name suggests, an automatic chicken coop door is a chicken-sized door that is controlled
and programmed. It opens and closes on its own on the schedule that sets it to and lets the chickens
in and out of the coop without having manually open the door. If chicken keeper’s schedule is less
flexible or if he or she is extremely busy, an automatic door can be a great help to him/her.
The existing automatic chicken coop doors most of them uses timer and light sensors to control
the opening and closing of the door. The design of the door is able to automatically open at a set
time in the morning and automatically close at a set time in the evening. Also, photo sensors are
used to support the design of the system, as they open the door at sunrise and close the door at
sunset by sensing the intensity of the sunlight. Hence, in between sunrise and sunset the door
remains open all hours until the time of close.
Such kind of automated coop door, has advantages to the chicken keeper as follows;
i. No need to get up early to let the chickens out or waiting until the time for opening the
coop door, the door does itself for chicken keeper.
ii. A chicken keeper won’t forget to close the coop door at night, the door will close itself.
iii. If it happens to have a night out or take a short vacation, it’s easier to leave the chickens
because they can leave and enter the coop as door operates.
iv. It’s self-timed, so the chicken keeper can control what time the door will open and close
every day.
7
➢ Disadvantages of the system.
Although an automatic system has a lot of advantages to a chicken keeper, but it does not have
much advantages to the chickens. Hence, even a keeper will suffer from that consequences. The
following are the challenges of using automatic coop door with timer and photo sensors;
i. The door remains open all hours between sunrise and sunset hence no protection for the
chickens in the coop during open hours.
ii. The chicken keeper may mess up the opening and closing times, this is mainly related to
daylight savings time changes.
iii. One of the chickens may get trapped at the door, this may be the case for gravity-driven
doors.
iv. The door may close before all the chickens make it inside. This mean that the chickens that
don’t make it in time will be stuck outside all night in case the chicken keeper don’t notice.
v. The door does not select what animal to enter the coop, it allows all animals to enter even
predators. Hence, predators can harm the chicks and eat eggs inside the coop.
vi. Chickens like privacy, especially if they are laying eggs. But privacy is ignored with these
automatic doors since they remain open for the whole sun day.
The proposed system is an automatic chicken coop door with an addition of security which will
protect the chickens against predators in the coop. The system will prevent other organisms
(predators) such as snakes, dogs, cats and foxes to enter the coop through the door hence ensuring
safety of the chicken inside the coop. The door will open automatically to allow only chickens to
enter the coop, hence all chickens and their properties like chicks and eggs inside the coop will be
safe all the time. Different design of proposed system that were suggested are namely as follows;
➢ Automatic chicken coop door with security system by using infrared sensors.
➢ Automatic chicken coop door with security system by using RFID tags.
➢ Automatic chicken coop door with security system by using camera with machine learning.
8
2.3.1. Automatic chicken coop door with security system by using infrared sensors.
In this proposed design, the system will work with the aid of infrared sensors attached upper front
of the door. When the chicken approaches the door (get inside the range of sensitivity of the
sensor), PIR sensor will detect the heat radiated by the chicken and then sent signal to the control
circuit so as to open the door. The door will remain close when there is no any chicken inside the
range of sensitivity of the sensor.
This system will differentiate chickens from other animals (predators) by sensing specific
temperature of domestic birds including chickens which ranges between 40℃ − 42℃. All other
animals like snakes, dogs, cats, foxes etc. their temperature is below 40℃. So, the system will
allow the door to open if the detected radiated heat is between 40℃ − 42℃. Below or above that
temperature, the door will remain closed, hence predators cannot enter the coop because their body
temperature is below the required range of the sensor.
To implement this design seems to be somehow difficult due to the limitations of using sensors in
the design. The following are the limitations that hinder an implementation of the design;
i. It is difficult to measure internal body temperature of animals with their body covered with
feathers by PIR sensor. Most chickens body are full covered with feathers only small part
of their body are uncovered like legs and neck for some chicken species. So, this will be
difficult to reach the required temperature range, hence even chickens will be prevented to
enter the coop.
ii. Internal chicken body temperature may rise above or fall below 40℃ − 42℃ due to health
condition. Then all chickens with health problems will also be prevented to enter the coop
because temperature above or below the range will not activate the door to open.
iii. Internal body temperature of small chickens (a one-day-old chick) is approximately 39℃,
its temperature becomes the same as adult after five to seven days. So, before that days the
chicks will be prevented to use the door.
9
2.3.2. Automatic chicken coop door with security system by using RFID tags.
This design will involve the use of RFID tags in helping to open the door automatically. RFID will
be used to automatically identify and track tags attached to chickens. When chicken is near the
door, its tag will be identified by the system hence door will open to allow the chicken to enter the
coop. Predators without tags will not enter the coop door because will not be identified by the
system. The design is useful because can even track a lost chicken then it is easy to find a chicken
which did not return in the coop during night hours.
i. The installation is more expensive; the design needs each chicken to be attached with those
tags which is very expensive to people who keeps a lot of chickens.
ii. If it happens accidentally a tag removed in a chicken, that chicken will not be identified by
the system hence it will be prevented to enter the coop and left vulnerable to predators
during night hours.
iii. Sometimes not accurate and reliable.
2.3.3. Automatic chicken coop door with security system by using camera with machine
learning.
In this proposed design, a coop door will open and close automatically by the help of image
recognition. This design will allow the system to understand the image of chicken which was taken
in different angles as an input and a system algorithm will provide an output. Then, if the image
matches with the input, the door will open to allow the chicken in, otherwise the door will remain
closed. This will provide security to chickens in the coop all time since all predators will be
prevented to enter the coop.
10
➢ Block diagram of proposed system by using camera.
The proposed system by using camera with machine learning, its block diagram is presented in
figure 1.
KEY:
Mechanical transmission
Signal flow
11
➢ Advantages of proposed system by using camera.
i. Time saving to a chicken breeder; this system will save the time of a chicken keeper to
continue with other task at time when he/she supposed to be around at home for opening
and closing the coop door.
ii. High efficiency of operation; the system will operate with high efficient, since the chicken
image is unique does not resemble with other animals easily.
iii. The system will allow all types of chicken to enter the coop since different images of
chicken will be taken at different angles so as to recognize faster.
iv. The door will be closed until the chicken approaches the door then it will open to allow
chickens to enter and leave the door, this is beneficial to laying hens since they like privacy.
From the proposed systems discussed above considering their limitations in installation and
advantages, Automatic chicken coop door with security system by using camera with machine
learning seems to be the best solution for this project.
Is an image sensor integrated with a lens, control electronics and an interface like CSI, ethernet or
plain raw low voltage differential signaling. In this project camera module with image sensor will
be utilized so as to capture images for image processing and recognition by machine learning.
There are different types of camera module but only one module will be used in this project. The
selection of module will be done after the discussion of few camera module as follows;
12
➢ ESP32-CAM module.
The ESP32-CAM is a full-featured microcontroller that also has an integrated video camera and
microSD card socket. It’s inexpensive and easy to use, and is perfect for IoT devices requiring a
camera with advanced functions like image tracking and recognition.
The ESP32-CAM module has fewer I/O pins than the previous ESP-32 module. Many of the GPIO
pins are used internally for the camera and the microSD card port. Figure 2(a) shows a picture of
ESP32-CAM module. The ESP32-CAM is based upon the ESP32-S module, so it shares the same
specifications. It has the following features:
▪ 802.11b/g/n Wi-Fi
▪ Bluetooth 4.2 with BLE
▪ UART, SPI, I2C and PWM interfaces
▪ Clock speed up to 160 MHz
▪ Computing power up to 600 DMIPS
▪ 520 KB SRAM plus 4 MB PSRAM
▪ Supports Wi-Fi Image Upload
▪ Multiple Sleep modes
▪ Firmware Over the Air (FOTA) upgrades possible
▪ 9 GPIO ports
▪ Built-in Flash LED
The ESP32-CAM includes an OV2640 camera module. (Workshop, 2020)
13
(a) (b) (c)
The CMOS OV7670 camera module and OV2640 have different specifications as presented in the
table 1 below.
Table 1: Specifications of OV2640 vs OV7670. (Tessie, 2021)
Key specifications OV2640 OV7670
Array size 1600 × 1200 (UXGA) 640 × 480 (VGA)
Power supply Core: 1.3𝑉 𝐷𝐶 ± 5% Core: 1.8𝑉 𝐷𝐶 ± 10%
Analog: 2.5~3.0𝑉 𝐷𝐶 Analog: 2.45~3.0𝑉 𝐷𝐶
I/O: 1.7V to 3.3V I/O: 1.7V to 3.0V
Power consumption Free running: 125mW Free running: 60mW
Standby: 600𝜇𝐴 Standby: < 20𝜇𝐴
Image sensor format Type 1/4" Type 1/6"
Maximum image transfer rate 1600 × 1200@15fps VGA@30fps
SVGA@30fps, CIF@60fps
Sensitivity 0.6V/Lux-sec 1.3V/Lux-sec
Signal/noise ratio 40dB 46dB
Dynamic range 50dB 52dB
Pixel size 2.2𝜇𝑚 × 2.2𝜇𝑚 3.6𝜇𝑚 × 3.6𝜇𝑚
Dark current 15 mV/s at 60℃. 12 mV/s at 60℃.
Output format YUV/RGB/Raw RGB YUV/RGB/GRB/Raw RGB
Data/MJPEG Data
Shutter type Rolling shutter Rolling shutter
14
Picking of camera module was done by considering the features of ESP32-CAM module and table
1 which offers an overview on the key specifications of CMOS OV7670 and OV2640 camera
modules. Based on initial studies of the system model, ESP32-CAM module was chosen, as it
believed to be the right one for the use, particularly because;
2.4.2. DC motors.
Many motion control applications (automatic door control for this case) use permanent magnet DC
motors. Since it is easier to implement control systems using DC motors compared to AC motors.
They are often used when speed, torque or position needs to be controlled. There are two types of
commonly used DC motors; Brushed motors and Brushless motors. Consider the table 2 below
which illustrates the characteristics of brushed DC and brushless DC motors.
Table 2: Characteristics of brushed DC and brushless DC motors. (Millett)
Brushed DC motors Brushless DC motors
Physical feature Have brushes Have no brushes
Life time Short (brushes wear out) Long (no brushes to wear)
Speed and acceleration Medium High
Efficiency Medium High
Maintenance requirements Higher Lower
Electrical noise Noisy (bush arcing) Quiet
Acoustic noise and torque Poor Medium (trapezoidal) or good
ripple (sine)
Cost Lowest Medium (added electronics)
15
Due to declining costs and better performance, brushless motors are gaining in popularity in many
applications due to their characteristics as discussed above.
For automatic door applications, different type of motors are normally used examples BLDC servo
motors, stepper motors and others.
➢ Servo motors.
Servo motor is a rotary actuator or linear actuator that allows for precise control of angular or
linear position, velocity and acceleration. Servo motor as presented in picture of figure 3(b) is a
closed loop servomechanism that uses position feedback to control its motion and final position.
➢ Stepper motors.
A stepper motor also known as step motor or stepping motor, is a brushless DC electric motor that
divides a full rotation into a number of equal steps. The motor’s position can be commanded to
move and hold at one of these steps without any position sensor for feedback (an open-loop
controller), as long as the motor is correctly sized to the application in respect to torque and speed.
A picture of NEMA 17 stepper motor is shown in figure 3(a).
(a) (b)
Figure 3: Brushless DC motors (a) NEMA 17 stepper motor (b) Servo motor.
16
Table 3 below shows the specifications of servo and stepper motors.
Table 3: Specifications of servo and stepper motor.
From the initial field of study of this project, the designed system requires feedback in the control
system of motors to ensure that the motor has reached the required position or not. Referencing
from the comparison of servo and stepper motors, it was determined that servo motors seems to be
the best motors for this project, because;
17
2.4.3. Microcontroller.
Also, a computational device needed to have crucial I/O ports such as a port for the camera
connection, ports for motor connection. Those ports needed for the implementation of camera to
provide a live feed of the door view and motors to operate the lock and the door itself, the
computing device needed to be able to operate all the hardware that make these functionalities
possible.
After determining the requirements for the computational device, few products from popular
providers such as Raspberry Pi and Arduino were taken into consideration.
➢ Raspberry Pi 3.
Is a series of small single-board computers developed in the United Kingdom typically used by
computer and electronic hobbyists, due to its adoption of HDMI and USB devices. The picture of
raspberry Pi 3 is shown in figure 4.
Figure 4: Raspberry Pi 3
18
Specifications for the latest product in the Raspberry Pi 3 range as follows;
➢ Arduino boards.
Arduino is an open source electronics platform based on easy to use hardware and software.
Arduino boards are able to read inputs light on sensor, a finger on a button, or a Twitter message
and turn it into an output activating a motor, turning on a LED, publishing something online. There
are many types of Arduino boards, in this paper Arduino Uno and Arduino Nano were taken into
consideration.
19
(a) (b)
Figure 5: ATmega328P Arduino boards (a) Arduino Uno (b) Arduino Nano.
The technical specifications of ATmega328P discussed above are elaborated in table 4 as well as
a comparison between Raspberry Pi 3 and Arduino boards are presented in table 5. So, to help in
deciding what computational device to use in this project by consideration of requirements of the
system.
20
Table 5: A comparison between Raspberry Pi and Arduino board. (Ibro, Wong, & Zyla, 2019)
From the comparison of the features offered from the Raspberry Pi and the Arduino boards, it was
determined that the Raspberry Pi, unlike the Arduino, is more suitable for projects that involve
several functionalities at the same time. On one hand, the Arduino fits better in projects that require
easy reads from sensors and have to do operations based on the data, while being able to
communicate easily with a variety of motors or machine parts. However, this board does require
extensions in the form of shields, to expand on features that are required to accomplish this project.
Therefore, the Raspberry Pi was the most suitable board for this system.
2.4.4. Sensor.
A sensor is a device, module, machine, or subsystem that detects events or changes in its
environment and sends information to other electronics, frequently a computer processor. To
automate the operation of the door lock system a motion sensor is required. The sensor is
used to detect any activity that will be happening in front of the door, like a chicken approaching
it. Therefore, the sensor required has to be able to detect presence or movements within a
reasonable controlled area. The detection range needs to be limited to prevent the system from
21
being triggered by background activity. In this paper, two motion sensors i.e. Ultrasonic sensor
and IR sensor were taken into consideration.
➢ IR Sensor.
Active infrared sensor is one kind of electronic component, used to detect specific characteristics
in its surroundings through emitting or detecting IR radiation. IR sensors act as proximity sensors
and they are commonly used in obstacle detection systems such as in robots. Figure 6(b) shows a
picture of IR Sensor.
➢ Ultrasonic Sensor.
An ultrasonic sensor is generally used to measure the distance of an object using sound waves.
The sensor consists of a transmitter and receiver pair. The distance can be measured by taking
into account the elapsed time between the sound wave being generated and the sound wave
bouncing back to the receiver. Picture of ultrasonic sensor is shown in Figure 6(a).
(a) (b)
Figure 6: Sensors (a) Ultrasonic sensor (b) IR sensor.
22
Table 6 provides a side by side comparison between the Ultrasonic and PIR sensors.
Type Ultrasonic IR
Supply voltage 5V DC 5V DC
Range 2-400 cm 20 cm
Supply current 8mA 20mA
Type of info Time that can be converted to HIGH, LOW
distance
By comparing the characteristics of each sensor type it was determined that the IR sensor is more
suitable for this product because of its higher accuracy in the types of environment it will be
exposed to, as well as the ability of emitting or detecting IR radiations.
23
CHAPTER THREE.
In this chapter, initial design of the project will be discussed. The discussion will involve listing
of devices that will be used in this project after a detailed review of main components as discussed
in chapter two. The flow chart of the system (working flow) and analysis of overall cost for the
project will be discussed too.
After requirements gathering, there is the hardware design phase. In this step, the selected devices
are assembled accordingly. The hardware system consists of the following components as selected
in section 2.4 of chapter two.
i. ESP32-CAM module.
ii. IR sensor
iii. Raspberry Pi 3
iv. Servo motor
ESP32-CAM module.
Vision part is essential in this project so as to help in identification of kind of animals to be allowed
to pass the door (chickens for this case). The system is enabled by employing a camera module
which is ESP32-CAM module. This module will help to capture image of object near the door.
Features and specifications of this module were explained clearly in section 2.4.1.
IR sensor.
This project requires a device which will be added to prevent camera to capture images all the
time, hence image capturing will be activated after detecting presence of an obstacle near the door.
Hence, an infrared sensor with specifications as explained in table 6 will be employed in this
design. Also, IR sensor is added to prevent chicken from being trapped by the door before they
leave the passage.
24
Raspberry Pi 3.
For the purposes of this systems, a computational device which is stronger and quicker processor,
multitasking is required. The Raspberry Pi 3 was on-board logical unit of choice, as explained in
detail in section 2.4.3 which provides its features and specifications. The Raspberry Pi 3 in this
project is responsible for the below functionalities;
i. Control the servo motor via commands coming from the database.
ii. Check the IR sensor for movement and using the camera to snap a picture of the object
which is at the door, whenever one is detected.
iii. Send the picture to the database and receive response: if a positive one, control the servo
motor to unlock and open the door.
Servo motor.
The implementation of such a door lock system involved some mechanical engineering in order to
make the door adaptable for chickens and to offer the feature of fully opening and closing the door
via commands from the database, or just by approaching, i.e. hands free. In order to achieve this
functionality, a servo motor is required. More details for servo motor are elaborated in section
2.4.2 and its specifications are presented in table 3.
Users (chickens for this case) will be allowed to pass the door by just approaching the door. When
a user is within a certain radius, an IR sensor detects them, and activates the camera. The Raspberry
Pi attached to the door and is responsible for controlling a servo motor, a camera then sends an
image of the user at the door to the database. Then, image recognition is taking place in an image
recognition library, which compares each image sent by the Raspberry Pi with images already
uploaded in the database. If the image recognition algorithm identifies an image, it automatically
sends a positive response to the Raspberry Pi, which in turn activates the servo motor and opens
the door. But, if the image recognition algorithm found an image that do not match, it automatically
sends a negative response to the Raspberry Pi, which ends the processing and the servo motor
remain still as well as door remain closed. Figure 7 shows components diagram of the proposed
system which illustrates the working of the system.
25
Figure 7: Components diagram for proposed system.
The proposed innovative door control system is mainly based on chicken detection and intension
analysis. The first part involves image capturing of the detected object by IR sensor at the door,
while the latter includes image processing and recognition by machine learning. Figure 8 shows
the flow chart of the operating procedure for the opening and closing the door.
26
Figure 8: Flow chart of proposed system.
27
CONCLUSION.
In this report, preliminary design of automatic chicken coop door with security system against
predators was successfully done. This includes selection of best security system from those that
were proposed which will protect chickens effectively in their coop against predators. Also, in
preliminary design of proposed system, decision on choosing the appropriate devices for the
system was discussed in detail, hence initiating to come up with a good technical design of the
system in future work.
28
REFERENCES.
[1] Ibro, A., Wong, A., & Zyla, M. (2019, April 28). Digital WPI. Retrieved January 30, 2022,
from digital.wpi.edu.
[2] Inks, K. (2012, June 05). Design, construction and evaluation of an automated chicken coop
door. Retrieved November 17, 2021, from digitalcommons.calpoly.edu.
[3] Lwin, H. H., Khaing, A. S., & Tun, H. M. (2015, June). Automatic Door Access System Using
Face Recognition. International Journal of Scientific and Technology Research, Volume
4(Issue 06). Retrieved February 31, 2022, from www.ijstr.org
[4] Millett, P. (n.d.). Journal Artical. Brushless Vs Brushed DC Motors. Retrieved January 26,
2022, from https://www.monolithicpower.com/en/brushless-vs-brushed-dc-motors
[5] Shrestha, M., Kumar, S., Shrestha, S., & Pandit, V. (2012, October). Automatic Door Control
System. A Minor Project Report. Retrieved January 31, 2022, from
https://www.slideshare.net
[6] Tessie. (2021, November 05). Utmel Electronic. Retrieved January 28, 2022, from
www.utmel.com.
[7] Workshop, D. (2020, May 24). Build your own electronics. Getting started with the ESP32-
CAM. Retrieved January 22, 2022, from https://dronebotworkshop.com/esp32-cam-intro/
29
APPENDICES.
Appendix A: Time schedule.
Table 7: Time schedule for the project for semester I.
30
Appendix B: Cost estimation.
Table 8: Cost estimation.
31