Download The aim of this project is to demonstrate a smart

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Amplifier wikipedia , lookup

Radio transmitter design wikipedia , lookup

Multimeter wikipedia , lookup

Integrating ADC wikipedia , lookup

Power dividers and directional couplers wikipedia , lookup

Microcontroller wikipedia , lookup

Ohm's law wikipedia , lookup

Electrical ballast wikipedia , lookup

Valve audio amplifier technical specification wikipedia , lookup

CMOS wikipedia , lookup

Valve RF amplifier wikipedia , lookup

TRIAC wikipedia , lookup

Operational amplifier wikipedia , lookup

Current source wikipedia , lookup

Schmitt trigger wikipedia , lookup

Transistor–transistor logic wikipedia , lookup

Two-port network wikipedia , lookup

Power electronics wikipedia , lookup

Voltage regulator wikipedia , lookup

Power MOSFET wikipedia , lookup

Surge protector wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Charlieplexing wikipedia , lookup

Current mirror wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Rectiverter wikipedia , lookup

Opto-isolator wikipedia , lookup

Transcript
Industrial batch counter
CHAPTER ONE
INTRODUCTION
The industrial batch counter is an electronic and electrical device that handles the
counting and controls the flow of individuals using an automated slide door that allows
access only when the administrator permits. The technique involved in the design is a
simple sensor unit that opens and closes the door when someone obstructs the light
path. These parameters can be used to determine when someone has moved in or out of
the conference hall (for instance). The light sensing type involves monitoring the unit
with photon or optical devices; this consists of the encoder (transmission path or the
source of energy) and the decoder (receiver unit that converts the light intensity to
electrical signal). An LED emitter, combined with a photo detector (Light Dependent
Resistor, photo transistor or infrared sensing diode) in proximity, form a very useful
object called opto-coupler or opto-isolator. When the opto coupler is obstructed, the
door opens and the display shows an increase or decrease of individuals in the room
(depending on the path followed). This project report creates a greater picture of the
industrial batch counter.
1.1
THE AIM AND OBJECTIVES OF THE PROJECT
1
Industrial batch counter
The aim of this project is to demonstrate a smart device that counts the number of people
inside a conference hall; and prevents people from entering once the room has reached
its capacity.
1.2
JUSTIFICATION OF THE PROJECT
The need for counting the number of persons inside the conference hall is for statistical
record, which will help the conference hall management take a proper account of people;
and as well, control the conference hall capacity from being over populated.
1.3
THE SCOPE OF THE PROJECT
This project covers the features of the capacity monitor, the hardware description, the
use of transistor-transistor logic and microcontroller, how the system works and its
applications.
1.4 THE PROJECT REPORT ORGANIZATION
This project report is organized into five chapters. The first chapter covers the
introduction, aim scope and justification of the project. The second chapter talks about
the technology behind the project, the description of the microcontroller, as well as the
working principle of the project. Chapter three covers the methodology of the project.
Chapter four discusses the designing and construction of the project, as well as other
components used in designing this project. Chapter four also talks about the testing of
the individual components and packaging of the project. And lastly, chapter five
summarizes and concludes the project.
2
Industrial batch counter
CHAPTER TWO
LITERATURE REVIEW
The industrial batch counter was designed with respect to enhance transparency in the
accounting of number of intakes in a conference hall, and as well, reduce the risk of over
populating it with people that could lead to collapsing of the structure or death resulting
from overcrowding and poor ventilation. The major factor here is human safety and
health hazard that might arise due to overcrowding. Another is accountability-with the
introduction of this, the number of persons that enter into the building for a specified
activity can be taken count of electronically so fraud can be reduced, since the device can
automatically take count of the intake.
The concept behind the design is quite simple obeying so principle of light since. A
transducer will be used as the light source and the light converter as well so that when
someone obstructs the light path, an action will be taken by the device which makes the
system a smart and intelligent device. The use of discrete transistor logic (or sevensegment display) helps the system to display a reasonable count and the careful
arrangement of the flip flop and up-down count helps in incrementing and decrementing
of the number of persons in the stadium. This chapter throws more light on the
technology used in designing the project, the programming language used, as well as the
working principle.
3
Industrial batch counter
2.1
TECHNOLOGY
The technology behind the industrial batch counter is the microcontroller. It is the
bedrock of the system. The microcontroller-a different kind of integrated circuit, is a
complete computer on a chip, containing all of the elements of the basic microprocessor
along with other specialized functions.
Its functionality is based on the ability of the designer to arrange his instruction or
generate the code which will generate the machine language, which is the content of the
ROM (Read Only Memory) of the microcontroller.
2.1.1 FEATURES OF THE MICROCONTROLLER
• Compatible with MCS-51™ Products
• 4K Bytes of In-System Reprogrammable Flash Memory
 Endurance: 1,000 Write/Erase Cycles
