Sei sulla pagina 1di 61

Automatic College Ringing Bell

ABSTRACT
The project is designed to automatically operate an electric bell several times as
required in an educational institution like school or college. It overcomes the
difficulties of switching the bell on/off manually.
When this time equals to the programmed ON time, then the corresponding Relay
for the device is switched ON and then OFF as per the OFF time that finally
switches the load ON or OFF. Matrix keypad helps entering the time while relays used
with relay drivers for the loads.
Furthermore, this project can be enhanced by interfacing a GSM modem to the
existing project so that the bell ringing system can be controlled by sending an SMS
to the control unit.

INTRODUCTION OF PROJECT

INTRODUCTION OF PROJECT

This Project takes over the task of Ringing of the Bell in


Colleges. It replaces the Manual Switching of the Bell in the College. When this time
equals to the Bell Ringing time, then the Relay for the Bell is switched on. Count
down time is displayed on LCD display. The Microcontroller AT89c51 is used to
control all the Functions. When the set time is equal to zero then the Bell is switched
on and this process is going until we switch off microcontroller unit.
This project can be used in the exam mode where user can set the
exam start time and exam end time. The display will show the exam started and when
exam time over it will show the exam end and buzzer will ring for indication.
The implementation of this automatic college bell would be advantageous since it
keeps manual work away i.e. there is no requirement of any labour, it runs
automatically.

BLOCK DIAGRAM:

WHAT IS EMBEDDED TECHNOLOGY

Embedded technology is software or hardware that is


hidden embedded in a large device or system. It typically

refers to a fixed function device, as compared with a PC,


which runs general purpose application. Embedded
technology is nothing new. It all around us and has been
for years. An early example of embedded technology is the
engine control unit in a car, which measures what setting
to give the engine. Your coffee maker has embedded
technology in the form of a microcontroller, which is what
tells it to make the coffee at 6 a.m. the vending machine
has it too. Overall, billions of devices woven into everyday
life use embedded technology. In the past embedded
technology existed in standalone device vending
machines and copiers that did their jobs with little regard
for what went on around them,. But as technology has
learned to connect device to the internet and to each
other, embedded technology potential has grown.
Suddenly it is and what actions those connections let them
perform. Cell phone companies figured that out a long
time ago, which is why cell phones are cheap and the
service, plans are expensive. It is not the phone itself that
matters, but the connectivity to a vast network of other
phones, other people and the internet. Until you download
software that lets you find a local restaurant or mange
your finances. Let say you make freezers the big,
expensive kind that grocery stores buy. You sell ne and
you are done with that customer. When it brakes the
customer calls a service person, who probably comes from
somewhere other than your company. But let us say that
freezer knows that it is about to go on the fritz. Let say
three refrigerator alerts the customer before it breaks.
Better yet, let us say the freezer alerts the manufacturer
and you are able to send a service person to do
preventative work and save a lot of haagen- dazs from
melting. Embedded technology allows all of that to
happen. You, the freezer company have transformed
yourself from a product company to product and services
company. The possibilities go beyond that programming
device to communicate with businesses can eliminate the

need for costly call centers. Copy machines that can order
their own replacement cartridges will save businesses
time and money. Remember, the fact the technology is
embedded is not what important, and neither is the
device.
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.

MICROCONTROLLER AT89S52:
The AT89S52 is a low-power, high-performance CMOS 8-bit microcomputer with 64 Kbytes
of Flash Programmable and Erasable Read Only Memory (PEROM). The device is
manufactured using Atmels high density non-volatile 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 non-volatile memory programmer. By combining a versatile 8-bit CPU with
Flash on a monolithic chip, the Atmel AT89s52 is a powerful microcomputer which provides a
highly flexible and cost effective solution to many applications.
LCD Display:
It will display the time, date as well as current room temperature. Output of microcontroller
is applied to the LCD display.
Buzzer & Buzzer driver:
Output of microcontroller is applied to buzzer driver which drives buzzer after lecture.

