Professional Documents
Culture Documents
INDEX NO:
INSTITUTECODE:
COURSE CODE:
SUPERVISOR
1
DECLARATION
I declare that this project is my own which I did with the help of my supervisor and skills
obtained from my study.
Sign:....................................................Date:...................................................
SUPERVISOR’S DECLARATION
This project has been presented with my approval as the Rift valley technical training institute
supervisor to the Kenya National Examination Council.
Name:
Sign:....................................................Date :..........................................................
ACKNOWLEDGEMENT
I would like to thank the almighty God for enabling me to reach this far in my academics. I thank
my supervisor for his technical advice that he has given to make this project functional. T also
thank the college for providing me with materials of study and for my research work in the
library. T greatly give thanks to my father for his financial and frequent advice towards success of
this project.
This project is dedicated to my lovely parents who supported and encouraged me through
my entire life in the institute.
Contents
DECLARATION...............................................................................................................1
SUPERVISOR’S DECLARATION...............................................................................1
ACKNOWLEDGEMENT................................................................................................2
DEDICATION...................................................................................................................3
Abstract..............................................................................................................................5
CHAPTER ONE................................................................................................................6
1.0 Introduction.............................................................................................................6
Background of the Study.............................................................................................6
CHAPTER 2:.....................................................................................................................8
THEORETICAL BACKGROUND.............................................................................8
Research.........................................................................................................................8
Infrared motion detector..............................................................................................9
2.2.2.1 Discrete Component Based Design.............................................................15
Disadvantages:..............................................................................................................15
2.2.2.2 COMPUTER BASED DESIGN.................................................................15
2.2.23 MICROCONTROLER BASED DESIGN.........................................................16
Advantages of microcontroller based design................................................................16
CHAPTER 3:...................................................................................................................19
SYSTEM DESIGN......................................................................................................19
Working Process..........................................................................................................19
Hardware Implementation and Results:...................................................................20
Components Required:..............................................................................................21
Fig 4. Pin diagram of LM358........................................................................................21
Fig 5. Pin diagram of LM358........................................................................................22
CHAPTER FOUR...........................................................................................................25
RESULTS AND ANALYSIS......................................................................................25
TEST AND RESULT...............................................................................................25
123456789 10.................................................................................................................26
Fig 4.1: Line chart of reliability/ functionality of the designed system............................26
DICUSSION OF RESULTS.......................................................................................26
BILL OF ENGINEERING MEASUREMENT AND EVALUATION....................26
CHAPTER FIVE.............................................................................................................29
Conclusion....................................................................................................................29
References....................................................................................................................30
Abstract
This project deal with the design and construction of a smart farm system using PIR sensor and
motor. This system is designed to keep birds, hens and other animals like rodents away from your
small garden. The presence of wireless technology in the world today has improved the capability
and functions of security. Nobody could complain about the wireless capability because the
elimination of wires and complicated set up procedures make these devices easy to control and
customize. The smart garden system is an alerting systems that usually involves ir sensors and a
buzzer to give the feedback, i.e. to scare off the birds whenever they move past or close to the ir
transmitter and receiver. This is a handy setup because once there is an obstruction on the ir, it
transmits a signal to the buzzer, and later triggers the motor to rotate hence scaring of birds and
rodents. The buzzer emits a sound, to indicate that there is an intruder in the garden. This
technology innovation has made it possible to maintain a garden without physically being there.
Damage to crops by birds is an enormous challenge in Africa. As birds migrate across the country,
they often find suitable food sources in farm crops. The birds will nest nearby in great numbers and
take advantage of the localized plentiful supply.
The destruction of these flock may not be allowed depending On a particular country, so the
farmers need to find a way of either keeping them from landing on the crops or moving them on
further down their migration routes. The economic impact from the destroyed crops can be as high
as 50% revenue loss. Birds feeding on crops reduce harvest yield and therefore impact the supply
chain and food security which in turn affects livelihoods.
Currently, the birds are scared away through manual labor which is inefficient and not sustainable
solutions should not be based on the destruction of birds and it is therefore necessary to prevent
from landing on the crops and move them further along their migration routes without feeding on
farm produce.
Back in the days, there as and there still is the use of scarecrows that goes back 3000years.they are
used to scare away birds and other wildlife from poaching crops and seeds in smaller plots and
gardens and for one thing birds are smart enough not to be fooled by this human figure that doesn’t
move or talk.
Infrared technology is a new way to battle this menace and save our crops from damage. It is
effective managing bird population on a variety of orchards, vineyards and field crops. The
infrared system is accompanied by revolving motors and reflective clothing mounted on them and
a disturbing noise from the buzzers which in turn work together to keep birds a bay.
1.6. Contribution
Our solution is a proof of concept for a scalable and affordable system. Our smart garden fence system is
low power and may be connected to a modular system. A gateway consisting of a Raspberry Pi Zero W and
an XBee will be able to connect any device a user desires by using Node-RED.
CHAPTER 2:
THEORETICAL BACKGROUND
Research
An infrared sensor is an electronic device that emits in order to sense some aspects of the
surroundings. An IR sensor can measure the heat of an object as well as detects the motion. These
types of sensors measure only infrared radiation, rather than emitting it that is called a passive IR
sensor. Usually, in the infrared spectrum, all the objects radiate some form of thermal radiation.
Infrared Sensor
These types of radiations are invisible to our eyes, which can be detected by an infrared sensor.
The emitter is simply an IR LED (Light Emitting Diode) and the detector is simply an IR
photodiode that is sensitive to IR light of the same wavelength as that emitted by the IR LED.
When IR light falls on the photodiode, the resistances and the output voltages will change in
proportion to the magnitude of the IR light received.
MICROCONTROLLER
A microcontroller (also MCU or pC) is a small computer on a single integrated circuit consisting of a
relatively simple CPU combined with support functions such as a crystal oscillator, timers, and watchdog,
serial and analog I/O etc. Program memory in the form of NOR flash or OTP ROM is also often included
on chip, as well as a, typically small, read/write memory.
Thus, in contrast to the microprocessors used in personal computers and other high performance
applications, simplicity is emphasized. Some microcontrollers may operate at clock frequencies as low as
32 KHz, as this is adequate for many typical applications, enabling low power consumption (millwatts or
microwatts). They will generally have the ability to retain functionality while waiting for an event such as a
button press or other interrupt; power consumption while sleeping (CPU clock and most peripherals off)
may be just nanowatts, making many of them well suited for long lasting battery applications.
Microcontrollers are used in automatically controlled products and devices, such as automobile engine
control systems, remote controls, office machines, appliances, power tools, and toys. By reducing the size
and cost compared to a design that uses a separate microprocessor, memory, and input/output devices,
microcontrollers make it economical to digitally control even more devices and processes
Analog to Digital Converter
An analog-to-digital converter (abbreviated ADC, A/D or A to D) is a device which converts continuous
signals to discrete digital numbers. The reverse operation is performed by a digital-to-analog converter
(DAC).
Typically, an ADC is an electronic device that converts an input analog voltage (or current) to a digital
number. However, some non-electronic or only partially electronic devices, such as rotary encoders, can
also be considered ADCs. The digital output may use different coding schemes, such as binary, Gray code
or two's complement binary
TRANSDUCERS
This section deals with the various possible sensor designs and how they function and which could be
appropriate for particular case.
All objects emit what is known as black body radiation. It is usually infrared radiation that is invisible to the
human eye but can be detected by electronic devices designed for such a purpose. The term passive in this
instance means that the PIR device does not emit an infrared beam but merely passively accepts incoming
infrared radiation. In passive infrared motion detectors, a sensor containing an infrared-sensitive
phototransistor is placed in the area to be protected. Circuitry within the sensor detects the infrared radiation
emitted by the intruder's body and triggers the alarm. The problem with using this type of detector is that it
can be falsely triggered by warm air movement or other disturbances that can alter the infrared radiation
levels in an area. In order to prevent this problem, newer systems use two infrared sensors which monitor
different zones within a protected area. Logic within system triggers the alarm only when the two zones are
activated in sequence, as would occur if a person walked through the protected area.
• Pyroelectric Sensors
The pyro electric sensor is made of a crystalline material that generates a surface electric charge when
exposed to heat in the form of infrared radiation. When the amount of radiation striking the crystal changes,
the amount of charge also changes and can then be measured with a sensitive FET device built into the
sensor. The sensor elements are sensitive to radiation over a wide range so a fdter window is added to the
TO5 package to limit detectable radiation to the 8 to 14mm range which is most sensitive to human body
radiation.
Typically, the FET source terminal pin 2 connects through a pull down resistor of about 100 K to ground
and feeds into a two stage amplifier having signal conditioning circuits. The amplifier is typically
bandwidth limited to below 10Hz to reject high frequency noise and is followed by a window comparator
that responds to both the positive and negative transitions of the sensor output signal. A well filtered power
source of from 3 to 15 volts should be connected to the FET drain terminal pin 1.
TYPICAL CONFIGURATION
FRESNEL LENS
\
THERMAL ENERGY
Figure 1.1
The PIR325 sensor has two sensing elements connected in a voltage bucking configuration. This
arrangement cancels signals caused by vibration, temperature changes and sunlight. A body passing in front
of the sensor will activate first one and then the other element whereas other sources will affect both
elements simultaneously and be cancelled. The radiation source must pass across the sensor in a horizontal
direction when sensor pins 1 and 2 are on a horizontal plane so that the elements are sequentially exposed to
the TR source. A focusing device is usually used in front of the sensor.
infrared source movement
Figure 2.2
Figure 2.5
Figure 2 shows the operation of an active infrared motion detector. In the active system each sensor consists
of two housings. One housing contains an infrared-emitting diode and an infrared-sensitive phototransistor.
The other housing contains an infrared reflector. When positioned in front of an entrance to a protected
area, the two housings establish an invisible beam. A person entering the area interrupts the beam causing
an alarm to be triggered. An active motion detector is much more reliable than a passive one, but it requires
careful alignment when it is installed. The detector can be falsely triggered if one of the housings moves
slightly and causes a discontinuous beam.
Figure 2.6
Features
• Continuously variable gain for beam control and side lobe suppression
Benefits
• Very low cost sonar ranger
• Very low power ranger, excellent for multiple sensor or battery based systems
Beam Characteristics
Object detection requires high sensitivity, yet a narrow beam angle requires low sensitivity. The
LV-MaxSonarO-EZIO balances the detection of people with a narrow beam width. Sample results for
measured beam patterns are shown below on a 12-inch grid. The detection
(A) 0.25-inch diameter dowel, note the narrow beam for close small objects,
(B) 1-inch diameter dowel; note the long narrow detection pattern,
(C) 3.25-inch diameter rod, note the long controlled detection pattern,
(D) 11-inch wide board moved left to right with the board parallel to the front sensor face and the
sensor stationary. This shows the sensor’s range capability.
Note: The displayed beam width of (D) is a function of the secular nature of sonar and the shape of the
board (i.e. flat mirror like) and should never be confused with actual sensor beam width.
VARIOUS APPROACH.
In order to design this project the main decision I need to make is what approach I will take for the main
alarm processing. In this chapter discussion of these designs dealt with and the reason why one design was
chosen.
2.2.2.1 Discrete Component Based Design
This is one of the earliest forms of design which involve discrete components to build the digital systems.
Disadvantages:
These systems includes the use of digital gates such as NAND, AND, NOR gates etc. such as
74yy series.
• AND, OR gates
• Delay circuits that can be implemented using flip-flop, 555 timer ICS.
Generally if these project where to be implemented using this way it would be quite bulky
expensive and very hard to trouble shoot it in case of failure.
Computers are very powerful device that can implement the control unit with minimum components .the
only important part is the interface between the sensors, switches, alarm and buzzer to the computer .This
can be done through the lpt printer port (parallel port) which has eight pins and five input pins. To get more
pin one can add another input card or include a microcontroller to communicate with the computer serially.
By writing software to manipulate the voltage at these pins one is able to scan the conditions of the sensor
and perform the appropriate action .However to interface the circuit to computer one as to be careful as the
parallel port only accept up to a maximum of 5volts.while things like relay switches ear usually
accompanied by the transient which are be harmful to the printer port. These demands use of optiosolator to
electrically separate the computer from the external circuits
• The computer has to be continuously, this means the need for dedicated computer
which is uneconomical
• Due to constant power losses there is need to include power backups which and the
cost.
Circumstances that we find ourselves in today are in the field of microcontrollers which had their
beginnings in the development of technology of integrated circuits. This development has made it possible
to store hundreds of thousands of transistors in to one chip. That was a perquisite for production of
microprocessors, and the first computers were made by adding external peripheral such as memory, input -
output lines timers and other .further increasing of the volume of the package resulted in creation of
integrated circuits .these integrated circuits contained both processor and peripherals. That is how the first
chip containing a microcomputer, or what would later be known as microcontroller came about.
Microcontroller differs from microprocessor in many ways. First and fore most important is its
functionality. in order for a microprocessor to be used other components such as memory, or components
for receiving and sending data must be added to it .in short that means that microprocessor is very heat of
computer in other hand microcontroller is designed to be all of that in one. No other external component are
needed for its application because all necessary peripherals are already built into it, thus we save the time
and space needed to construct devices.
in this project microcontroller will form the heart of the system. This would perform the function of polling
sensors interpreting input and perform the necessary action. This is so because using instead of using
intelligent sensor s that would be reporting to central unit the project will utilize dump sensors.
Most microcontrollers come with several ports than several bit wide for example in this case the Atmegal68
from Atmel Company has two 8bit ports and one 7bit port. These ports can be connected to the various
sensors whose high condition are 5.5volts and low are 1.8 volts.
• Can be produced in small packages that users can be able to configure on their own
- Active Mode: 250 PA at 1 MHz, 1.8V15 PA at 32 kHz, 1.8V (including Oscillator) -Power-
down Mode: O.lpAat 1.8V
• They are easy to debug in case of fault as they consist of very few copheriperial components.
• They are easy to upgrade due to compatibility of AVR microcontrollers of differed series for
example the code written for ATmega48 can be run in ATmega88 with minor modification.
Thus they are easy to learn and develop software having in mind the need to shorten development time and
reduce time to market. This is very important aspect in modern world.
High Endurance Non-volatile Memory segments
Thus reduce cost of field up grades since the cost of upgrading a system code can be dramatically reduced,
with very little effort and planning, flash based system can be designed to have code upgrades in the field
for AT mega FLASH device the entire code can be rewritten with new code new code segments and
parameter tables can be easily added in program memory areas left blank for upgrade purpose, only portion
of code (such as key algorithm) require update. • Calibration and customization of your system
Calibration need not be done only in factory .during installation of the system can be calibrated to actual
operating environment. In fact recalibration can be easily done during periodic servicing and maintenance.
Customization need not to be done in factory only. In many situations customizing a product at installation
time is very useful, .a good example is a home or car security systems where ID code, access code and
other such information can be burned in after the actual configuration is determined. Add unique Id code to
your system during manufacturing. Many products require a unique ID number or a serial number. An
example application would be remote keyless entry device. Each transmitter has a unique “binary key” that
makes it very easy to program in the access code at the very end of the manufacturing process and prior to
final test. Serial number, revision code, date code, manufacture ID and a variety of other useful information
can also be added to any product for traceability
CHAPTER 3:
SYSTEM DESIGN
Working Process
Initially, due to the voltage divider, half of the supply voltage is there on pins 2 and 6 because
we are using a voltage divider with an equal value of resistors and thus the output of the IC is OFF.
When the motion is detected by the sensor, the capacitor starts to draw current through the resistor
R3 to charge, and thus the voltage drop across the resistor changes which in turn makes the voltage
at pin 2 go below the 1/3 of supply voltage mark. This turns the output of the IC ON. Now the
capacitor is fully charged to the supply voltage through the 100kΩ resistor. When the motion is
detected, again pin 6 of the timer IC detects the charged capacitor which obviously is at the supply
voltage and thus goes more than the 2/3 mark. This turns the output of the IC OFF. If you observe
the circuit a little close, you can see that we can use a BJT instead of relay and you are correct but
unfortunately this will not work. The reason is again the difference between the ideal and the real
world. We use BJTs everywhere but they are not perfect switches and have some leakage current
which in this case messes up with the circuit. We need an ideal switch in this case and thus we are
using a relay. The transistors are used to drive the relays. We are using a PNP transistor to drive the
main relay because the IR sensor module gives a constant supply voltage at its output and when it
detects something, it pulls the voltage to the ground. We can use an NPN transistor to drive the
output relay as the IC has active high output.
Circuit diagram
Infrared comes in the place of the electromagnetic spectrum which is not visible to naked eyes. All
the hot objects generate these IR radiations and by detecting these radiations, we can sense the
motion. The PIR sensor does not emit any IR radiation but only detects the radiations and thus it is
called “passive”. On the other hand, we have IR modules that send an IR pulse continuously and
when it bounces back from an object, the module can detect it by using a photodiode. This
photodiode in this case can only detect Infrared light and not visible light.
Two main components of an IR sensor module are IR LED and photodiode. LED looks exactly like
a normal LED but it emits IR instead of the visible colors that we are familiar with. Photodiode is
the key component that detects the bounced back radiations.
In this project, we are using an active IR sensor module as it is readily available, affordable, and
easy to use.
when any object is brought nearer to the IR LED, Photo-Diode pair, the amount of IR rays from IR LED
which reflects and falls on the IR photodiode increases and therefore voltage at the resistor increases. When
any object approaches the IR proximity sensor, the voltage at photodiode increases and at some point the
voltage at non-inverting input becomes more than inverting input, which causes Op-Amp to turn on the
LED which in turn triggers the dc motor ON.
Components Required:
In this project the components used to develop this touch less doorbells circuit are named below:
• LM 358
• IR SENSOR
• LED
• 3v dc motor
• Pcb
• IN 4001 diode
• 9v dc battery
• Connecting wires
LM 358:
The LM358 is a low power dual operational amplifier integrated circuit originally introduced by National
Semiconductor. It is used in detector circuits. The abbreviation LM358 indicates an 8-pin integrated circuit,
comprising two operational amplifiers at low power. The LM358 is designed for general use as amplifiers,
high-pass filters, low band pass filters, and analog adders.
1OUT 1
11N- 2 7
1IN+ 3 6
GND 4 5
V
CC
2OUT
2IN-
2IN+
Fig 4. Pin diagram of LM358
The LM358 IC is a great, low power and easy to use dual channel op-amp IC. It is designed and
introduced by national semiconductor. It consists of two internally frequency compensated, high gain, Op-
amps. This IC is designed for specially to operate from a single power supply over a wide range of voltages.
The LM358 IC is available in a chip sized package and applications of this op amp include conventional op-
amp circuits,
DC gain blocks and transducer amplifiers. LM358 IC is a good, standard operational amplifier and it is
suitable for your needs. It can handle 3-32V DC supply & source up to 20mA per channel. This op-amp is
apt, if you want to operate two separate op-amps for a single power supply. It’s available in an 8-pin DIP
package
Features of LM358 IC
• Range of wide power supplies includes single and dual power supplies.
• The power supply voltage and differential i/p voltages are similar □ Output voltage swing is large.
OUTPUTB
INVERTING INPUT B
NON INVERTING
INHIT 8
Fig 5. Pin diagram of LM358
• Pin-1 and pin-8 are output of the comparator
• Pin-8 is VCC+
IR Sensor:
Infrared technology addresses a wide variety of wireless applications. The main areas are sensing and
remote controls. In the electromagnetic spectrum, the infrared portion is divided into three regions: near
infrared region, mid infrared region and far infrared region. The wavelengths of these regions and their
applications are shown below.
LED:
A light-emitting diode (LED) is a semiconductor light source that emits light when current flows through it.
Electrons in the semiconductor recombine with electron holes, releasing energy in the form of photons. This
effect is called electroluminescence. The color of the light (corresponding to the energy of the photons) is
determined by the energy required for electrons to cross the band gap of the semiconductor. White light is
obtained by using multiple semiconductors or a layer of light-emitting phosphor on the semiconductor
device.
Fig 6. LED
Appearing as practical electronic components in 1962, the earliest LEDs emitted low- intensity
infrared light. Infrared LEDs are used in remote-control circuits, such as those used with a wide variety of
consumer electronics. The first visible-light LEDs were of low intensity and limited to red. Modern LEDs
are available across the visible, ultraviolet, and infrared wavelengths, with high light output.
DC MOTOR:
A DC motor is any of a class of rotary electrical machines that converts direct current electrical
energy into mechanical energy. The most common types rely on the forces produced by magnetic fields.
Nearly all types of DC motors have some internal mechanism, either electromechanical or electronic, to
periodically change the direction of current flow in part of the motor.
Fig 7 dc motor
CHAPTER FOUR
RESULTS AND ANALYSIS
TEST AND RESULT
The reliability and functionality tests of this device was carried out to know how reliable the system is.
Though there is a delay in both the time taken to open and time taken to close to be able to work efficiently
and prevent the effect of torque on the motor and the device at large. The test was carried out for 10 days
and these results were gotten as shown in the table below:
TABLE OF TEST RESULTS
Table 4.1: Test results
DAYS TIME OPEN TIME CLOSE
(SECS) (SECS)
4.57
1 2.06
4.78 2.19
2
3 3.54 2.14
4 3.5
2.1
5 4.28 2.38
3.36 2.43
6
7 4.83 2.48
4.13 2.71
8
9 4 2.67
5.27 2.78
10
LINE CHART OF RELIABILITY/FUNCTIONALITY OF THE DESIGNED
SYSTEM
123456789 10
DAYS
PCB
1 1 100 100
LED
2 1 50 50
3 IR reciever 1 100 100
4 Ir transmitter
1 100 100
5 5 V voltage regulator 1 100 100
6 Capacitors 2 30 60
7 1C Socket 1 50 50
9 Resistors 5 20 100
13 diode 3 50 150
18 Screw 12 5 60
22 Pcb 100
24 Total 9910
CHAPTER FIVE
Conclusion
Technology advancements have made our lives much easier. New innovated products are launched every
day and affect our daily lives. One of the products that must be mentioned is a smart garden fence. In the
earlier days, one had to struggle with ways of keeping birds away from your garden by physically chasing
them away and use of scarecrows. However, today with the help of the smart garden fence, one does not get
to struggle with monitoring his / her garden regularly, at ones comfort your work is simply done by the help
of the smart garden fence.
References
[1] A. Zaidi and E. Zolyomi, “Active Ageing: What differential experiences across EU countries” in
European Papers on the New Welfare, 2012.
[2] World Health Organization, “Active ageing: A policy framework A contribution of the world health
organization to the Second United Nations world assembly on ageing,” in World Health Organization,
2002.
[3] C. Gorden and J. Buchanan, “A systematic literature review of doorstep crime: Are the crime
prevention strategies more harmful than the crime?” Howard J. Crim. Justice, vol. 52, no. 5, pp.
498-515, 2013.
[4] S. Lister and D. S. Wall, “Deconstructing distraction burglary: an ageist offence?” in Ageing and
Society, 2006, pp. 107-123.
[6] Sky bell, “Skybell.com,” 2016. [Online]. Available: http://www.skybell.com/. [Accessed: 18Feb-2016].
[7] T-Bell, “i-bell.co.uk,” 2016. [Online]. Available: http://www.i-bell.co.uk/. [Accessed: 18- Feb2016]