• Fully Static Operation: 0 Hz to 24 MHz
• Three-level Program Memory Lock
• 128 x 8-bit Internal RAM
• 32 Programmable I/O Lines
• Two 16-bit Timer/Counters
• Six Interrupt Sources
• Programmable Serial Channel
• Low-power Idle and Power-down Modes
2.1.2 DESCRIPTION
4
Industrial batch counter
The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K
bytes of Flash erasable programmable read only memory (EPROM). The device is
manufactured using Atmel’s high-density nonvolatile memory technology and is
compatible with the industry-standard MCS-51 instruction set and pin-out. The on-chip
Flash allows the program memory to be reprogrammed in-system or by a conventional
nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a
monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a
highly-flexible and cost-effective solution to many embedded control applications.
In addition, the AT89C51 is designed with static logic for operating down to zero
frequency and supports two software selectable power saving modes. The Idle Mode
stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system
to continue functioning. The Power-down Mode saves the RAM contents but freezes the
oscillator, disabling all other chip functions until the next hardware reset.
2.1.3 PIN DESCRIPTION
VCC: Supply voltage.
GND: Ground.
Port 0: Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin
can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as
high impedance inputs. Port 0 may also be configured to be the multiplexed low order
address/data bus during accesses to external program and data memory. In this mode,
P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming,
and outputs the code bytes during program verification. External pull-ups are required
during program verification.
Port 1: It is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output
buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are
5
Industrial batch counter
pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that
are externally being pulled low will source current (IIL) because of the internal pull-ups.
Port 1 also receives the low-order address bytes during Flash programming and
verification.
Port 2: Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output
buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are
pulled high by the internal pull-ups and can be used as inputs. As inputs
Port 2 pins that are externally being pulled low will source current (IIL) because of the
internal pull-ups. Port 2 emits the high-order address byte during fetches from external
program memory and during accesses to external data memory that uses 16-bit
addresses (MOVX @DPTR). In this application, it uses strong internal pull-ups when
emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @
RI); Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the
high-order address bits and some control signals during Flash programming and
verification.
Port 3: this is an 8-bit bi-directional I/O port with internal pullups. The Port 3 output
buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are
pulled high by the internal pullups and can be used as inputs. As inputs, Port 3 pins that
are externally being pulled low will source current (IIL) because of the pullups. Port 3
also serves the functions of various special features of the AT89C51 as listed below:
Port 3 also receives some control signals for Flash programming and verification.
RST: Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device.
ALE/PROG: Address Latch Enable output pulse for latching the low byte of the address
during accesses to external memory. This pin is also the program pulse input (PROG)
during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6
the oscillator frequency, and may be used for external timing or clocking purposes. Note,
however, that one ALE pulse is skipped during each access to external Data Memory. If
6
Industrial batch counter
desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit
set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly
pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external
execution mode.
PSEN: Program Store Enable is the read strobe to external program memory. When the
AT89C51 is executing code from external program memory, PSEN is activated twice each
machine cycle, except that two PSEN activations are skipped during each access to
external data memory.
EA/VPP: External Access Enable. EA must be strapped to GND in order to enable the
device to fetch code from external program memory locations starting at 0000H up to
FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on
reset. EA should be strapped to VCC for internal program executions. This pin also
receives the 12-volt programming enable voltage (VPP) during Flash programming, for
parts that require12-volt VPP.
XTAL1: Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2: Output from the inverting oscillator amplifier.
Oscillator Characteristics: XTAL1 and XTAL2 are the input and output respectively, of
an inverting amplifier which can be configured for use as an on-chip oscillator, as shown
in Figure 1. Either a quartz crystal or ceramic resonator may be used. To drive the device
from an external clock source, XTAL2 should be left There are no requirements on the
duty cycle of the external clock signal, since the input to the internal clocking circuitry is
through a divide-by-two flip-flop, but minimum and maximum voltage high and low time
specifications must be observed.
Idle Mode: In idle mode, the CPU puts itself to sleep while all the on-chip
Peripherals remain active. The mode is invoked by software. The content of the on-chip
RAM and all the special functions registers remain unchanged during this mode. The idle
mode can be terminated by any enabled interrupt or by a hardware reset. It should be
7
Industrial batch counter
noted that when idle is terminated by a hard ware reset, the device normally resumes
program execution, from where it left off, up to two machine cycles before the internal
reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this
event, but access to the port pins is not inhibited. To eliminate the possibility of an
unexpected write to a port pin when Idle is terminated by reset, the instruction following
the one that invokes Idle should not be one that writes to a port pin or to external
memory. A diagram of the microcontroller is shown on APPENDIX C.
2.2 WORKING PRINCIPLE
A step-down transformer is used to step-down the power from the mains, and the
voltage was rectified from the 12v ac volt of the transformer using 4 diodes. A 1000µf
capacitor is used to smoothen the rippling (pulsating) dc volt and a voltage regulator
integrated circuit is used to regulate the unregulated 12 volts to a +5v; the voltage
required to power the microcontroller. The system has two seven-segment displays
(output of the monitor), which displays count. With their base resistors respectively,
these are independently selected by the microcontroller and applies the required voltage
when it is biased; since the output power dissipation of the microcontroller is not
sufficient to drive the display unit directly. The microcontroller applies the bit pattern of
the numeric that is about to be displayed, then forward biases its transistor and reverse
biases the other. So that it allows one display at a time. This is repeated for the two
displays over and over. The switches are connected to the microcontroller port and
ground. When the switch is depressed, the port pin is pulled low. At run time, when the
system on tine equals the default or the preset value, the system asserts logic one (+5v)
to Rb (base resistor) which causes the NPN transistor to be forward biased; so current
will flow through the relay inductor. The circuit connected to the relay will be completed.
To explain further, when an individual obstructs the light path (which consists of the
light emitting diode and the light dependent resistor); the light intensity is increased
there by causing the relay to open the door. Once the person enters the hall, the door
8
Industrial batch counter
closes and the display shows that the total number of people inside has increased by 1.
The same procedure is applied when someone leaves the room. But in this case, the
display show that the people in the room has reduced by 1. Once the room has reached
its capacity, the door closes and does not open for people entering until someone inside
leaves the room.
2.3
MAJOR COMPONENTS
Here, the major components of industrial batch counter are discussed. These
components include the power supply unit, the display unit, the opto coupler and the
relay module.
2.3.1 POWERS SUPPLY UNIT
The system power supply consists of few components such as:
 The transformer which steps down the main voltage as well as isolates the system