POWER SUPPLY

BRIDGE RECTIFIER

Bridge rectifier circuit consists of four diodes arranged in the form


of a bridge as shown in figure.

OPERATION

During the positive half cycle of the input supply, the upper end A
of the transformer secondary becomes positive with respect to its
lower point B. This makes Point1 of bridge Positive with respect to
point 2. The diode D1 & D2 become forward biased & D3 & D4
become reverse biased. As a result a current starts flowing from
point1, through D1 the load & D2 to the negative end. During
negative half cycle, the point2 becomes positive with respect to
point1. Diodes D1 & D2 now become reverse biased. Thus a
current flow from point 2 to point1.

TRANSFORMER

Transformer is a major class of coils having two or more windings


usually wrapped around a common core made from laminated iron
sheets. It has two cols named primary and secondary. If the
current flowing through primary is fluctuating, then a current will
be inducted into the secondary winding. A steady current will not
be transferred from one coil to other coil.

Transformers are of two types:

1.Step up transformer

2.Step down transformer

In the power supply we use step down transformer. We apply 220V


AC on the primary of step down transformer. This transformer step
down this voltages to 6V AC. We Give 6V AC to rectifier circuit,
which convert it to 5V DC.

DIODE

The diode is a p-n junction device. Diode is the component used to


control the flow of the current in any one direction. The diode
widely works in forward bias.

Diode When the current flows from the P to N direction. Then it is


