Professional Documents
Culture Documents
Infrared Interruption Counter PDF
Infrared Interruption Counter PDF
Contact us:
+91-120-4298000
+91-9212314779
info@hbeonlabs.com
training@hbeonlabs.com
www. hbeonlabs.com
CHAPTER 1 INTRODUCTION & COMPONENTS
INTRODUCTION
“Automatic bidirectional visitor counter
for controlling room light using 8051
microcontroller (AT89S52)”
A counter that can change its state in either direction, under control of an
up–down selector input, is known as an up–down counter. The circuit
given here can count numbers from 0 to 9999 in up and down modes
depending upon the state of the selector. It can be used to count the
number of persons entering a hall in the up mode at entrance gate. In the
down mode, it can count the number of persons leaving the hall by
decrementing the count at exit gate. It can also be used at gates of parking
areas and other public places.
This circuit divided in three parts: sensor, controller and counter display.
controller which would run the counter in up/down mode depending upon
1. 8051 Microcontroller
2. ULN2003
3. LCD .
4.LM358
5.Relay
6.IR TRANSMITTER-RECEVER
APPLICATIONS
Telecom
• Mobile phone systems (handsets and base stations), modems, routers
• Automotive application
• Braking system, Traction control, Airbag release system, Management units,
and Steer-by-wire systems.
Domestic application
• Dishwasher, television, washing machines, microwave ovens, Video
recorders, Security system, Garage door controllers, Calculators, Digital
watches, VCRs, Digital cameras, Remote Controls, Treadmills
Robotic
• Fire fighting robot, Automatic floor cleaner, robotic arm
Aerospace application
• Flight control system, Engine controllers, Autopilots, Passenger entertainment
system
Medical equipment
• Anesthesia monitoring system, ECG monitors, Pacemakers, Drug delivery
systems, MRI scanners
Defense system
• Radar systems, Fighter aircraft flight control system, Radio system, Missile
guidance systems
Office automation
• Laser printers, Fax machines, Pagers, Cash registers, Gas pumps, Credit /Debit
card readers, Thermostats, Grain analyzers.
COMPONENTS
Regulator 7805 1 U1
Regulator 7812 1 U3
Capacitor 1000µf 1 C1
Capacitor 10µf 1 C2
40 Pin Base 1 U2
16 Pin Base 1 U5
8 Pin Base 1 U4
8051 AT89S52 1 U2
ULN2003 1 U5
LM358 1` U4
LED 2 D5,D6
Resistance 1k 1 R3
Resistance 10k 1 R2
Transformer 12-0-12 1
PCB Design 1
NOTE:- Please use only above mentioned component code to make your Project.
Other components are extra in layout design which you can use to make others
projects.
COMPONENT DESCRIPTION
1)MICRO-CONTROLLER 8051 DESCRIPTION
The IC 8051 is a low-power; high-performance CMOS 8-bit microcomputer with 4K
bytes of Flash programmable and erasable read only memory (PEROM). 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 IC 8051 is a powerful microcomputer
which provides a highly-flexible and cost-effective solution to many embedded
control applications. The IC 8051 provides the following standard features: 4K bytes
of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, a five vector
two-level interrupt architecture, full duplex serial port, on-chip oscillator and clock
circuitry. In addition, the IC 8051 is designed with static logic for operation 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.
INSTRUCTIONS
Instructions in a computer are binary numbers just like data. Different numbers, when
read and executed by a processor, cause different things to happen. The instructions
are also called opcodes or machine codes.
Different bit patterns activate or deactivate different parts of the processing core.
Every processor has its own instruction set varying in number, bit pattern and
functionality.
PROGRAM
The sequence of instructions is what constitutes a program. The sequence of
instructions may be altered to suit the application.
ASSEMBLY LANGUAGE
Writing and understanding such programs in binary or hexadecimal form is very
difficult ,so each instructions is given a symbolic notation in English language called
as mnemonics. A program written in mnemonics Form is called an assembly language
program. But it must be converted into machine language for execution by processor.
ASSEMBLER
An assembly language program should be converted to machine language for
execution by processor. Special software called ASSEMBLER converts a program
written in mnemonics to its equivalent machine opcodes.
RST (Pin 9)
RESET pin
1.Active high. On applying a high pulse to this pin, microcontroller will reset and
terminate all activities.
2.INPUT pin
3.Minimum 2 machine cycles required to make RESET
4.Value of registers after RESET
External Access: EA 31
•Connected to VCC for on chip ROM
•Connected to Ground for external ROM containing the code Input Pin
Program Store Enable: PSEN 29
•Output Pin
•In case of external ROM with code it is connected to the OE pin of the ROM
Address Latch Enable: ALE 30
• Output Pin. Active high
•In case of external ROM ,ALE is used to de multiplex (PORT 0) the address and data
bus by connecting to the G pin of 74LS373 chip
I/O Port Pins and their Functions:
•Four ports P0,P1,P2,P3 with 8 pins each, making a total of 32 input/output pins
•On RESET all ports are configured as output. They need to be programmed to make
them function as inputs
PORT 0
•Pins 32-39
•Can be used as both Input or Output
•External pull up resistors of 10K need to be connected
•Dual role: 8051 multiplexes address and data through port 0 to save pins .AD0-AD7
•ALE is used to de multiplex data and address bus
PORT 1
•Pins 1 through 8
•Both input or output
•No dual function
•Internal pull up registers
•On RESET configured as output
PORT 2
•Pins 21 through 28
•No external pull up resistor required
•Both input or output
•Dual Function: Along with Port 0 used to provide the 16-Bit address for external
memory. It provides higher address A8-A16
PORT 3
•Pins 10 through 17
•No external pull up resistors required
PROCESSOR
ARCHITECTURE
Block Diagram
External interrupts
On-chip Timer/Counter
CPU
Bus Serial
4 I/O Ports
OSC Control Port
P0 P1 P2 P3 TxD RxD
Address/Data
Figure No. 1.3: Block Diagram of Microcontroller
ALU
The Arithmetic Logic Unit (ALU) performs the internal arithmetic manipulation of
data line processor. The instructions read and executed by the processor decide the
operations performed by the ALU and also control the flow of data between registers
and ALU. Operations performed by the
ALU are Addition , Subtraction , Not , AND , NAND , OR , NOR , XOR , Shift
Left/Right , Rotate Left/right , Compare etc. Some ALU supports Multiplication and
Division. Operands are generally transferred from two registers or from one register
and memory location to ALU data inputs. The result of the operation is the placed
back into a given destination register or memory location from ALU output.
REGISTERS
Registers are the internal storage for the processor. The number of registers varies
significantly between processor architectures.
•WORKING REGISTERS
Temporary storage during ALU Operations and data transfers.
•INDEX REGISTERS
Points to memory addresses.
•STATUS REGISTERS
Stores the current status of various flags denoting conditions resulting from various
operations.
•CONTROL REGISTERS
Contains configuration bits that affect processor operation and the operating modes
of various internal subsystems.
Memory Organization
Program Memory
Data Memory
The right half of the internal and external data memory spaces available on Atmel’s
Flash microcontrollers. Hardware configuration for accessing up to 2K bytes of
external RAM. In this case, the CPU executes from internal Flash. Port 0 serves as a
multiplexed address/data bus to the RAM, and 3 lines of Port 2 are used to page the
RAM. The CPU generates RD and WR signals as needed during external RAM
accesses. You can assign up to 64K bytes of external data memory. External data
memory addresses can be either 1 or 2 bytes wide. One-byte addresses are often used
in conjunction with one or more other I/O lines to page the RAM. Two-byte addresses
can also be used, in which case the high address byte is emitted at Port 2.
Internal data memory addresses are always 1 byte wide, which implies an address
space of only 256 bytes. However, the addressing modes for internal RAM can in fact
accommodate 384 bytes. Direct addresses higher than 7FH access one memory space,
and indirect addresses higher than 7FH access a different memory space. Thus, the
Upper 128 and SFR space occupying the same block of addresses, 80H through FFH,
although they are physically separate entities. The lowest 32 bytes are grouped into 4
banks of 8 registers. Program instructions call out these registers as R0 through R7.
Two bits in the Program Status Word (PSW) select which register bank is in use. This
architecture allows more efficient use of code space, since register instructions are
shorter than instructions that use direct addressing.
Programming Status Word:
Addressing Modes
The addressing modes in the Flash microcontroller instruction set are as follows.
Direct Addressing
In direct addressing, the operand is specified by an 8-bit address field in the instruction.
Only internal data RAM and SFRs can be directly addressed.
Indirect Addressing
In indirect addressing, the instruction specifies a register that contains the address of the
operand. Both internal and external RAM can be indirectly addressed. The address
register for 8-bit addresses can be either the Stack Pointer or R0 or R1 of the selected
register bank. The address register for 16-bit addresses can be only the 16-bit data pointer
register, DPTR.
Register Instructions
The register banks, which contain registers R0 through R7, can be accessed by
instructions whose opcodes carry a 3- bit register specification. Instructions that access
the registers this way make efficient use of code, since this mode eliminates an address
byte. When the instruction is executed, one of the eight registers in the selected bank is
accessed. One of four banks is selected at execution time by the two bank select bits in
the PSW.
Register-Specific Instructions
Some instructions are specific to a certain register. For example, some instructions
always operate on the Accumulator, so no address byte is needed to point to it. In these
cases, the opcode itself points to the correct register. Instructions that refer to the
Accumulator as A assemble as Accumulator-specific opcodes.
Indexed Addressing
Program memory can only be accessed via indexed addressing. This addressing mode is
intended for reading look-up tables in program memory. A 16-bit base register (either
DPTR or the Program Counter) points to the base of the table, and the Accumulator is set
up with the table entry number. The address of the table entry in program memory is
formed by adding the Accumulator data to the base pointer. Another type of indexed
addressing is used in the “case jump” instruction. In this case the dest ination address of a
jump instruction is computed as the sum of the base pointer and the Accumulator data.
•SRAM
Volatile, fast, low capacity, expensive, requires lesser external support circuitry.
•DRAM
Volatile, relatively slow, highest capacity needs continuous refreshing. Hence require
external circuitry.
•OTP ROM
One time programmable, used for shipping in final products.
•EPROM
Erasable programmable, UV Erasing, Used for system development and debugging.
•EEPROM
Electrically erasable and programmable, can be erased programmed in- circuit, Used for
storing system parameters.
•FLASH
Electrically programmable & erasable, large capacity, organized as sectors.
BUSES
A bus is a physical group of signal lines that have a related function. Buses allow for the
transfer of electrical signals between different parts of the processor
Processor buses are of three types:
•Data bus
•Address bus
•Control bus
CONTROLLER LOGIC
Processor brain decodes instructions and generate control signal for various sub units. It
has full control over the clock distribution unit of processor.
I/O Peripherals
The I/O devices are used by the processor to communicate with the external world
•Parallel Ports.
•Serial Ports.
•ADC/DAC.
a) Power Supply: For 12v power supply we can use 12 v step down transformer,
bridge rectifier, 12 v regulator.
b) Switch: Any general-purpose switch can be used. Switch is used as circuit breaker.
c) L.D.R: (Light Depending Resistance) it is a special type of resistance whose value
depends on the brightness of light, which is falling on it. It has resistance of about
1mega ohm when in total darkness, but a resistance of only about 5k ohms when
brightness illuminated. It responds to a large part of light spectrum.
d) L.E.D: A diode is a component that only allows electricity to flow one way. It can
be thought as a sort of one way street for electrons. Because of this characteristic,
dioded are used to transform or rectify AC voltage into a DC voltage. Diodes have
two connections, an anode and a cathode. The cathode is the end on the schematic
with the point of the triangle pointing towards a line. In other words, the triangle
points toward that cathode. The anode is, of course, the opposite end. Current flows
from the anode to the cathode. Light emitting diodes, or LEDs, differ from regular
diodes in that when a voltage is applied, they emit light.
This light can be red (most common), green, yellow, orange, blue (not very common),
or infa red. LEDs are used as indicators, transmitters, etc. Most likely, a LED will
never burn out like a regular lamp will and requires many times less current. Because
LEDs act like regular diodes and will form a short if connected between + and -, a
current limiting resistor is used to prevent that very thing. LEDs may or may not be
drawn with the circle surrounding them.
Common wattages for variable resistors are 1/8W, 1/4W, 1/2W and 1W. Anything of
a higher wattage is referred to as a rheostat.
f) P.C.B: (Printed Circuit Board) with the help of P.C.B it is easy to assemble circuit
with neat and clean end products. P.C.B is made of bakelite with surface pasted with
copper track-layout. For each components leg, hole is made. Connection pin is passed
through the hole and is soldered.
Description Of Components:
Power Supply
TRANSFORMER:
A transformer is a device that transfers electrical energy from one circuit to another
through inductively coupled conductors — the transformer's coils or "windings". Except
for air-core transformers, the conductors are commonly wound around a single iron-rich
core, or around separate but magnetically-coupled cores. A varying current in the first or
"primary" winding creates a varying magnetic field in the core (or cores) of the
transformer. This varying magnetic field induces a varying electromotive force (EMF) or
"voltage" in the "secondary" winding. This effect is called mutual induction.
If a load is connected to the secondary circuit, electric charge will flow in the secondary
winding of the transformer and transfer energy from the primary circuit to the load
connected in the secondary circuit.
The secondary induced voltage VS, of an ideal transformer, is scaled from the primary VP
by a factor equal to the ratio of the number of turns of wire in their respective windings:
Refer to the transformer circuit in figure as you read the following explanation: The
primary winding is connected to a 60-hertz ac voltage source. The magnetic field (flux)
builds up (expands) and collapses (contracts) about the primary winding. The expanding
and contracting magnetic field around the primary winding cuts the secondary winding
and induces an alternating voltage into the winding. This voltage causes alternating
current to flow through the load. The voltage may be stepped up or down depending on
the design of the primary and secondary windings.
Two coils of wire (called windings) are wound on some type of core material. In some
cases the coils of wire are wound on a cylindrical or rectangular cardboard form. In
effect, the core material is air and the transformer is called an AIR-CORE
TRANSFORMER. Transformers used at low frequencies, such as 60 hertz and 400 hertz,
require a core of low-reluctance magnetic material, usually iron. This type of transformer
is called an IRON-CORE TRANSFORMER. Most power transformers are of the iron-
core type. The principle parts of a transformer and their functions are:
• The CORE, which provides a path for the magnetic lines of flux.
• The PRIMARY WINDING, which receives energy from the ac source.
• The SECONDARY WINDING, which receives energy from the primary winding
and delivers it to the load.
• The ENCLOSURE, which protects the above components from dirt, moisture,
and mechanical damage.
BRIDGE RECTIFIER
A bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-wave
rectification. This is a widely used configuration, both with individual diodes wired as
shown and with single component bridges where the diode bridge is wired internally.
Basic operation
In the diagrams below, when the input connected to the left corner of the diamond is
positive, and the input connected to the right corner is negative, current flows from the
upper supply terminal to the right along the red (positive) path to the output, and returns
to the lower supply terminal via the blue (negative) path.
When the input connected to the left corner is negative, and the input connected to the
right corner is positive, current flows from the lower supply terminal to the right along
the red path to the output, and returns to the upper supply terminal via the blue path.
In each case, the upper right output remains positive and lower right output negative.
Since this is true whether the input is AC or DC, this circuit not only produces a DC
output from an AC input, it can also provide what is sometimes called "reverse polarity
protection". That is, it permits normal functioning of DC-powered equipment when
batteries have been installed backwards, or when the leads (wires) from a DC power
source have been reversed, and protects the equipment from potential damage caused by
reverse polarity.
Output smoothing
For many applications, especially with single phase AC where the full-wave bridge
serves to convert an AC input into a DC output, the addition of a capacitor may be
desired because the bridge alone supplies an output of fixed polarity but continuously
varying or "pulsating" magnitude (see diagram above).
The function of this capacitor, known as a reservoir capacitor (or smoothing capacitor) is
to lessen the variation in (or 'smooth') the rectified AC output voltage waveform from the
bridge. One explanation of 'smoothing' is that the capacitor provides a low impedance
path to the AC component of the output, reducing the AC voltage across, and AC current
through, the resistive load. In less technical terms, any drop in the output voltage and
current of the bridge tends to be canceled by loss of charge in the capacitor. This charge
flows out as additional current through the load. Thus the change of load current and
voltage is reduced relative to what would occur without the capacitor. Increases of
voltage correspondingly store excess charge in the capacitor, thus moderating the change
in output voltage / current.
The simplified circuit shown has a well-deserved reputation for being dangerous,
because, in some applications, the capacitor can retain a lethal charge after the AC power
source is removed. If supplying a dangerous voltage, a practical circuit should include a
reliable way to safely discharge the capacitor. If the normal load cannot be guaranteed to
perform this function, perhaps because it can be disconnected, the circuit should include a
bleeder resistor connected as close as practical across the capacitor. This resistor should
consume a current large enough to discharge the capacitor in a reasonable time, but small
enough to minimize unnecessary power waste.
Because a bleeder sets a minimum current drain, the regulation of the circuit, defined as
percentage voltage change from minimum to maximum load, is improved. However in
many cases the improvement is of insignificant magnitude.
The capacitor and the load resistance have a typical time constant τ = RC where C and R
are the capacitance and load resistance respectively. As long as the load resistor is large
enough so that this time constant is much longer than the time of one ripple cycle, the
above configuration will produce a smoothed DC voltage across the load.
In some designs, a series resistor at the load side of the capacitor is added. The smoothing
can then be improved by adding additional stages of capacitor–resistor pairs, often done
only for sub-supplies to critical high-gain circuits that tend to be sensitive to supply
voltage noise.
The idealized waveforms shown above are seen for both voltage and current when the
load on the bridge is resistive. When the load includes a smoothing capacitor, both the
voltage and the current waveforms will be greatly changed. While the voltage is
smoothed, as described above, current will flow through the bridge only during the time
when the input voltage is greater than the capacitor voltage. For example, if the load
draws an average current of n Amps, and the diodes conduct for 10% of the time, the
average diode current during conduction must be 10n Amps. This non-sinusoidal current
leads to harmonic distortion and a poor power factor in the AC supply.
In a practical circuit, when a capacitor is directly connected to the output of a bridge, the
bridge diodes must be sized to withstand the current surge that occurs when the power is
turned on at the peak of the AC voltage and the capacitor is fully discharged. Sometimes
a small series resistor is included before the capacitor to limit this current, though in most
applications the power supply transformer's resistance is already sufficient.
Output can also be smoothed using a choke and second capacitor. The choke tends to
keep the current (rather than the voltage) more constant. Due to the relatively high cost of
an effective choke compared to a resistor and capacitor this is not employed in modern
equipment.
Some early console radios created the speaker's constant field with the current from the
high voltage ("B +") power supply, which was then routed to the consuming circuits,
(permanent magnets were then too weak for good performance) to create the speaker's
constant magnetic field. The speaker field coil thus performed 2 jobs in one: it acted as a
choke, filtering the power supply, and it produced the magnetic field to operate the
speaker.
REGULATOR IC (78XX)
Normally we get fixed output by connecting the voltage regulator at the output of the
filtered DC (see in above diagram). It can also be used in circuits to get a low DC voltage
from a high DC voltage (for example we use 7805 to get 5V from 12V). There are two
types of voltage regulators 1. fixed voltage regulators (78xx, 79xx) 2. variable voltage
regulators (LM317) In fixed voltage regulators there is another classification 1. +ve
voltage regulators 2. -ve voltage regulators POSITIVE VOLTAGE REGULATORS This
include 78xx voltage regulators. The most commonly used ones are 7805 and 7812. 7805
gives fixed 5V DC voltage if input voltage is in (7.5V, 20V).
The simple capacitor filter is the most basic type of power supply filter. The application
of the simple capacitor filter is very limited. It is sometimes used on extremely high-
voltage, low-current power supplies for cathode ray and similar electron tubes, which
require very little load current from the supply. The capacitor filter is also used where the
power-supply ripple frequency is not critical; this frequency can be relatively high. The
capacitor (C1) shown in figure 4-15 is a simple filter connected across the output of the
rectifier in parallel with the load.
For you to have a better understanding of the effect that filtering has on Eavg, a
comparison of a rectifier circuit with a filter and one without a filter is illustrated in views
A and B of figure 4-16. The output waveforms in figure 4-16 represent the unfiltered and
filtered outputs of the half-wave rectifier circuit. Current pulses flow through the load
resistance (RL) each time a diode conducts. The dashed line indicates the average value of
output voltage. For the half-wave rectifier, Eavg is less than half (or approximately 0.318)
of the peak output voltage. This value is still much less than that of the applied voltage.
With no capacitor connected across the output of the rectifier circuit, the waveform in
view A has a large pulsating component (ripple) compared with the average or dc
component. When a capacitor is connected across the output (view B), the average value
of output voltage (Eavg) is increased due to the filtering action of capacitor C1.
UNFILTERED
FILTERED
The value of the capacitor is fairly large (several microfarads), thus it presents a
relatively low reactance to the pulsating current and it stores a substantial charge.
The rate of charge for the capacitor is limited only by the resistance of the conducting
diode, which is relatively low. Therefore, the RC charge time of the circuit is relatively
short. As a result, when the pulsating voltage is first applied to the circuit, the capacitor
charges rapidly and almost reaches the peak value of the rectified voltage within the first
few cycles. The capacitor attempts to charge to the peak value of the rectified voltage
anytime a diode is conducting, and tends to retain its charge when the rectifier output
falls to zero. (The capacitor cannot discharge immediately.) The capacitor slowly
discharges through the load resistance (RL) during the time the rectifier is non-
conducting.
The rate of discharge of the capacitor is determined by the value of capacitance and the
value of the load resistance. If the capacitance and load-resistance values are large, the
RC discharge time for the circuit is relatively long.
A comparison of the waveforms shown in figure 4-16 (view A and view B) illustrates
that the addition of C1 to the circuit results in an increase in the average of the output
voltage (Eavg) and a reduction in the amplitude of the ripple component (Er), which is
normally present across the load resistance.
Now, let's consider a complete cycle of operation using a half-wave rectifier, a capacitive
filter (C1), and a load resistor (RL). As shown in view A of figure 4-17, the capacitive
filter (C1) is assumed to be large enough to ensure a small reactance to the pulsating
rectified current. The resistance of RL is assumed to be much greater than the reactance of
C1 at the input frequency. When the circuit is energized, the diode conducts on the
positive half cycle and current flows through the circuit, allowing C1 to charge. C1 will
charge to approximately the peak value of the input voltage. (The charge is less than the
peak value because of the voltage drop across the diode (D1)). In view A of the figure,
the heavy solid line on the waveform indicates the charge on C1. As illustrated in view B,
the diode cannot conduct on the negative half cycle because the anode of D1 is negative
with respect to the cathode. During this interval, C1 discharges through the load resistor
(RL). The discharge of C1 produces the downward slope as indicated by the solid line on
the waveform in view B. In contrast to the abrupt fall of the applied ac voltage from peak
value to zero, the voltage across C1 (and thus across RL) during the discharge period
gradually decreases until the time of the next half cycle of rectifier operation. Keep in
mind that for good filtering, the filter capacitor should charge up as fast as possible and
discharge as little as possible.
Figure. - Capacitor filter circuit (positive and negative half cycles). POSITIVE HALF-
CYCLE
Figure. - Capacitor filter circuit (positive and negative half cycles). NEGATIVE HALF-
CYCLE
Since practical values of C1 and RL ensure a more or less gradual decrease of the
discharge voltage, a substantial charge remains on the capacitor at the time of the next
half cycle of operation. As a result, no current can flow through the diode until the rising
ac input voltage at the anode of the diode exceeds the voltage on the charge remaining on
C1. The charge on C1 is the cathode potential of the diode. When the potential on the
anode exceeds the potential on the cathode (the charge on C1), the diode again conducts,
and C1 begins to charge to approximately the peak value of the applied voltage.
After the capacitor has charged to its peak value, the diode will cut off and the capacitor
will start to discharge. Since the fall of the ac input voltage on the anode is considerably
more rapid than the decrease on the capacitor voltage, the cathode quickly become more
positive than the anode, and the diode ceases to conduct.
Operation of the simple capacitor filter using a full-wave rectifier is basically the same as
that discussed for the half-wave rectifier. Referring to figure, you should notice that
because one of the diodes is always conducting on alternation, the filter capacitor charges
and discharges during each half cycle. (Note that each diode conducts only for that
portion of time when the peak secondary voltage is greater than the charge across the
capacitor.)
Another thing to keep in mind is that the ripple component (E r) of the output voltage is
an ac voltage and the average output voltage (Eavg) is the dc component of the output.
Since the filter capacitor offers relatively low impedance to ac, the majority of the ac
component flows through the filter capacitor. The ac component is therefore bypassed
(shunted) around the load resistance, and the entire dc component (or Eavg) flows through
the load resistance. This statement can be clarified by using the formula for XC in a half-
wave and full-wave rectifier. First, you must establish some values for the circuit.
As you can see from the calculations, by doubling the frequency of the rectifier, you
reduce the impedance of the capacitor by one-half. This allows the ac component to pass
through the capacitor more easily. As a result, a full-wave rectifier output is much easier
to filter than that of a half-wave rectifier. Remember, the smaller the XC of the filter
capacitor with respects to the load resistance, the better the filtering action. Since
The LM158 series consists of two independent, high gain, internally frequency
compensated operational amplifiers which were designed specifically to operate from a
single power supply over a wide range of voltages. Operation from split power supplies is
also possible and the low power supply current drain is independent of the magnitude of
the power supply voltage. Application areas include transducer amplifiers, dc gain blocks
and all the conventional op amp circuits, which now can be more easily implemented in
single power supply systems. For example, the LM158 series can be directly operated off
of the standard +5V power supply voltage, which is used in digital systems and will
easily provide the required interface electronics without requiring the additional ±15V
power supplies. The LM358 and LM2904 are available in a chip sized pack-age (8-Bump
micro SMD) using National’s micro SMD pack-age technology.
Unique Characteristics
In the linear mode the input common-mode voltage range includes ground and the
output voltage can also swing to ground, even though operated from only a single
power supply voltage.
The unity gain cross frequency is temperature compensated.
The input bias current is also temperature compensated
Advantages
Features
The relay takes advantage of the fact that when electricity flows through a coil, it
becomes an electromagnet. The electromagnetic coil attracts a steel plate, which is
attached to a switch. So the switch's motion (ON and OFF) is controlled by the current
flowing to the coil, or not, respectively.
A very useful feature of a relay is that it can be used to electrically isolate different parts
of a circuit. It will allow a low voltage circuit (e.g. 5VDC) to switch the power in a high
voltage circuit (e.g. 100 VAC or more).
There are many kind of relays. You can select one according to your needs.
The various things to consider when selecting a relay are its size, voltage and current
capacity of the contact points, drive voltage, impedance, number of contacts, resistance of
the contacts, etc.
The resistance voltage of the contacts is the maximum voltage that can be conducted at
the point of contact in the switch. When the maximum is exceeded, the contacts will
spark and melt, sometimes fusing together. The relay will fail. The value is printed on the
relay.
DIODES
A diode is a semiconductor device which allows current to flow through it in only one
direction. Although a transistor is also a semiconductor device, it does not operate the
way a diode does. A diode is specifically made to allow current to flow through it in only
one direction. Some ways in which the diode can be used are listed here.
The graph above shows the electrical characteristics of a typical diode. When a small
voltage is applied to the diode in the forward direction, current flows easily. Because the
diode has a certain amount of resistance, the voltage will drop slightly as current flows
through the diode. A typical diode causes a voltage drop of about 0.6 - 1V (VF) (In the
case of silicon diode, almost 0.6V)
This voltage drop needs to be taken into consideration in a circuit which uses many
diodes in series. Also, the amount of current passing through the diodes must be
considered.
When voltage is applied in the reverse direction through a diode, the diode will have a
great resistance to current flow. Different diodes have different characteristics when
reverse-biased. A given diode should be selected depending on how it will be used in the
circuit. The current that will flow through a diode biased in the reverse direction will vary
from several mA to just µA, which is very small.
The limiting voltages and currents permissible must be considered on a case by case
basis. For example, when using diodes for rectification, part of the time they will be
required to withstand a reverse voltage. If the diodes are not chosen carefully, they will
break down.
Rough size
Rating power Thickness Length
(W) (mm) (mm)
From the top of the photograph
1/8 2 3
1/8W
1/4W 1/4 2 6
1/2W 1/2 3 9
In the photograph to the left, the variable resistor typically used for volume controls can e
seen on the far right. Its value is very easy to adjust. The four resistors at the center of the
photograph are the semi-fixed type. These ones are mounted on the printed circuit board.
The two resistors on the left are the trimmer potentiometers.
There are three ways in which a variable resistor's value can change according to the
rotation angle of its axis.
When type "A" rotates clockwise, at first, the resistance value changes slowly and then in
the second half of its axis, it changes very quickly. The "A" type variable resistor is
typically used for the volume control of a radio, for example. It is well suited to adjust a
low sound subtly. It suits the characteristics of the ear. The ear hears low sound changes
well, but isn't as sensitive to small changes in loud sounds. A larger change is needed as
the volume is increased. These "A" type variable resistors are sometimes called "audio
taper" potentiometers.
As for type "B", the rotation of the axis and the change of the resistance value are directly
related. The rate of change is the same, or linear, throughout the sweep of the axis. This
type suits a resistance value adjustment in a circuit, a balance circuit and so on.
They are sometimes called "linear taper" potentiometers. Type "C" changes exactly the
opposite way to type "A". In the early stages of the rotation of the axis, the resistance
value changes rapidly, and in the second half, the change occurs more slowly. This type
isn't too much used. It is a special use. As for the variable resistor, most are type "A" or
type "B".
Tolerance
Color Value Multiplier
(%)
Black 0 0 -
Brown 1 1 ±1
Example 1
Red 2 2 ±2
(Brown=1),(Black=0),(Orange=3)
10 x 103 = 10k ohm Orange 3 3 ±0.05
Tolerance(Gold) = ±5%
Yellow 4 4 -
Green 5 5 ±0.5
Blue 6 6 ±0.25
Violet 7 7 ±0.1
Gray 8 8 -
White 9 9 -
Example 2
(Yellow=4),(Violet=7),(Black=0),(Red=2) Gold - -1 ±5
2
470 x 10 = 47k ohm
Silver - -2 ±10
Tolerance(Brown) = ±1%
None - - ±20
CAPACITORS
Capacitors
The capacitor's function is to store electricity, or electrical energy. The capacitor also
functions as a filter, passing alternating current (AC), and blocking direct current (DC).
This symbol ‘F’ is used to indicate a capacitor in a circuit diagram. The capacitor is
constructed with two electrode plates facing each other, but separated by an insulator.
When DC voltage is applied to the capacitor, an electric charge is stored on each
electrode. While the capacitor is charging up, current flows. The current will stop flowing
when the capacitor has fully charged.
Types of Capacitor
Ceramic Capacitors
Ceramic capacitors are constructed with materials such as titanium acid barium used as
the dielectric. Internally, these capacitors are not constructed as a coil, so they can be
used in high frequency applications. Typically, they are used in circuits which bypass
high frequency signals to ground. These capacitors have the shape of a disk. Their
capacitance is comparatively small. The capacitor on the left is a 100pF capacitor with a
diameter of about 3 mm. The capacitor on the right side is printed with 103, so 10 x
103pF becomes 0.01 µF. The diameter of the disk is about 6 mm. Ceramic capacitors
have no polarity. Ceramic capacitors should not be used for analog circuits, because they
can distort the signal.
Variable Capacitors
Variable capacitors are used for adjustment etc. of frequency mainly. On the left in the
photograph is a "trimmer," which uses ceramic as the dielectric. Next to it on the right is
one that uses polyester film for the dielectric. The pictured components are meant to be
mounted on a printed circuit board.
When adjusting the value of a variable capacitor, it is advisable to be careful. One of the
component's leads is connected to the adjustment screw of the capacitor. This means that
the value of the capacitor can be affected by the capacitance of the screwdriver in your
hand. It is better to use a special screwdriver to adjust these components.
LIGHT DEPENDENT RESISTORS
LDRs or Light Dependent Resistors are very useful especially in light/dark sensor
circuits. Normally the resistance of an LDR is very high, sometimes as high as 1000 000
ohms, but when they are illuminated with light resistance drops dramatically
Circuit Diagram
CHAPTER 2 LITERATURE REVIEW
PREHISTORY: 8048
In fact, it should have started with chapter -2, the invention of
microprocessor. Intel introduced a single-chip processor, the 4004, in 1971.
It was a 4-bit microprocessor, with whopping processing speed of 100
thousand operations per second, and was meant for an electronic calculator.
There is a lot of 4-bit processing in calculators, especially if the software is
based on BCD arithmetics. Later Intel introduced the 8-bitter 8008 and it's
grown-up brother - the famous 8080 (which then was perfected by an ex-
Intel employee as Zilog Z80, one of the best 8-bit microprocessors of all
times). In 1976, Intel introduced its first microcontroller, 8048. It integrated
the processing core with code and data memory and certain peripherals. The
code memory was a 1kB mask ROM (defined by the last metallisation mask
during the chip processing) or EPROM (after all, Intel invented EPROM),
the data memory was 64 bytes of RAM (including the 8-level stack and two
pages of eight general purpose registers). Besides general-purpose I/O (see
below), peripherals included a timer and an external interrupt (plus the
necessary interrupt system). Although the 8048 is clearly an 8-bit
architecture, it is said to be an ancestor of the 4-bit 4004 rather than the
8080. Also it is said to bear remarkable similarities to Fairchild F8
microprocessor. Today, it is hard to say whether something of this is true,
but one thing is sure, the 8048 has a couple of strange features. Using four of
its general purpose input/output ports, and adding one or more 8243-type
chip - and the I/O expand into another four 4-bit ports. This expansion has
not only support in the hardware - dedicated pins on 8048 - but also in the
instruction set, having dedicated instructions for I/O operations (including
AND and OR(!)) via the expander.
The 8048 already had a lot of useful features known well to 8051-users:
external code memory support; external data memory support (inherently
only 256 bytes addressed indirectly by R0 and R1 as there is no 16 bit
pointer register such as the DPTR in 8051 - the 8051 inherited this 8-bit
external data access); quasibidirectional I/O ports. Maximum clock is
11MHz, but an instruction cycle takes 15 oscillator clocks. The "A" version
(advanced) introduced powerdown mode There were multiple variations of
the 8048 around, mostly with different numbering, but generally denoted as
the MCS-48 family. 8048 itself denoted a mask-ROM part, 8748 an EPROM
part - windowed (CERDIP - erasable) for development, and unwindowed
(PDIP) OTP. The romless part was a bit surprisingly marked 8035 (probably
most of the parts sold as romless were parts with unusable ROM, due to
error in the "programmed" firmware). There was a low-cost version with
reduced pin count and omitted some of the features as 8021, and versions
with more ROM and RAM as 8049 (2kB ROM/128B RAM) and 8050 (4kB
ROM/256B RAM); with ROMless versions as 8039 and 8040; and 8049 had
also an EPROM version 8749 (the funny thing is, that 8749 came in 1981,
one year after 8051/8751). 8048's were second sourced by a number of
manufacturers, including NEC, Toshiba, and were cloned also behind the
then iron curtain in Czechoslovakia (Tesla MHB8048/8035) and USSR.
Application specific versions of 8048 were also built quite early, with
adding of various peripherals, such as 8-bit ADC in 8022 and a parallel-bus
slave interface in 8041/8042. The MCS-48 family was used in a quite wide
range of applications. One of the first applications of 8048 was in a gaming
console (Magnavox Odyssey2), but there were also more "serious"
applications, for example in one of the first car engine "computerized"
control units. But the biggest hit came when IBM decided to use 8048 in its
original PC keyboard. Although in the AT keyboard IBM used the
(presumably cheaper) 6805, it used 8042 as a co-processor on the
mainboard, communicating with the keyboard. The 8042 is still present in
almost each and every PC even today, but don't search for a chip with
"8042" on it - it is integrated in the chipset. It may come as a surprise to
somebody, but thanks to this fact the 8048 with its derivatives is most
probably the most widespread microcontroller at all.
As in the 70s there were no pdf-s and no world-wide web, datasheets and
other documentation is hardly available over the internet. I believe Intel will
give out a copy if one really wants it (there is a "literature request" form at
their "museum" pages). However, there seems to be a couple of enthusiastic
people, one of the maintaining a wonderful document called “Grokking the
MCS-48 System” at http://home.mnet-online.de/al/mcs-48/mcs-48.pdf .
8051: THE CLASSICS
In 1980, Intel introduced the successor to 8048, the 8051. Intel made sure
that the transition from the already successful model will be as smooth as
possible. Architecturally, the 8051 is an extension to 8048. Almost every
feature and resource of 8048 is present in 8051 in same or superior form.
4kB ROM and 128B RAM on chip. Pin compatibility was not maintained,
but it was not a real issue. Software compatibility is not binarywise but
source-wise, but that is also acceptable. The preliminary datasheet read:
"Enhanced MCS-48 Architecture". The extensions included code and data
memory extended to 64kB with appropriate support in instruction set and
registers (DPTR), relative conditional and unconditional jumps (conditionals
and DJNZ were constrained within a 256-byte page in 8048), four register
banks instead of two, "unlimited" stack (8048 had stack limited to 16 bytes),
multiple and divide instructions. As for peripherals, second timer was added
and both were extended to 16 bits with multiple modes (including 8-bit
autoreload mode), and an UART (which was a luxury that many lower-end
microcontrollers didn't have even a couple of years ago). The raw clock
frequency did not increase considerably, being 12MHz, but an instruction
cycle is 12 clocks now. Similarly to 8048, also the 8051 had variants, but
there was no cut-down "low-cost" version (presumably because of the cost
of ROM/RAM and the DIP40 package went low enough). The romless
version was 8031 and the EPROM version was 8751. The "extended"
version - 8052 (with 8032 and 8752) came 3 years later and featured besides
8kB ROM and 256B RAM also an extra 16-bit timer. An unusual chip was
the 8052AH-BASIC, which according to Intel was "software-onsilicon
version of the 8052 microcontroller with a BASIC interpreter on-chip in 8K
ROM". The whole family was eventually called MCS-51 and was
manufactured in NMOS, since 1986 in CMOS. Intel provided all the needed
initial tools and support with the 8051 - assembler, application notes,
example software, in-circuit emulator. Some of the appnotes and software
still can be found on Intel's webpages and are of excellent quality. The basic
datasheet set - dubbed in the community as "the bible" - is still THE
reference source of information on 8051 and its derivatives, even today. So,
Intel did its job, providing everything needed to make 8051 successful, and
the rest is history.
THE BIRDS ARE OUT OF
THE NEST
Similar to 8048, also the 8051 has been licensed to various manufacturers
worldwide. Some of the early adopters include Philips, Signetics, MHS
(Matra) and Siemens. Most of these companies don't exist any more, some
have been taken over, others have been renamed; but most of them still
manufacture some derivative of 8051. The licensees started to make fully
compatible models. Naturally, they took over also the datasheets, for
example the "bible" is better used in the Philips version, which is a verbatim
copy of the Intel version, except that it is a true searchable pdf, while the
Intel is a scanned copy of paper document, unsearchable. More than that, the
manufacturers took over the annoying practice of Intel to include in
datasheets only the specific differences to the "bible", very confusing for the
newbies (but there are opinions on this, some of the users consider this
arrangement better than having huge datasheets containing all the “common”
details). The manufacturers published their own appnotes, which all together
form a huge knowledge base and code library, but... due to competition it is
scattered across the manufacturers' sites, an another confusing fact for the
newbies. Later, the manufacturers rolled out their own derivatives and
variants with varying marking - there is no real standard in it (although there
are some idiosyncrasies present in the marking of most manufacturers). All
types of modifications described in the following chapters were applied; but
the compatibility to the original 8051 was usually maintained. This, together
with the availability of second-, third-,...,35th-,...-source of 8051 is the true
source of its immortality.
EMBEDDED IN EMBEDDED
Intel and the licensees soon realized that 8051 is a nice core that can be
embedded in various ASIC chips to perform setup and control tasks.
Typically, the resources of the ASIC are mapped as external data memory,
as if the ASIC would be connected to a conventional 8051 chip. This
approach allows to use an unmodified core, which speeds up the chip
development and decreases the chance for error; also the ASIC could be
breadboard-prototyped in this form easily. As an example, Intel produced
80C51SL, a descendant of 8042. Philips has a line of 8051-based teletext
controllers. In a particular USB webcamera, the chip interfacing the CCD
and USB was controlled by an embedded 8051. There are probably much
more examples around, but most of them never get public. In spite of this,
the 8051 in this form is produced probably in much higher volumes than as
general-purpose microcontrollers.
EXTRAS
Besides application-specific, also general purpose derivatives have been
introduced by Intel and the licensees, with enhanced features and increased
code and data memories. In contrast with the ASICs mentioned above, these
chips tend to implement the extra features in the core itself, acces allows
faster code as SFRs are accessed by all the instructions using direct
addressing (mov, logic), and some of them by the bit-manipulation
instructions, too. One of the first such derivative by Intel was the 80C51FA,
which introduced the programmable counter array (PCA) (and was a 8052
otherwise). It was intended for automotive applications (brake control).
Soon, FB and FC continued, with more and more code memory.
80C51RA/RB/RC followed, with added "internal external" data memory.
These were the basis for the today's 89C51RD2 "sub-family", produced by
Philips, Atmel (as ex-Temic), SST and Winbond.
In the 90s, Atmel introduced a derivative of 8051 with Flash code memory,
enabling fast erasure and reprogramming. It enabled to use the production-
grade chip in development, and enabled the chips used in the product to be
reprogrammed when upgrade or a bugfix was needed, cutting down costs. It
brought down the 8051 to the masses - the small "garage" companies and
hobbyists. Besides that, Atmel introduced also 89C2051 with decreased pin
count (and price).This was a smart move, the chip proved to be extremely
popular in many small applications. Today, virtually all manufacturers
produce 8051 derivatives with Flash, most of them able to be programmed
via some few-pin serial interface (called in-situ programming (ISP), SPI-
style or UART-style) and the higher-end versions also able to reprogram
themselves (in-application programming, IAP). MaskROM and EPROM -
windowed or OTP - seems to become extinct, at least in the mainstream
applications.
The need for higher processing power, addressed unsuccessfully by the 16-
bit versions, has been solved by introducing the high speed derivatives of
8051. The original 12-clock instruction cycle scheme is obviously inefficient
and also the technology progressed enough to achieve higher clock rates
than the original 12MHz. The first derivative addressing this in a radical
way is the now legendary Dallas DS80C320. It featured a 4-clocker core
with incompatible timing, and could be clocked as high as 33MHz.
Unfortunately, it was produced as ROMless only. The following step was
taken by Cygnal, where a single-clock core has been developed. In the top-
range models, the clocking is as high as 100MHz, being the fastest 8051s
around.
Today, there are many 8051 derivatives with sped-up cores available. They
can be divided into two groups: the 6-clockers (e.g. the 8xC51RD2) and
2-clockers (Philips LPC9xx) have the same number of instruction cycle per
instruction as the original; while the 4-clockers and singleclockers are
incompatible in this way, requiring recalculation of timing loops if used.
WHERE IS IT GOING?
The 8051 is a sound mcu core with rich history. However, it seems that it is
already over its peak, although it might take quite a lot of time until it will be
completely replaced by most modern microcontrollers. So we now have
superfast 8051 derivatives with loads of internal FLASH and RAM. ISP and
IAP seems to be the standard these days. There are the 8051s built around
advanced analog circuits, mainly high resolution ADC. There are derivatives
suitable for extreme applications – high temperature, radiation hardened.
There are softcores around, tuned up, and even open source. There is a
wealth of knowledge and experience, however, it is scattered around and the
newbies tend to get the easier path - competing 8-bit microcontrollers
usually do have a single-stop information resource site, so this knowledge
and experience seems to die out as the "old boys" retire gradually. The price
difference between the high-end 8-bitters and the much more powerful low-
end 32-bit RISCs (such as the ARMs) seems to decrease rapidly and will
change eventually, as the 32-bitters are becoming the standard in all but the
least demanding applications.So there is perhaps still a need for the 8051s,
but this need is decreasing and 8051s life cycle is slowly approaching its
end.
CHAPTER 3
DESIGNING & WORKING
SOLDERING
Soldering is the process of joining two metallic conductor the joint where
two metal conductors are to be join or fused is heated with a device called
soldering iron and then as allow of tin and lead called solder is applied
which melts and converse the joint. The solder cools and solidifies quickly
to ensure is good and durable connection between the jointed metal
converting the joint solder also present oxidation.
SOLDERING AND DESOLDERING TECHIQUES:
These are basically two soldering techniques.
•Manual soldering with iron.
•Mass soldering.
SOLDERING WITH IRON
The surface to be soldered must be cleaned & fluxed. The soldering iron
switched on and bellowed to attain
soldering temperature. The solder in form of wire is allied hear the
component to be soldered and heated with iron. The surface to be soldered is
filled, iron is removed and joint is cold without disturbing.
SOLDER JOINT ARE SUPPOSED TO
1.Provide permanent low resistance path.
2.Make a robust mechanical link between P.C.B. and leads of components.
3.Allow heat flow between component, joining elements and P.C.B.
4.Retain adequate strength with temperature variation. The following
precaution should be taken while soldering:
1.Use always an iron plated copper core tip for soldering iron.
2.Slightly for the tip with a cut file when it is cold.
3.Use a wet sponge to wipe out dirt from the tip before soldering instead of
asking the iron.
4.Tighten the tip screw if necessary before iron is connected to power
supply.
5.Clean component lead and copper pad before soldering.
6.Apply solder between component leads, P.C.B. pattern and tip of soldering
iron.
7.Iron should be kept in contact with the joint for 2-3 seconds only instead of
keeping for very long or very small time.
8.Use optimum quantity of solder
PROBLEM FACED
•During soldering, many of the connection become short cktd. So
we desolder the connection and did soldering again.
•A leg of the crystal oscillator was broken during mounting. So it
has to be replaced.
•LED`s get damaged when we switched ON the supply so we
replace it by the new one.
TROUBLESHOOT
•Care should be taken while soldering. There should be no
shorting of joints.
•Proper power supply should maintain.
•Project should be handled with care since IC are delicate
•Component change and check again circuit
CHAPTER 5 CONCULSION
AREA OF APPLICATIONS
The theme of the project when merged with certain established
technologies can be quite effective in number of countries like
Germany, France & Japan etc. which control the train . The project
when used with an improved sensitivity. The train is programmed
for the specific path. Every station on the path is defined; stoppage
timing of the train & distance between the two stations is
predefined.
HBeonLabs
Contact us:
+91-120-4298000
+91-9212314779
info@hbeonlabs.com
training@hbeonlabs.com
www. hbeonlabs.com