from risk of electric shock.
 The input (primary) winding of the transformer use to connect to supply source.
 The output Power (secondary) is tied up to the rectifier.
 A diode rectifying circuit is connected directly on the transformer secondary to rectify
the AC voltage to a pulsating DC voltage.
 The filter circuit that smoothens the pulsating DC to a normal DC. It makes use of an
electrolytic capacitor and finally,
 A voltage regulator (78x05) used to convert the DC output to a regulated +5vDC.
2.3.2
THE DISPLAY UNIT
9
Industrial batch counter
The display unit has two multiplexed seven-segment display (output of the system or the
monitor), which displays the number of persons inside the conference hall with their
respective switching transistors each having a base resistors respectively. These are
independently selected by the microcontroller, the controller applied the require biasing
voltage to the base of the transistor in accordance with the code arrangement during
programming; since the output power dissipation of the microcontroller is not sufficient
to drive the display unit directly so transistors were incorporated. The microcontroller
applies the bit pattern (the numeric) from the register that holds the bit pattern about to
display multiplexed port control then forward bias the transistor for the particular
display and reverse bias the other, so that only one display at time, this is repeated for
the other displays and the process is repeated over and over.
2.3.3
THE OPTOCOUPLER
The opto-coupler is the combination of an LED that provide light to light dependent
resistor (LDR) in series with a pull-up resistor, the voltage across the LDR is used in
biasing an inverter with its pull-up resistor, the output of the inverter is tied to pin1 of
the interfacing buffer. When the light path is not obstructed, the LDR resistance drops;
invariably causing the base emitter voltage (Vbe) to drop and the collector emitter
voltage (Vce) to increase. But once the light path is obstructed, LDR resistance increases.
2.3.4
THE RELAY MODULE
Relays are electromagnetic devices in the sense that when voltage is applied across its
inductor, it becomes a temporal magnet. When this occurs, the mechanical contact switch
drifts from a normally closed position to the normally open position looping the electric
circuit. When the applied voltage is removed it loses it magnetic properties. The relays
10
Industrial batch counter
are used to drive the door actuator. The two relays are wired as a technical two way
control switch so that the dc motor can be driven in either direction ( i.e. the Relay Single
Pole Double Throw (SPDT ) switch has their poles tied to the terminals of the motor and
are normally at close contact to ground the normally close contact to +12v dc).
2.4
PROGRAMMING LANGUAGE
A programming language is any language consisting of sets of instructions designed to
instruct the hardware on how and when to act. There are hundreds of programming
languages each was develop to solve a particular problem. Most traditional languages
such as Basic, C, COBOL, FOTRAN, PL/I, AND PASCAL are procedural languages. That is,
the program sequence determines the exact sequence of operations. The software of this
project was designed using CRIMSON EDITOR C compiler and SDCC (small device C
compiler) which contains the header file of the Microcontroller (AT89C51). It used
virtual conventional C programming language keywords and syntax. The program
environment is where the code is written, compiled and debugged .It will generate an
Intel hex file (content of the system ROM) which is transferred into the microcontroller
via a computer interfaced programming device.
CHAPTER THREE
METHODOLOGY
This chapter discusses the methods or organizing principles underlying the design of the
batch counter. To achieve these steps, planning as well as other factors needs to be
11
Industrial batch counter
considered. These include information gathering, project analysis, and system design
approach.
3.1
INFORMATION GATHERING
Foremost approach to project designing and execution is to gather enough information in
order to help speed the operation once the actual work commences. Most of the
information used was obtained from the internet. Others were obtained from books.
3.2
PROJECT ANALYSIS
Analysis of the project was based on the information gathered; paperwork was done
(which involves sketching of the system-the power stage, the input stage, the control
stage and the output stage). A sequence of operations was maintained in order for the
design to be successful.
3.3
SYSTEM DESIGN APPROACH
The approach to a design is highly considered; else failure and incomplete project will be
its outcome. For this fact, a bottom-up approach was applied.
3.4
DETAIL OF THE DESIGN
The detail of the design involves the software and the hardware. The hardware is
discussed in the next chapter. The block diagram of the system is illustrated below.
POWER SUPPLY UNIT
12
Industrial batch counter
SENSOR
CONTROL UNIT
DISPLAY
UNIT
TRANSISTOR
SWITCH
RELAY CONTROL
UNIT
DOOR MECHANISM
Fig. 3.1 Hardware block diagram
CHAPTER FOUR
DESIGN AND CONSTRUCTION OF THE HARDWARE
The designing of the project was done as complying with the basic rules in electronic
designing and construction. The major components used had been described in the
previous chapter. Other components would be discussed in this chapter. The
construction is made in modules; starting from the power supply, and then sensing part,
the control part and the display unit. This chapter also talks about installing and testing
the individual components before packaging them.
13
Industrial batch counter
4.1
OTHER COMPONENTS
These are those other components not discussed in the previous chapter. It also talks
about the functions of these components and the role they play in the project design.
These components are described below.
4.1.1
TRANSFORMER
The transformer is a device used for reducing or increasing the voltage of an electric
power supply, usually to apply a particular piece of equipment to be used. Transformers
work only with AC and this is one of the reasons why mains electricity is AC. Step-up
transformers increase voltage, step-down transformers reduce voltage. Most power
supplies use step-down transformers to reduce the dangerously high mains voltage
(220V in Nigeria) to a safer low voltage. The input coil is called the primary and the
output coil is called the secondary. There is no electrical connection between the two
coils; instead they are linked by an alternating magnetic field created in the soft-iron core
of the transformer. The two lines in the middle of the circuit symbol represent the core.
Transformers waste very little power so the power out is (almost) equal to the power in.
Note that as voltage is stepped down current is stepped up.
The ratio of the number of turns on each coil, called the turn ratio determines the ratio of
the voltages. A step-down transformer has a large number of turns on its primary (input)
coil which is connected to the high voltage mains supply, and a small number of turns on
its secondary (output) coil to give a low output voltage. Turn ratio=Vp/Vs=Np/Ns and
power in=power in Vs*Is=Vp*Is, Vp = primary (input) voltage
Np = number of turns on primary, coil Ip = primary (input) current, Vs = secondary
(output) voltage, Ns = number of turns on secondary coils =) secondary (output) current.
14
Industrial batch counter
L2
L1
IRON C ORE
Figure 4.1: Symbol of a Transformer
4.1.2
DIODES
Figure 4.2: Diode and its circuit symbol
Diodes allow electricity to flow in only one direction. The arrow of the circuit symbol
shows the direction in which the current can flow. Diodes are the electrical version of a
valve and early diodes were actually called valves.
Electricity uses up a little energy pushing its way through the diode, rather like a person
pushing through a door with a spring. This means that there is a small voltage across a
conducting diode, it is called the forward voltage drop and is about 0.7V for all normal
15
Industrial batch counter
diodes which are made from silicon. The forward voltage drop of a diode is almost
constant whatever the current passing through the diode so they have a very steep
characteristic (current-voltage graph).
Ordinary diodes can be split into two types: Signal diodes which pass small currents of
100mA or less and Rectifier diodes which can pass large currents. In addition there are
LEDs (which have their own page) and Zener diodes .
Diodes must be connected the correct way round, the diagram may be labelled a, or (+)
for anode and k or (-) for cathode (yes, it really is k, not c, for cathode!). The cathode is
marked by a line painted on the body. Diodes are labelled with their code in small print;
you may need a magnifying glass to read this on small signal diodes! Small signal diodes
can be damaged by heat when soldering, but the risk is small unless you are using a
germanium diode (codes beginning OA...) in which case you should use a heat sink
clipped to the lead between the joint and the diode body. A standard crocodile clip can be
used as a heat sink. Rectifier diodes are quite robust and no special precautions are
needed for soldering them.
4.1.3
RECTIFIERS
There are several ways of connecting diodes to make a rectifier (convert AC to DC). The
bridge rectifier is the most important and it produces full-wave varying DC. A full-wave
rectifier can also be made from just two diodes if a centre-tap transformer is used, but
this method is rarely used now that diodes are cheaper. A single diode can be used as a
rectifier but it only uses the positive (+) parts of the AC wave to produce half-wave
varying DC. A bridge rectifier can be made using four individual diodes, but it is also
available in special packages containing the four diodes required. It is called a full-wave
rectifier because it uses the entire AC wave (both positive and negative sections). 1.4V is
used up in the bridge rectifier because each diode uses 0.7V when conducting and there
are always two diodes conducting, as shown in the diagram below. Bridge rectifiers are
16
Industrial batch counter
rated by the maximum current they can pass and the maximum reverse voltage they can
withstand.
Figure 4.3: Full Wave Rectifier (Bridge Rectifier) And Wave Form.
4.1.4
CAPACITORS (SMOOTHING)
A capacitor is a component used to store electrical charges temporarily, which consists of
two conducting surfaces separated by a non-conductor dielectric. Smoothing is
performed by a large value electrolytic capacitor connected across the DC supply to act
as a reservoir, supplying current to the output when the varying DC voltage from the
rectifier is falling. The diagram shows the unsmoothed varying DC (dotted line) and the
smoothed DC (solid line). The capacitor charges quickly near the peak of the varying DC,
and then discharges as it supplies current to the output.
Figure 4.5: Capacitor charging and discharging.
17
Industrial batch counter
4.1.5
SEVEN-SEGMENT DISPLAY
Seven segments was the name given to the segmented electronic display, which is made
of LED or LCD (liquid crystal) .The seven-segment display used in this project is the LED
type. It comes in various sizes but they are configured as common anode type or the
common cathode type. The common mean that their various anodes or cathodes are
connected together internally. Beneath is the figure illustrating the seven-segment
display.
A
F
B
Seven se gment d isplayer
G
Com mon anode
E
Comm on c athod e
C
D
A
B
C
D
E
F
G
A
B
C
D
E
F
G
Figure 4.6: seven segments and its internal configuration.
The multiplexing of the display is a method used in reducing the number of ports and
component to be used which is achieved by linking or connecting all common anode or
cathode depending on the one you might have choosing for your design.
The connection is linking all a segment together, all B segment to all G segment. This will
enable them to have a common bus where the seven segment data will be presented
during the period of display. This is illustrated at Figure below.
Co mmon anode
A
B
C
D
E
F
G
A
Com mon a node
B
C
D
E
F
G
A
Common anode
B
C
D
E
F
G
}
Bus
Multiplexed c om m om ano de seven segm ent disp lay
Figure 4.7: Multiplexing the Seven Segment Display.
4.1.6 TRANSISTORS
18
Industrial batch counter
A transistor is a small low-powered solid-state electronic device consisting of a
semiconductor and at least three electrodes, used as an amplifier and rectifier and
frequently incorporated into integrated circuit chips. Transistors can be distinguished by
their type:

pnp or npn

Germanium or silicon

Audio frequency or radio frequency

Switching or amplification

Low level or medium or power.
The first important point to remember is that you can replace npn with pnp type
because npn requires a positive collector voltage with respect to the base while a pnp
requires negative collector voltage with respect to the base(their biasing mode is rather
opposite).
Silicon transistor is preferred over the PnP type because they have small leakage current
than the germanium. The electrical symbols of the NPN and PnP is in the figure below
Base
PnP
Collector Base
Collector
Emitter
Emitter
NpN
Figure 4.8: Transistor switching
The transistor was used in the driving of the seven segment, LED and relay in my circuit
design; the major factor that I considered was the hfe of the transistor. This guided me in
choosing my base resistor; hfe=Ic/Ib where IC is the collector current, Ib base current
and hfe is the transistor gain. The data sheet of the transistor was provided and
distributed free on net so I considered their parameters for choosing the transistors that
I used.
19
Industrial batch counter
4.1.7 THE OPTO COUPLER
The opto coupler is simply a combination of a Light Dependent Resistor and a light
Emitting Diode. These two components work together as the sensor used in this project.
They are both discussed individually.
4.1.7.1 THE PHOTORESISTOR
Figure 4.9: The symbol for a photoresistor
Figure 4.10: A light dependent resistor
20
Industrial batch counter
A photoresistor or light dependent resistor is a resistor whose resistance decreases with
increasing incident light intensity. It can also be referenced as a photoconductor. A
photoresistor is made of a high resistance semiconductor. If light falling on the device is
of high enough frequency, photons absorbed by the semiconductor give bound electrons
enough energy to jump into the conduction band. The resulting free electron (and its hole
partner) conduct electricity, thereby lowering resistance. A photoelectric device can be
either intrinsic or extrinsic. An intrinsic semiconductor has its own charge carriers and is
not an efficient semiconductor, e.g. silicon. In intrinsic devices the only available
electrons are in the valence band, and hence the photon must have enough energy to
excite the electron across the entire bandgap. Extrinsic devices have impurities added,
also called dopants, whose ground state energy is closer to the conduction band; since
the electrons do not have as far to jump, lower energy photons (i.e. longer wavelengths
and lower frequencies) are sufficient to trigger the device. If a sample of silicon has some
of its atoms replaced by phosphorus atoms (impurities), there will be extra electrons
available for conduction. This is an example of an extrinsic semiconductor.
Photoresistors come in many different types. Inexpensive photoresistors can be found in
many consumer items such as camera light meters, street lights, clock radios, alarms, and
outdoor clocks.They are also used in some dynamic compressors together with a small
incandescent lamp or light emitting diode to control gain reduction. Lead sulfide (PbS)
and indium antimonide (InSb) LDRs (Light Dependent Resistor) are used for the mid
infrared spectral region.
4.1.7.2 THE LIGHT EMITTING DIODE (LED)
21
Industrial batch counter
Figure 4.11: LED and its circuit symbol
LEDs emit light when an electric current passes through them.
LEDs must be connected the correct way round, the diagram may be labelled a or + for
anode and k or - for cathode (yes, it really is k, not c, for cathode!). The cathode is the
short lead and there may be a slight flat on the body of round LEDs. If you can see inside
the LED the cathode is the larger electrode (but this is not an official identification
method). LEDs can be damaged by heat when soldering, but the risk is small unless you
are very slow. No special precautions are needed for soldering most LEDs.
An LED must have a resistor connected in series to limit the current through the LED;
otherwise it will burn out almost instantly.
The resistor value, R is given
By: R = (VS - VL) / I), Vs = supply voltage VL = LED voltage (usually 2V, but 4V for blue and
white LEDs) I = LED current (e.g. 20mA), this must be less than the maximum permitted
current.
Figure 4.12: choosing Led Resistor value
If the calculated value is not available choose the nearest standard resistor value which is
greater, so that the current will be a little less than you chose. In fact you may wish to
22
Industrial batch counter
choose a greater resistor value to reduce the current (to increase battery life for
example) but this will make the LED less bright.
4.1.8
RESISTORS
Figure 4.13: Resistor and its circuit symbol
Resistors restrict the flow of electric current, for example a resistor is placed in series
with a light-emitting diode (LED) to limit the current passing through the LED. Resistors
may be connected either way round. They are not damaged by heat when soldering.
Resistance is measured in ohms; the symbol for ohm is an omega.
1 is quite small so resistor values are often given in k and M.
1 k = 1000 1 M = 1000000.
Each colour represents a number as shown in the table.
Black Brown Red orange Yellow Green
Blue violet Grey white
0
6
1
Tolerance
2
Brown
Percentage  1
3
4
5
7
red
Gold
Silver
no colour
2
5
10
20
8
9
Table 1: Colour codes and tolerance
Most resistors have 4 bands:
23
Industrial batch counter