in forward bias. The Zener diode is used in reverse bias function
i.e. N to P direction. Visually the identification of the diode`s
terminal can be done by identifying he silver/black line. The
silver/black line is the negative terminal (cathode) and the other
terminal is the positive terminal (cathode).

APPLICATION

Diodes: Rectification, free-wheeling, etc

Zener diode: Voltage control, regulator etc.

Tunnel diode: Control the current flow, snobbier circuit, etc

RESISTORS

The flow of charge through any material encounters an opposing


force similar in many respects to mechanical friction .this opposing
force is called resistance of the material .in some electric circuit
resistance is deliberately introduced in form of resistor. Resistor
used fall in three categories , only two of which are color coded
which are metal film and carbon film resistor .the third category is
the wire wound type ,where value are generally printed on the
vitreous paint finish of the component. Resistors are in ohms and
are represented in Greek letter omega, looks as an upturned
horseshoe. Most electronic circuit require resistors to make them
work properly and it is obliviously important to find out something
about the different types of resistors available. Resistance is
measured in ohms, the symbol for ohm is an omega ohm. 1 ohm is
quite small for electronics so resistances are often given in kohm
and Mohm.

Resistors used in electronics can have resistances as low as 0.1


ohm or as high as 10 Mohm.

FUNCTION

Resistor 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.

TYPES OF RESISTORS

FIXED VALUE RESISTORS

It includes two types of resistors as carbon film and metal film


.These two types are explained under

1. CARBON FILM RESISTORS

During manufacture, at in film of carbon is deposited onto a small


ceramic rod. The resistive coating is spiraled away in an automatic
machine until the resistance between there two ends of the rods is
as close as possible to the correct value. Metal leads and end caps
are added, the resistors is covered with an insulating coating and
finally painted with colored bands to indicate the resistor value

Figure No. 1.15: Carbon Film Resistors

Another example for a Carbon 22000 Ohms or 22 Kilo-Ohms also


known as 22K at 5% tolerance: Band 1 = Red, 1st digit Band 2 =
Red, 2nd digit Band 3 = Orange, 3rd digit, multiply with zeros, in
this case 3 zero's Band 4 = Gold, Tolerance, 5%

METAL FILM RESISTORS

Metal film and metal oxides resistors are made in a similar way,
but can be made more accurately to within 2% or 1% of their
nominal vale there are some difference in performance between
these resistor types, but none which affects their use in simple
circuit.

WIRE WOUND RESISTOR

A wire wound resistor is made of metal resistance wire, and


because of this, they can be manufactured to precise values. Also,
high wattage resistors can be made by using a thick wire material.
Wire wound resistors cannot be used for high frequency circuits.
Coils are used in high frequency circuit. Wire wound resistors in a
ceramic case, strengthened with special cement. They have very
high power rating, from 1 or 2 watts to dozens of watts. These
resistors can become extremely hot when used for high power
application, and this must be taken into account when designing
the circuit.

TESTING

Resistors are checked with an ohm meter/millimeter. For a


defective resistor the ohm-meter shows infinite high reading.

CAPACITORS

In a way, a capacitor is a little like a battery. Although they work in


completely different ways, capacitors and batteries both store
electrical energy. If you have read How Batteries Work , then you
know that a battery has two terminals. Inside the battery, chemical
reactions produce electrons on one terminal and absorb electrons
at the other terminal.

BASIC

Like a battery, a capacitor has two terminals. Inside the capacitor,


the terminals connect to two metal plates separated by a
dielectric. The dielectric can be air, paper, plastic or anything else
that does not conduct electricity and keeps the plates from
touching each other. You can easily make a capacitor from two
pieces of aluminum foil and a piece of paper. It won't be a
particularly good capacitor in terms of its storage capacity, but it
will work.

In an electronic circuit, a capacitor is shown like this:

Figure No. 1.17: Symbol of Capacitor

When you connect a capacitor to a battery, heres what happens:

The plate on the capacitor that attaches to the negative terminal


of the battery accepts electrons that the battery is producing.

The plate on the capacitor that attaches to the positive terminal


of the battery loses electrons to the battery.

TESTING

To test the capacitors, either analog meters or specia

l digital meters with the specified function are used. The nonelectrolyte capacitor can be tested by using the digital meter.

Multi meter mode


:
Continuity Positive probe : One end Negative probe :
Second end Display
:
`0`(beep sound occur) `OL` Result : Faulty OK

LED

LED falls within the family of P-N junction devices. The light
emitting diode (LED) is a diode that will give off visible light when
it is energized. In any forward biased P-N junction there is, with in

the structure and primarily close to the junction, a recombination


of hole and electrons. This recombination requires that the energy
possessed by the unbound free electron be transferred to another
state. The process of giving off light by applying an electrical
source is called electroluminescence.

LED is a component used for indication. All the functions being


carried out are displayed by led .The LED is diode which glows
when the current is being flown through it in forward bias
condition. The LEDs are available in the round shell and also in the
flat shells. The positive leg is longer than negative leg.

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 8051users: 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/mcs48.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 8052AHBASIC, 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.

Circuit Diagram & Description


Circuit Diagram:
Microcontroller Section

Power supply Section

Keypad Section

A BRIEF INTRODUCTION TO 8051 MICROCONTROLLER:

When we have to learn about a new computer we have to familiarize about the
machine capability we are using, and we can do it by studying the internal hardware
design (devices architecture), and also to know about the size, number and the size of
the registers.
A microcontroller is a single chip that contains the processor (the CPU), nonvolatile memory for the program (ROM or flash), volatile memory for input and
output (RAM), a clock and an I/O control unit. Also called a "computer on a chip,"
billions of microcontroller units (MCUs) are embedded each year in a myriad of
products from toys to appliances to automobiles. For example, a single vehicle can
use 70 or more microcontrollers. The following picture describes a general block
diagram of microcontroller.
AT89S52:

The AT89S52 is a low-power, high-performance CMOS 8-bit

microcontroller with 8K bytes of in-system programmable Flash memory. The device


is manufactured using Atmels high-density nonvolatile memory technology and is
compatible with the industry-standard 80C51 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 in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a
powerful microcontroller, which provides a highly flexible and cost-effective solution
to many, embedded control applications. The AT89S52 provides the following
standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog
timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt
architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In
addition, the AT89S52 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. The Power-down mode saves the RAM con-tents but
freezes the oscillator, disabling all other chip functions until the next interrupt.

The hardware is driven by a set of program instructions, or software. Once familiar


with hardware and software, the user can then apply the microcontroller to the
problems easily.

The pin diagram of the 8051 shows all of the input/output pins unique to
microcontrollers:

The following are some of the capabilities of 8051 microcontroller.


1. Internal ROM and RAM
2. I/O ports with programmable pins
3. Timers and counters
4. Serial data communication
The 8051 architecture consists of these specific features:

16 bit PC &data pointer (DPTR)

8 bit program status word (PSW)

8 bit stack pointer (SP)

Internal ROM 8k

Internal RAM of 256 bytes.

4 register banks, each containing 8 registers

80 bits of general purpose data memory

32 input/output pins arranged as four 8 bit ports: P0-P3

Two 16 bit timer/counters: T0-T1

Two external and three internal interrupt sources Oscillator and

clock circuits.

PIN DESCRIPTION

VCC (Pin 40)

Provides voltage to the chip . +5V

GND (Pin 20)

Ground

XTAL1 (Pin 19) and XTAL2 (Pin 18)

Crystal Oscillator connected to pins 18, 19.Two capacitors


of 30pF value. Time for one machine
cycle:11.0592/12=1.085 secs

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 16Bit address for external memory. It provides higher
address A8-A16

PORT 3

Pins 10 through 17

No external pull up resistors required

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.

Memory Organization
Program Memory

Data Memory
The right half of the internal and external data memory spaces available on
Atmels 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:

The Instruction Set

All members of the Atmel microcontroller family execute the same instruction set. This
instruction set is optimized for 8- bit control applications and it provides a variety of fast
addressing modes for accessing the internal RAM to facilitate byte operations on small
data structures. The instruction set provides extensive support for 1-bit variables as a
separate data type, allowing direct bit manipulation in control and logic systems that
require Boolean processing. The following overview of the instruction set gives a brief
description of how certain instructions can be used.

Program Status Word


The Program Status Word (PSW) contains status bits that reflect the current state of the
CPU. The PSW, shown in Figure 11, resides in SFR space. The PSW contains the Carry
bit, the Auxiliary Carry (for BCD operations), the tworegister bank select bits, the Overflow
flag, a Parity bit, and two user-definable status flags. The Carry bit, in addition to serving
as a Carry bit in arithmetic operations, also serves as the Accumulator for a number of
Boolean operations.

The bits RS0 and RS1 select one of the four register banks shown in Figure 8. A number
of instructions refer to these RAM locations as R0 through R7. The status of the RS0 and
RS1 bits at execution time determines which of the four banks is selected. The Parity bit
reflects the number of 1s in the Accumulator: P=1 if the Accumulator contains an odd
number of 1s, and P=0 if the Accumulator contains an even number of 1s.

Thus, the number of 1s in the Accumulator plus P is always even. Two bits in the PSW
are uncommitted and can be used as general purpose status flags.

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.

Liquid Crystal display (LCD):

The three control lines are EN, RS, and RW.


The EN line is called "Enable." This control line is used to tell the LCD that you are sending
it data. To send data to the LCD, your program should make sure this line is low (0) and then
set the other two control lines and/or put data on the data bus. When the other lines are
completely ready, bring EN high (1) and wait for the minimum amount of time required by
the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.
The RS line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high
(1), the data being sent is text data which should be displayed on the screen. For example, to
display the letter "T" on the screen you would set RS high.
The RW line is the "Read/Write" control line. When RW is low (0), the information on the
data bus is being written to the LCD. When RW is high (1), the program is effectively
querying (or reading) the LCD. Only one instruction ("Get LCD status") is a read command.
All others are write commands--so RW will almost always be low.

Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected by
the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3,
DB4, DB5, DB6, and DB7.
Liquid Crystal Display also called as LCD is very helpful in providing user interface as well
as for debugging purpose. The most common type of LCD controller is HITACHI 44780
which provides a simple interface between the controller & an LCD. These LCD's are very
simple to interface with the controller as well as are cost effective.

2x16 Line Alphanumeric LCD Display


The most commonly used ALPHANUMERIC displays are 1x16 (Single Line & 16
characters), 2x16 (Double Line & 16 character per line) & 4x20 (four lines & Twenty
characters per line).
The LCD requires 3 control lines (RS, R/W & EN) & 8 (or 4) data lines. The number on data
lines depends on the mode of operation. If operated in 8-bit mode then 8 data lines + 3
control lines i.e. total 11 lines are required. And if operated in 4-bit mode then 4 data lines + 3
control lines i.e. 7 lines are required. How do we decide which mode to use? Its simple if
you have sufficient data lines you can go for 8 bit mode & if there is a time constrain i.e.
display should be faster then we have to use 8-bit mode because basically 4-bit mode takes
twice as more time as compared to 8-bit mode.
Pin

Symbol

Function

Vss

Ground

Vdd

Supply Voltage

Vo

Contrast Setting

RS

Register Select

R/W

Read/Write Select

En

Chip Enable Signal

7-14 DB0-DB7 Data Lines


15

A/Vee

Gnd for the backlight

16

Vcc for backlight

When RS is low (0), the data is to be treated as a command. When RS is high (1), the data
being sent is considered as text data which should be displayed on the screen.
When R/W is low (0), the information on the data bus is being written to the LCD. When RW
is high (1), the program is effectively reading from the LCD. Most of the times there is no
need to read from the LCD so this line can directly be connected to Gnd thus saving one
controller line.
The ENABLE pin is used to latch the data present on the data pins. A HIGH - LOW signal is
required to latch the data. The LCD interprets and executes our command at the instant the
EN line is brought low. If you never bring EN low, your instruction will never be executed.

8051 Interfacing to LCD

Electrical ringing bell:-

An electric bell is a mechanical bell that functions by means of an


electromagnet. When an electric current is applied, it produces a
repetitive buzzing or clanging sound. Electric bells have been widely used
at railroad crossings, in telephones, fire and burglar alarms, as school
bells, doorbells, and alarms in industrial plants, but they are now being
widely replaced with electronic sounders.
How it works
The most widely used form is the interrupter bell, which produces a continuous sound when
current is applied. See animation, above. The bell or gong (B), which is often in the shape of
a cup or half-sphere, is struck by a spring-loaded arm (A) with a metal ball on the end called a
clapper, actuated by an electromagnet (E). In its rest position the clapper is held away from
the bell a short distance by its springy arm. When an electric current is enabled to pass
through the winding of the electromagnet (via a closing of the switch (K) i.e. pressing the
door bell) it creates a magnetic field that attracts the iron arm of the clapper, pulling it over to
give the bell a tap. This opens a pair of electrical contacts (T) attached to the clapper arm,
interrupting the current to the electromagnet. The magnetic field of the electromagnet
collapses, and the clapper springs away from the bell. This closes the contacts again, allowing
the current to flow to the electromagnet again, so the magnet pulls the clapper over to strike
the bell again. This cycle repeats rapidly, many times per second, resulting in a continuous
ringing.
The tone of the sound generated depends on the shape and size of the bell or gong resonator.
Where several bells are installed together, they may be given distinctive rings by using
different size or shapes of gong, even though the strike mechanisms are identical.
Another type, the single-stroke bell, has no interrupting contacts. The hammer strikes the
gong once each time the circuit is closed. These are used to signal brief notifications, such as
a shop door opening for a customer, rather than continuous warnings.

PCB Design Basics:

PCB Design Layout


In the PCB design of electronics circuit, it is important that one plan and has a checklist of
the do's and don'ts before proceeding to do the printed circuit board layout. The
understanding of the circuit is critical to the design, for example one needs to understand the
maximum current and voltage that are carried by each conductor in order to determine the
track width of the conductor and the type of PCB that will be used.
The voltage difference between each track will determine the clearance between each
conductor. If the clearance is not enough, chances are that the electrical potential between
each track will cause spark over and short circuit the PCB. This will cause functional failure
to the product and the safety of the users that are using the product will be compromised. It is
therefore critical for one to understand some of these basics requirements before one proceed
to design the PCB.
Conductor Thickness and Width
The PCB conductor thickness and width will determine the current carrying capacity of the
track. The IPC standard for the conductor thickness and width of the common 1 oz/squarefeet PCB is as shown below. However, it is always advisable to use a bigger value due to the
tolerance and variation of the PCB processes. If higher current carrying capacity is required, a
2 oz/square-feet or 3 oz/square-feet type of PCB is preferred. Many electronics hobbyist
prefer to solder a thick cooper conductor on the PCB track to increase the current carrying
capacity of the track.

LAYERS OF PCB:
*.BOT - bottom copper
*.SMB - Solder mask bottom
*.SST - Silk screen top
*.ASY - Assembly top, contains the board outline
*.DS - drill sizes
Tracks Restricted Area
Tracks should not be located on the areas that can cause them to be peeled off easily. One of
the restricted areas is holes on the PCB which are used to mount screws or PCB spacers.
These holes are usually used to secure the PCB to a casing or to secure it in a fixed place.
The edges of the PCB should not have any tracks as these areas are usually used to transport
the PCB from one process to another process by using a conveyor belt. These edges are
places where the possibility of scratches and cracking of the PCB happens. The
recommended areas that should not have any track is as shown in the diagram below
assuming a hole diameter of 4 mm which is used to mount a PCB spacer.

First a few safety precautions:

Never touch the element or tip of the soldering iron.


They are very hot (about 400C) and will give you a nasty burn.

Take great care to avoid touching the mains flex with the tip of the iron.
The iron should have a heatproof flex for extra protection. An ordinary plastic flex
will melt immediately if touched by a hot iron and there is a serious risk of burns and
electric shock.

Always return the soldering iron to its stand when not in use.
Never put it down on your workbench, even for a moment!

Work in a well-ventilated area.


The smoke formed as you melt solder is mostly from the flux and quite irritating.
Avoid breathing it by keeping you head to the side of, not above, your work.

Wash your hands after using solder.


Solder contains lead which is a poisonous metal.

Preparing the soldering iron:

Place the soldering iron in its stand and plug in.


The iron will take a few minutes to reach its operating temperature of about 400C.

Dampen the sponge in the stand.


The best way to do this is to lift it out the stand and hold it under a cold tap for a
moment, then squeeze to remove excess water. It should be damp, not dripping wet.

Wait a few minutes for the soldering iron to warm up.


You can check if it is ready by trying to melt a little solder on the tip.

Wipe the tip of the iron on the damp sponge.


This will clean the tip.

Melt a little solder on the tip of the iron.


This is called 'tinning' and it will help the heat to flow from the iron's tip to the joint.
It only needs to be done when you plug in the iron, and occasionally while soldering
if you need to wipe the tip clean on the sponge.

Program Burning Into Microcontroller:

PCB LAYOUT:
Microcontroller with LCD

Power Supply:

Keypad:

Applications:

This system can be used in colleges for regular lecture bell.

It can be also used in institutes, coaching classes etc

This project can be used in companies after some modifications

Advantages:
There is no requirement of any labour, it runs automatically & decreases dependability on
human.
The chances of errors are less compared to manual system.

Future Scope:

Wireless technology can be used for further advancements

Time table can be displayed after some modifications

REFERENCE BOOKS:

The 8051 microcontroller :- Kenneth Ayala

The 8051 microcontroller and Embedded systems :- Muhammad Ali Mazidi

WEB-SITES:

www.alldatasheets.com

www.datasheetarchieve.com

www.atmel.com

Potrebbero piacerti anche