The first band gives the first digit.

The second band gives the second digit.

The third band indicates the number of zeros.

The fourth band is used to shows the tolerance (precision) of the resistor, this may be
ignored for almost all circuits.
1st band
2nd band
3rd band
4th band
Figure 4.14: Resistor with coloured bands.
This resistor has red (2), violet (7), yellow (4 zeros) and gold bands.
So its value is 270000 = 270 k. On circuit diagrams this is usually omitted and the value is
written 70K. Small value resistors (less than 10 ohm)
The standard colour code cannot show values of less than 10. To show these small values
two special colours are used for the third band: gold which means × 0.1 and silver which
means × 0.01. The first and second bands represent the digits as normal. For example:
red, violet, gold bands represent 27 × 0.1 = 2.7 green, blue, silver bands represent
56 × 0.01 = 0.56
24
Industrial batch counter
The tolerance of a resistor is shown by the fourth band of the colour code. Tolerance is
the precision of the resistor and it is given as a percentage. For example a 390 resistor
with a tolerance of ±10% will have a value within 10% of 390, between 390 - 39 = 351
and 390 + 39 = 429 (39 is 10% of 390). A special colour code is used for the fourth band
tolerance: silver ±10%, gold ±5%, red ±2%, brown ±1%. If no fourth band is shown
the tolerance is ±20%.
Tolerance may be ignored for almost all circuits because precise resistor values are
rarely required.
4.1.9
RELAY
Relay is an electromechanical device with solenoid and mechanical switch. The solenoid
is an electromagnetic device when voltage is applied to its inductor it become an
electromagnet (temporal magnet), when the applied voltage is remove it loses its
magnetic properties (Induction will occur). To prevent this inductive kick back, a diode is
connected across the inductive load if it is operating in a dc power system. The switch
used in this project has a normally-open and a normally-close contact switches which is
called a single pole double throw switch, which is the mechanical part. Below is circuit
symbol of a relay.
Re la y
L
1
Figure 4.15: circuit symbol of a relay.
25
Industrial batch counter
4.1.10
VOLTAGE REGULATOR
The voltage regulator is a device used in smoothening and reducing the rectified voltage to a
voltage suitable for the circuit. They are different types of regulators; and these are used for
various circuits. Examples of voltage regulators include the 7805, 7806, 7809, etc. For this
project, the 7805 model is used.
Figure 4.16: Voltage Regulator Pinout and Wiring
The 78xx, 78Mxx, and 78Sxx regulators all have the pin-out shown in the left of figure 1
and are normally supplied in a case style known as TO-220. The 78Lxx series, shown in
the right of figure 1 of 3.16, also has the same pin-out but has a case style known as TO92. They are all connected to the rest of the power supply in the same way, as shown in
figure 2 of 3.16.
4.2
TESTING
Test can be defined as a trial run-through of a process to find if t works. With this
definition, we can define testing as the series of trial run-throughs of a process to find if it
works. Physical examination and testing of component is the first test performed before
developing the unit system that makes up the actual one; a project work must undergo
series of test before the project will be satisfied okay in production chain, a satisfactory
26
Industrial batch counter
label often written Q.C passed is tagged to a finished product. In small system designs
testing process is also applicable. These are the sequence of test needed to undergo for
any successful project work.
 Testing of the individual components.
 Unit by unit testing.
 System testing.
4.2.1
TESTING OF THE INDIVIDUAL COMPONENTS.
Components should be tested individually before fiddling with it so as to remove the bad
ones .This test will be a satisfied test measures for individual components which are
basically done by using of the millimeter (e.g. testing of transistor, diodes, LEDs, LDR and
seven-segment display, and every other component that will be used in the project.
4.2.2
UNIT BY UNIT TESTING.
These involve wiring up of circuitry and testing and satisfying its functions before
soldering. Examples are bread boarding of power supply stage of the project, testing it
and confirming that is functional before soldering.
4.2.3
SYSTEM TESTING.
Involves the testing of the entire circuitry and cross examine it for errors like short
circuits, lead flux joining unwanted links ,proper insertion IC pin layout and also
checking if ICs of these pin number but different function are slotted in their proper base.
After this check cross examine once again before powering the system.
4.3
PACKAGING
27
Industrial batch counter
Packaging is done after the system testing. Every good product is often determined by its
packaging. Credit is awarded to a properly packaged project. After the integrating and
final testing of the project, choice of packaging would be considered. Factors to consider
include cost, as well durability and elegance. A metallic casing was used to house the
project. Before the construction of this package, the size of the project and maintenance
factor which need may arise was also considered. There are some other medium for
packing the project like plastic package. This would have been a better option, but due to
cost of production. Wood was another option. It is relatively cheaper. But the beauty of
the project was put into consideration thus, the choice of metallic casing.
28
Industrial batch counter
CHAPTER FIVE
CONCLUSION AND RECOMMENDATION
This is the last chapter of the project. This chapter summarizes the entire project, and also
provides suggestions that could be applied to the capacity monitor in order to make the device
better.
5.1
CONCLUSION
Overcrowding often leads to the collapse of structures and sometimes death. This project is
designed to help control the overcrowding of a hall. This can be achieved when the system
stops opening the door whenever the count equals the set number (i.e. the door stops opening
once the hall has reached its capacity; and can only open once people have left the hall). This
kind of gadget can be modified and used in stadiums and other public circuit places such as
auditoriums, cinemas, airports, as well as banks in order to reduce overcrowding.
5.2
SUGGESTION FOR FURTHER IMPROVEMENT
Although this project (if implemented) could be described as “state-of-the-art”, there are
certain areas that need to be improved. These areas include:

Using a radio frequency proximity sensor to replace of the optical sensor.

High precision mechanized door.

Attaching metallic scanners to the doors.
29
Industrial batch counter

Hall management should always appoint people to door post in order to avoid
“circumvention techniques”.
5.3
RECOMMENDATIONS
Technology is the strength of a nation. It has gradually become a part of everyday life; for this
fact, its growth in a nation should not be neglected. Technology can be improved in Nigeria by
the following ways: The standard of projects should be raised.
 More practical laboratories should be built in order to expose the students.
 Functional libraries should be built.
 Government should invest in research.
 Exhibitions are to be conducted by schools-both private owned and government owned
to make it competitive.
 Enough time should be mapped out for practical classes.
 Internet facilities should be provided for easy and faster resrarch.
BIBLIOGRAPHY
30
Industrial batch counter
BOOKS
Hornby, A.S and S. Wehmeier (2000) OXFORD Advanced Learner’s Dictionary of current
English 5th Edition; London: Oxford University Press.
Horowitz, P. and H. Winfield (1989) The Art Of Electronics 2nd Edition; Houston: Prentice
Hall Ltd.
Lafferty, J. (1977) Practical Digital Design; New York: John Wiley & sons
Schuler, A.C (1999) Electronics (Principles and Applications) 5th Edition; New York:
Glencoe/Mc-Graw-Hill Publishers.
Tokheim, R.L. (2002) Digital Electronics (Principles and Applications) 3th Edition;
Illinois: Richard .D. Irwin &Sons.
Wray, W. and Greenfield J.B. (1998) Using Microprocessor and Microcomputers; New
Jersey: Prentice Hall Ltd.
WEBSITES
www.about.com
www.alldatasheet.com
www.amazon.com
www.ask.com
www.google.com
www.howstuffswork.com
www.wikipedia.org
APPENDIX B: CIRCUIT DIAGRAM
31
Industrial batch counter
74
D1
T1
U1
LM7805CT
D3
76
LINE
TS_AUDIO_10_TO_1
+5V
VREG
VOLTAGE
C6
1000uF-POL COMMON
1N4001GP
1N4001GP
D2
D4
C3
30pF
1N4001GP
1N4001GP
75
0
85
R5
1.0k
R6
1.0k
Q6
40
89
R4
1.0k Q2
69
LED1
88
31
Q7
R7
21
1.0k
R8
1
2
90
3
87
9
86
BJT_NPN_VIRTUAL
BJT_NPN_VIRTUAL
83
84
22
4
1.0k
R3
1.0k BJT_NPN_VIRTUAL
CA
CA
91
U2
AT89C51
R12
1.0k
98
R2
1.0k Q5
LED2
J4
R11
0
1.0k BJT_NPN_VIRTUAL
Key = Space
99
1N4001GP
77
39
38
37
36
35
34
33
100
97
18
19
12v
A B C D E FG
T2
D5
78
79
80
81
82
+5v
101
J1
105
n
Q3
103
R15
IRON_CORE_INDUCTOR
Key = Space
1.0k
l
M
R13
1.0k
A B C D E FG
U3
0
12
92
13
J2
C2
30pF
0
Key = Space
X1
0
J3
106
BJT_NPN_VIRTUAL
1N4001GP
95
T3
D6
20
C1
30pF HC-49/U_1.5MHz
96
R1
93
S1
MOTOR
12v
Q1
J13
104
102
n
94
IRON_CORE_INDUCTOR
Key = Space
1.0k
0
Key = Space
0
BJT_NPN_VIRTUAL
APPENDIX C
DIAGRAM OF THE MICROCONTROLLER
32
Industrial batch counter
33