+ All Categories
Home > Documents > Automatic College Bell Original Report

Automatic College Bell Original Report

Date post: 12-Nov-2014
Category:
Upload: amrutha-vincent
View: 96 times
Download: 0 times
Share this document with a friend
Description:
rmj
131
ABSTRACT Embedded Based Automatic College Bell System project is developed for the users to control Bell system in companies or institutions automatically. All the bell timings and durations are predefined and set in the microcontroller. The user can set the timings using a key pad. A LCD display is used to display the timings. The timings set by the user are stored in the microcontroller. At the particular time, signal is generated in the microcontroller and sent through the output port. The electronic circuit receives the signal and drives a corresponding relay. The relay is used as a switch to operate the Bell. As soon as the duration is over, the signal is stopped and waiting for the next set time. This system is mainly used in Schools, Colleges and other companies where Bell system is implemented. There is no need of a person managing the bell timings. The microcontroller program is written in Assembly Language.
Transcript
Page 1: Automatic College Bell Original Report

ABSTRACT

Embedded Based Automatic College Bell System project is developed for the users to control Bell

system in companies or institutions automatically. All the bell timings and durations are predefined

and set in the microcontroller. The user can set the timings using a key pad. A LCD display is used to

display the timings. The timings set by the user are stored in the microcontroller. At the particular

time, signal is generated in the microcontroller and sent through the output port. The electronic circuit

receives the signal and drives a corresponding relay. The relay is used as a switch to operate the Bell.

As soon as the duration is over, the signal is stopped and waiting for the next set time. This system is

mainly used in Schools, Colleges and other companies where Bell system is implemented. There is no

need of a person managing the bell timings. The microcontroller program is written in Assembly

Language.

Page 2: Automatic College Bell Original Report

1.1. INTRODUCTIONINTRODUCTION

In today’s life, everyone gives importance to time. Time does not wait for anybody.

Everything should be performed in time & accurately. Now a day’s school/college bells are

manually operated. Hence there is a big question of accuracy. Also there is necessity of

manpower and money. Hence here we should use automatic control system, which saves our

manpower and money & also highest accuracy. Hence we have selected the project.

What is our System?

In market there many digital clocks available with bells but rings only at specific

time. For e.g. Alarm Clock and some bells that ring after some time intervals and that cannot

stop after specific time. For e.g. Musical Clock But all these limitation have been removed by

our project. It rings only according to our college time table.

Our Project takes over the task of Ringing of the Bell in Colleges. It replaces the

Manual Switching of the Bell in the College. It has an Inbuilt Real Time Clock (DS1307 /DS

12c887) which tracks over the Real Time. When this time equals to the Bell Ringing time,

then the Relay for the Bell is switched on. The Bell Ringing time can be edited at any Time,

so that it can be used at Normal Class Timings as well as Exam Times. The Real Time Clock

is displayed on LCD display. The Microcontroller AT89S52 is used to control all the

Functions, it get the time through the keypad and store it in its Memory. And when the Real

time and Bell time get equal then the Bell is switched on for a predetermined time.

Page 3: Automatic College Bell Original Report

Figure Figure 1.1 1.1Conventional BellConventional Bell Figure Figure 1.2 1.2Manually operated College BellManually operated College Bell

Figure Figure 1.3 1.3 Automatic College BellAutomatic College Bell

Page 4: Automatic College Bell Original Report

Microcontroller

Power supply

LCD Display

KEY PAD INPUT

Buzzer

BLOCK DIAGRAM :

BLOCK DIAGRAM DESCRIPTION

POWER SUPPLY :

Input of 230V AC is given to step – down transformer of 230V/12V

Output of step- down transformer is given to full wave rectifier.

Rectifier is given to filter to produce a non- ripple DC voltage .

Rectified dc voltage of 12V is given to voltage regulator for constant 5V voltage .

BUZZER DRIVER

REAL TIME CLOK

(RTC)

Page 5: Automatic College Bell Original Report

MICROCONTROLLER :

Here microcontroller is taken input from the keyboard and power supply circuit and

controls and enhance the giving signals And it is giving the output to the liquid

crystal display and buzzer.

When the present time is equal to the alarm time then the microcontroller given the

signal to buzzer , then buzzer is ring.

KEYPAD :

Here the keypad has four switches

These four switches are used to set the time , date, alarm time

LIQUID CRYSTAL DISPLAY (LCD) :

The LCD which used is 16 X 2 LCD display .

For visual appearance of date , time and alarm time , welcome note LCD is used in

the project .

BUZZER :

The buzzer is used to produce the solved at prescribed time for a period of 5 sec.

The buzzer is driven by drivers circuit which is connected from transistor amplifier

circuit .

Page 6: Automatic College Bell Original Report

2.2. CIRCUIT DESCRIPTION CIRCUIT DESCRIPTION

2.1. 2.1. CIRCUIT DIAGRAM:CIRCUIT DIAGRAM:--

FigureFigure 2.1.1 2.1.1 Circuit Diagram of Automatic College BellCircuit Diagram of Automatic College Bell

Page 7: Automatic College Bell Original Report

2.2. 2.2. DESCRIPTION DESCRIPTION :-:-

In the circuit shown above, we provide 220V A.C. power supply

to the “Step-Down Transformer” which converts 220V A.C. into 12V A.C. (i.e. stepped

down the power supply). Now this 12V A.C. is converted into 12V D.C. with the help of

“Full Wave Rectifier” which consists of 4 Diodes.

voltage required for our circuit is 12V D.C. to operate . Second is 5V D.C. supply to

operate microcontroller “8952”. For this purpose we will use voltage regulator “LM7805”

which can take 8V -25V as I/P & provide 5V constant voltage.

Here we have used “” microcontroller to control various timing of the ringing. Here

we also use a “Crystal oscillator” which will provide the microcontroller a reference time .

We have used “C Language” to program this microcontroller . We have used

different types of capacitors and resistors in this circuit . The 8.2KΩ resistor is used for

RESET circuit to provide negative potential to RESET pin of microcontroller.

We have used IC DS 1307 which is a low-power clock/calendar with 56 bytes of

Battery - backed SRAM. It uses an external 32.768 kHz crystal. The oscillator circuit does

not require any external resistors or capacitors to operate. The accuracy of the clock is

dependent upon the accuracy of the crystal and the accuracy of the match between the

capacitive load of the oscillator circuit and the capacitive load for which the crystal was

trimmed. We have used LCD for the displaying the real time.

Here buzzer is connected from a voltage driver for delivering constant voltage

to the buzzer. Real time clock is connected to the microcontroller to giving continuous

time reference.

Page 8: Automatic College Bell Original Report

2.3. 2.3. OPERATIONOPERATION:-:-

Connect the circuit to 1- phase ,230V , 50 HZ AC Supply and Switch ON the

power.

As soon as power is ‘ON’ a ‘WELCOME’ will be appeared on the LCD display .

In Display the real time will display.

With the keypad looking into LCD display set the present time and required alarm

time . by using following switches

ENTER : to set the present time and it is also acts as ENTER or OK switch.

DEC : to decrease the value of time and date

INC : to increase the value of time and date

ALARM SET : to set the alarm time, with this switch we can set alarm time.

As the display appears with ‘WELCOME’ note set the current time by using

ENTER switch

After that there it asks to enter date as in format of DD/MM/YY then enter date by

using INC and DEC switches and press ENTER then it asks to enter time then

enter time in the format of HH: MM by using INC and DEC switches and press

ENTER then it asks enter day then by using INC and DEC switches and press

ENTER . setting of the preset time in hours and minutes and day also ( set only

when the display present is wrong).

In order to set alarm times use ALARM SET ,on pressing ALARM SET there it

asks to enter alarm time 1 then enter alarm time by using INC and DEC switches .

Page 9: Automatic College Bell Original Report

Repeat the above alarm set process for all 7 rings.

It has an Inbuilt Real Time Clock (DS1307 /DS 12c887) which tracks over the

Real Time. When this time equals to the Bell Ringing time, then the Bell is

switched on.

If one want to change the belling time. Input the desire time from the keypad

provided. At the set time the buzzer will ring.

One can set at most 7 ringing time at a time.

The input time must be set with respect of RTC.

Page 10: Automatic College Bell Original Report

COMPONENT REQUIREMENTCOMPONENT REQUIREMENT

4.1. 4.1. COMPONENT LISTCOMPONENT LIST:-:-

S. NO. NAME OF COMPONENTS TYPE QUANTITY

1. IC 89AT8252 Microcontroller 1

2. IC DS 1307 Real Time Clock 1

3. IC 7805 Voltage Regulator 5V 1

4. Transformer Step-Down 1

5. Crystal 11.059 MHz, 32.768KHz 1,1

6. Diode 1N4700 3

7. Relay Switch 12V Magnetic Relay 1

8. Resistor (8.2,10,1) KΩ,330E 1,4,1 & 1

9. Transistor (BC 107) NPN 5

10. Capacitors 1000 µF, 10 µF,104pF 1,1,3

11.. LED General 1

12. Display 16x2 LCD 4

13. Buzzer 6-12 V operated 1

Page 11: Automatic College Bell Original Report

14. I.C. Base 8 Pin & 40 Pin 1,1

4.2. 4.2. COMPONENT DESCRIPTIONCOMPONENT DESCRIPTION:-

4.2.1 AT89S52 :

1. Description

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

bytes of in-system programmable Flash me mory. The device is manufactured using

Atmel’s high-density nonvolatile memory technology and is compatible with the indus-try-

standard 80C51 instruction set and pinout. The on-chip Flash allows the program

memory to be reprogrammed in-system or by a conventional nonvolatile memory pro-

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

Page 12: Automatic College Bell Original Report

interrupt system to continue functioning. The Power-down mode saves the RAM con-tents

but freezes the o scillator, disabling all other chip functions until the next interrupt

or hardware reset.

IC 89S52

Page 13: Automatic College Bell Original Report

Pin Description

1 VCC Supply voltage.

2 GND Ground.

3 Port 0 Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can

Page 14: Automatic College Bell Original Report

sink eight TTL inputs . When 1s are written to port 0 pins, the pins can be used as high-

impedance inputs. Port 0 can also be configured to be the multiplexed low-order address/data

bus during accesses to external program and data memory. In this mode, P0 has internal pull-

ups.Port 0 also receives the code bytes during Flash programming and outputs the code bytes

dur-ing program verification. External pull-ups are required during program verification .

4 Port 1

Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can

sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high

by the inter-nal pull-ups and can be used as inputs. As inputs, Port 1 pins that are

externally being pulled low will source current (IIL) because of the internal pull-ups. In

addition, P1.0 and P1.1 can be configured to be the timer/ counter 2 external count input

(P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the

follow-ing table. Port 1 also receives the low-order address bytes during Flash

programming and verification.

5 Port 2 :

Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output

buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they

Page 15: Automatic College Bell Original Report

are pulled high by the inter-nal pull-ups and can be used as inputs. As inputs, Port 2

pins that are externally being pulled low will source current (IIL ) because of the

internal pull-ups. Port 2 emits the high-order address byte during fetches from

external program memory and dur-ing accesses to external data memory that use

16- bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal

pull-ups when emitting 1s. During accesses to external data memory that use 8-bit

addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function

Register. Port 2 also receives the high-order address bits and some control signals

during Flash program-ming and verification. Port Pin Alternate Functions

6 Port 3

Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output

buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled

high by the inter-nal pull-ups and can be used as inputs. As inputs, Port 3 pins that are

externally being pulled low will source current (IIL) because of the pull-ups.Port 3 receives

some control signals for Flash programming and verification.

Port 3 also serves the functions of various specia l features of the AT89S52, as shown in the

fol-lowing table.

7 RST

Page 16: Automatic College Bell Original Report

Reset input. A high on this pin for two machine cycles while the oscillator is running resets

the device. This pin drives high for 98 oscillator per iods after the Watchdog times out. The

DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default

state of bit DISRTO, the RESET HIGH out feature is enabled.

8 ALE/PROG

Address Latch Enable (ALE) is an output pulse for latching the low byte of the address

during accesses to external memory. This pin is also the program pulse input (PROG ) during

Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the

oscillator frequency and may be used for external timing or clocking purposes. Note,

however, that one ALE pulse is skipped dur-ing each access to external data memory. If

desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set,

ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly

pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external

execution mode.

9 PSEN

Program Store Enable (PSEN) is the read strobe to external program memory. When the

AT89S52 is executing code from external program memory, PSEN is activated twice each

machine cycle, except that two PSEN activations are skipped during each access to exter-nal

data memory.

10 EA/VPP :

External Access Enable. EA must be strapped to GND in order to enable the device to fetch

code from external program memory locations starting at 0000H up to FFFFH. Note,

however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should

be strapped to VCC for internal program executions.This pin also receives the 12-volt

programming enable voltage (VPP) during Flash programming.

Page 17: Automatic College Bell Original Report

11 XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

12 XTAL2 Output from the inverting oscillator amplifier.

4.2.2 16x2 LCD

A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers.

1. Command/Instruction Register - stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing, clearing the screen, setting the cursor position, controlling display etc.

2. Data Register - stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD.

Commonly used LCD Command codes:

Hex

CodeCommand to LCD Instruction Register

1 Clear screen display

2 Return home

4 Decrement cursor

6 Increment cursor

E Display ON, Cursor ON

80 Force the cursor to the beginning of the 1st line

C0 Force cursor to the beginning of the 2nd line

38 Use 2 lines and 5x7 matrix

Page 18: Automatic College Bell Original Report

Programming the LCD :

1. Data pin8 (DB7) of the LCD is busy flag and is read when R/W = 1 & RS = 0. When

busy flag=1, it means that LCD is not ready to accept data since it is busy with the internal

operations. Therefore before passing any data to LCD, its command register should be read

and busy flag should be checked.

2. To send data on the LCD, data is first written to the data pins with R/W = 0 (to specify

the write operation) and RS = 1 (to select the data register). A high to low pulse is given at

Pin Symbol Description1 VSS Ground2 VCC Main power supply3 VEE Power supply to control contrast

4 RSRegister Select

5 R/WRead/write

6 EN Enable7 DB0

To display letters or numbers, their ASCII codes are sent to data pins (with RS=1). Also instruction command codes are sent to these pins.

8 DB19 DB210 DB311 DB412 DB513 DB614 DB715 Led+ Backlight VCC

16 Led- Backlight Ground

Page 19: Automatic College Bell Original Report

EN pin when data is sent. Each write operation is performed on the positive edge of the

Enable signal.

3. To send a command on the LCD, a particular command is first specified to the data pins

with R/W = 0 (to specify the write operation) and RS = 0 (to select the command register). A

high to low pulse is given at EN pin when data is sent.

Displaying single character ‘A’ on LCD

The LCD is interfaced with microcontroller (8051). This microcontroller has 40 pins with

four 8-bit ports (P0, P1, P2, and P3). Here P1 is used as output port which is connected to data

pins of the LCD. The control pins (pin 4-6) are controlled by pins 2-4 of P0 port. Pin 3 is

connected to a preset of 10k? to adjust the contrast on LCD screen. This program uses the

above concepts of interfacing the LCD with controller by displaying the character ‘A’ on it.

4.2.3 DS 1307 (REAL TIME CLOCK)DS 1307 (REAL TIME CLOCK):-

PIN CONFIGURATIONS:-

Page 20: Automatic College Bell Original Report

Figure Figure 4.2.2.1 4.2.2.1 Pin DiagramPin Diagram

Figure 4.2.2.2 IC DS 1307

The DS1307 serial real-time clock (RTC) is a low power, full binary-

coded decimal (BCD) clock/calendar plus 56 bytes of NV SRAM. Address and data are

transferred serially through an I2C, bidirectional bus. The clock/calendar provides seconds,

minutes, hours, day, date, month, and year information. The end of the month date is

automatically adjusted for months with fewer than 31 days, including corrections for leap

year. The clock operates in either the 24-hour or 12-hour format with AM/PM indicator. The

DS1307 has a built-in power-sense circuit that detects power failures and automatically

switches to the backup supply. Timekeeping operation continues while the part operates from

the backup supply.

Feature of IC DS1307 are as follows:

Page 21: Automatic College Bell Original Report

Real-Time Clock (RTC) Counts Seconds

Minutes, Hours, Date of the Month, Month, Day of the week, and Year with Leap-Year

Compensation Valid Up to 2100

56-Byte, Battery-Backed, General-Purpose RAM with Unlimited Writes

Programmable Square-Wave Output Signal

Automatic Power-Fail Detect and Switch Circuitry

Consumes Less than 500nA in Battery-Backup

Mode with Oscillator Running

Optional Industrial Temperature Range: - 40°C to +85°C.

PIN DISCRIPTION:-

PIN Number Description

1 X1 – Crystal

2 X2 – Crystal

3 VBAT

4 GND

5 SDA

6 SCL

7 SQW/OUT

8 VCC

Page 22: Automatic College Bell Original Report

4.2.4 POWER SUPPLY:

The input to the circuit is applied from the regulated power supply. The a.c. input i.e.,

230V from the mains supply is step down by the transformer to 12V and is fed to a rectifier.

The output obtained from the rectifier is a pulsating d.c voltage. So in order to get a pure d.c

voltage, the output voltage from the rectifier is fed to a filter to remove any a.c components

present even after rectification. Now, this voltage is given to a voltage regulator to obtain a

pure constant dc voltage.

Power supply

Transformer:

Page 23: Automatic College Bell Original Report

Usually, DC voltages are required to operate various electronic equipment and these

voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus the a.c

input available at the mains supply i.e., 230V is to be brought down to the required voltage

level. This is done by a transformer. Thus, a step down transformer is employed to decrease

the voltage to a required level.

The transformer is a static electro-magnetic device that transforms one alternating

voltage (current) into another voltage (current). However, power remains the some during

the transformation. Transformers play a major role in the transmission and distribution of

ac power.

Principle: -

Transformer works on the principle of mutual induction. A transformer consists of

laminated magnetic core forming the magnetic frame. Primary and secondary coils are wound

upon the two cores of the magnetic frame, linked by the common magnetic flux. When an

alternating voltage is applied across the primary coil, a current flows in the primary coil

producing magnetic flux in the transformer core. This flux induces voltage in secondary coil.

Page 24: Automatic College Bell Original Report

Figure 4.2.4.1 Step-Up Transformer

Figure 4.2.4.2 Step-Down Transformer

Transformers are classified as: -

Based on position of the windings with respect to core i.e.

Core type transformer

Shell type transformer

Transformation ratio:

Step up transformer

Step down transformer

Core & shell types: Transformer is simplest electrical machine, which consists of windings

on the laminated magnetic core. There are two possibilities of putting up the windings on the

core.

Winding encircle the core in the case of core type transformer

Cores encircle the windings on shell type transformer.

Step up and Step down: In these voltage transformation takes place according to whether the

primary is high voltage coil or a low voltage coil.

Page 25: Automatic College Bell Original Report

Lower to higher-> Step up

Higher to lower-> Step down.

Filter:

Capacitive filter is used in this project. It removes the ripples from the output of

rectifier and smoothens the D.C. Output received from this filter is constant until the mains

voltage and load is maintained constant. However, if either of the two is varied, D.C. voltage

received at this point changes. Therefore a regulator is applied at the output stage.

Voltage regulator:

As the name itself implies, it regulates the input applied to it. A voltage regulator is an

electrical regulator designed to automatically maintain a constant voltage level. In this

project, power supply of 5V and 12V are required. In order to obtain these voltage levels,

7805 and 7812 voltage regulators are to be used. The first number 78 represents positive

supply and the numbers 05, 12 represent the required output voltage levels.

4.2.5 LM7805 VOLTAGE REGULATOR:-

The 78xx (also sometimes known as LM78xx) series of devices is a family of self-

contained fixed linear voltage regulator integrated circuits. The 78xx family is a very popular

choice for many electronic circuits which require a regulated power supply, due to their ease

of use and relative cheapness. When specifying individual ICs within this family, the xx is

replaced with a two-digit number, which indicates the output voltage the particular device is

designed to provide (for example, the 7805 has a 5 volt output, while the 7812 produces 12

volts). The 78xx line are positive voltage regulators, meaning that they are designed to

Page 26: Automatic College Bell Original Report

produce a voltage that is positive relative to a common ground. There is a related line of 79xx

devices which are complementary negative voltage regulators. 78xx and 79xx ICs can be

used in combination to provide both positive and negative supply voltages in the same circuit,

if necessary.

Figure 4.2.3.1 IC7805

78xx ICs have three terminals and are most commonly found in the TO220 form

factor, although smaller surface-mount and larger TO3 packages are also available from some

manufacturers. These devices typically support an input voltage which can be anywhere from

a couple of volts over the intended output voltage, up to a maximum of 35 or 40 volts, and

can typically provide up to around 1 or 1.5 amps of current (though smaller or larger

packages may have a lower or higher current rating).

A voltage regulator is used to produce a constant linear output voltage. It’s generally used

with AC to DC power supply. And also it can be used as well as a DC to DC voltage

converter . To regulating low voltage, most used device is one single IC. 7805, 7812, 7905

etc. 78xx series are design for positive and 79xx series are for Negative voltage regulator.

7805 is a three terminal +5v voltage regulator IC from 78XX chips

family. See 7805 pinout below. LM78XX series are from National Semiconductor. They are

linear positive voltage regulator IC; used to produce a fixed linear stable output voltage.

National Semiconductor has also negative voltage regulator chips family, they indicate with

LM 79XX. 78xx is used more than 79xx because negative voltage has a few usability

purposes as we see.Circuit diagram of 7805 Voltage Regulator

Page 27: Automatic College Bell Original Report

Fig: 7805 Voltage Regulator Circuit

Its output voltage is +5V DC that we need. You can supply any voltage in

input; the output voltage will be always regulated +5V. But my recommendation is, don’t

supply more than 18V or less than 8V in input. There used two capacitors in this voltage

regulator circuit, they aren’t mandatory to use. But it will be best if you use them. They

helped to produce a smooth regulated voltage at output. Use electrolyte capacitor instead of

ceramic capacitor.

One limitation of 7805 I have found that is its output current 1A maximum.

Otherwise it is a good voltage regulator if you are happy with 1A. But if you need over

400mA current in output then you should use a Heat Sink with IC LM7805. Otherwise it

may fall damage for overheating. Voltage regulator IC’s, with 3 pins, from LM7805 and

LM7812 series are excellent for usage in voltage regulator circuits. If you need higher

currents, up to 3A, you must add a complementary transistor, T2 in this schematic. In a

normal design, in case of a short circuit, the power dissipation can be very high. This problem

can be solved using the voltage regulator design present bellow.

Through electronics techniques, when short-circuits occurs this circuit design

reduces the maximum current consumption when the output voltage drops. At this voltage

regulator prototype the maximum current, with output shortcircuited it was only 0,5 A, so no

overheating occured. In this dc voltage regulator circuit, T1 is for current limitation. As soon

as the voltage on the R2+R3 becomes higher than 0,6-0,7 V, T1 opens, which leads to a

reduction to zero of the T2 base current. The voltage at which the short circuit protection

Page 28: Automatic College Bell Original Report

starts to act, is given by voltage sum on R2 and R3. R3 and R4 resistances form a T2 voltage

divider.

7805 voltage regulator circuit diagram

4.2.6 Rectifier:

The output from the transformer is fed to the rectifier. It converts A.C. into pulsating

D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a bridge rectifier

is used because of its merits like good stability and full wave rectification.

A diode bridge is an arrangement of four (or more) diodes in a bridge circuit configuration

that provides the same polarity of output for either polarity of input. When used in its most

common application, for conversion of an alternating current (AC) input into a direct current

(DC) output, it is known as a bridge rectifier. A bridge rectifier provides full-wave

rectification from a two-wire AC input, resulting in lower cost and weight as compared to a

rectifier with a 3-wire input from a transformer with a center-tapped secondary winding.

The essential feature of a diode bridge is that the polarity of the output is the same regardless

Page 29: Automatic College Bell Original Report

of the polarity at the input. The diode bridge circuit is also known as the Graetz circuit after

its inventor, physicist Leo Graetz, and the single-phase version, with four diodes, may also be

referred to as an H bridge.

Basic operation

According to the conventional model of current flow (originally established by Benjamin

Franklin and still followed by most engineers today), current is assumed to flow through

electrical conductors from the positive to the negative pole. In actuality, free electrons in a

conductor nearly always flow from the negative to the positive pole. In the vast majority of

applications, however, the actual direction of current flow is irrelevant. Therefore, in the

discussion below the conventional model is retained.

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

(positive) path to the output, and returns to the upper supply terminal via the blue (negative)

path.

Page 30: Automatic College Bell Original Report

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.

AC, half-wave and full wave rectified signals.

Prior to the availability of integrated circuits, a bridge rectifier was constructed from "discrete

components", i.e., separate diodes. Since about 1950, a single four-terminal component

containing the four diodes connected in a bridge configuration became a standard commercial

component and is now available with various voltage and current ratings.

Page 31: Automatic College Bell Original Report

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 pulsed DC (see diagram to right).

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. There is still some variation, known as "ripple". 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

discharge the capacitor safely. 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

Page 32: Automatic College Bell Original Report

large enough to discharge the capacitor in a reasonable time, but small enough to minimize

unnecessary power waste.

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.

When the capacitor is connected directly to the bridge, as shown, current flows in only a

small portion of each cycle, which may be undesirable. The transformer and 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. Adding a resistor, or better yet, an

inductor, between the bridge and capacitor can ensure that current is drawn over a large

portion of each cycle and a large current surge does not occur.

In older times, this crude power supply was often followed by passive

filters (capacitors plus resistors and inductors) to reduce the ripple further. When an inductor

is used this way it is often called a choke. The choke tends to keep the current (rather than the

voltage) more constant. Although the inductor gives the best performance, usually the resistor

is chosen for cost reasons.

Nowadays with the wide availability of voltage-regulator chips,

passive filters are less commonly used. The chips can compensate for changes in input

voltage and load current, which the passive filter does not, and pretty much eliminate ripple.

Some of these chips have fairly impressive power handling; in case this is not sufficient, they

can be combined with a power transistor.

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

Page 33: Automatic College Bell Original Report

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.

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.

4.2.7 CRYSTAL:-

A piezoelectric crystal is an electronic circuit that uses the mechanical resonance of a vibrating

crystal of piezoelectric material to create an electrical signal with a very precise frequency. This

frequency is commonly used to keep track of time (as in quartz wristwatches), to provide a stable

clock signal for digital integrated circuits, and to stabilize frequencies for radio transmitters and

receivers. The most common type of piezoelectric resonator used is the quartz crystal, so oscillator

circuits designed around them were called "crystal oscillators".

Page 34: Automatic College Bell Original Report

Figure 4.2.5.1 Crystal

The crystal oscillator circuit sustains oscillation by taking a voltage signal from the

quartz resonator, amplifying it, and feeding it back to the resonator. The rate of expansion

and contraction of the quartz is the resonant frequency, and is determined by the cut and size

of the crystal. When the energy of the generated output frequencies matches the losses in the

circuit, an oscillation can be sustained.

A regular timing crystal contains two electrically conductive plates, with a slice or

tuning fork of quartz crystal sandwiched between them. During startup, the circuit around the

crystal applies a random noise AC signal to it, and purely by chance, a tiny fraction of the

noise will be at the resonant frequency of the crystal. The crystal will therefore start

oscillating in synchrony with that signal. As the oscillator amplifies the signals coming out of

the crystal, the signals in the crystal's frequency band will become stronger, eventually

dominating the output of the oscillator. Natural resistance in the circuit and in the quartz

crystal filter out all the unwanted frequencies.

DIODE:-

Page 35: Automatic College Bell Original Report

Diode

A diode is a two-terminal device. Diodes have two active electrodes between which

the signal of interest may flow, and most are used for their unidirectional electric current

property.

The uni directionality most diodes exhibit is sometimes generically called the

rectifying property. The most common function of a diode is to allow an electric current in

one direction (called the forward biased condition) and to block the current in the opposite

direction (the reverse biased condition). Thus, the diode can be thought of as an electronic

version of a check valve.

Page 36: Automatic College Bell Original Report

Real diodes do not display such a perfect on-off directionality but have a more

complex non-linear electrical characteristic, which depends on the particular type of diode

technology. Diodes also have many other functions in which they are not designed to operate

in this on-off manner.

4.2.8 RESISTORS:-

A Resistor is a heat-dissipating element and in the electronic circuits it is mostly used for

either controlling the current in the circuit or developing a voltage drop across it, which could

be utilized for many applications. There are various types of resistors, which can be classified

according to a number of factors depending upon:

Material used for fabrication

Wattage and physical size

Intended application

Ambient temperature rating

Cost

Figure 4.2.8.1 Resistors

Resistors may be classified as

Fixed

Semi variable

Page 37: Automatic College Bell Original Report

Variable resistor.

In our project carbon resistors are being used. The electronic color code is

used to indicate the values or ratings of electronic components, very commonly for

resistors. Resistor values are always coded in ohms, capacitors in pico farads (pF),

inductors in micro henries (µH), and transformers in volts.

Figure 4.2.8.2

band A is first significant figure of component value

band B is the second significant figure

band C is the decimal multiplier

band D if present, indicates tolerance of value in percent (no color means 20%)

For example, a resistor with bands of yellow, violet, red, and gold will have first digit 4

(yellow in table below), second digit 7 (violet), followed by 2 (red) zeros: 4,700 ohms. Gold

signifies that the tolerance is ±5%, so the real resistance could lie anywhere between 4,465

and 4,935 ohms.

A useful mnemonic for remembering the first ten color codes matches the first letter of the

color code, by order of increasing magnitude is as follows:-

B. B. Roy of Great Britain Very Good Wife.

Color Coding of resistor is given in the following table:-

Page 38: Automatic College Bell Original Report

Figure 4.2.8.3

Page 39: Automatic College Bell Original Report

Figure 4.2.8.4

4.2.9 TRANSISTORS: -

A transistor consists of two junctions formed by sandwiching either p-type or n-type

semiconductor between a pair of opposite types. Accordingly, there are two types of

transistors namely: -

(1) n-p-n transistor

(2) p-n-p transistor

Figure 4.2.9.1

An n-p-n transistor is composed of two n-type semiconductors separated by a

thin section of p type. However two p sections separated by a thin section of n-type form

a p-n-p transistor.

A transistor raises the strength of a weak signal and thus acts as an amplifier. The

weak signal is applied between emitter base junction and output is taken across the load Rc

connected in the collector circuit (in common emitter configuration). In order to achieve

faithful amplification, the input circuit should always remain forward biased. To do so, a dc

voltage is applied in the input in addition to the signal. This dc Voltage is known as biasing

voltage and its magnitude and polarity should be such that it always keeps the input circuit

forward biased regardless of the polarity to the signal to be amplified.

Page 40: Automatic College Bell Original Report

As the input circuit has low resistance a small change in signal voltage causes an

appreciable change in emitter current. This causes change in collector current (by a factor

called current gain of transistor) due to transistor action. The collector current flowing

through a high load resistance Rc produces a large voltage across it. Thus a weak signal

applied to the input circuit appears in the amplified form in the collector circuit. This is how a

transistor acts as an amplifier.

4.2.10 CAPACITORS: -

The fundamental relation for the capacitance between two flat plates separated by

a dielectric material is given by: -

C=0.08854KA/D

Where: -

C= capacitance in pf.

K= dielectric constant

A=Area per plate in square cm.

D=Distance between two plates in cm

Figure 4.2.10.1 Capacitor

Page 41: Automatic College Bell Original Report

Design of capacitor depends on the proper dielectric material with particular type of

application. The dielectric material used for capacitors may be grouped in various classes like

Mica, Glass, air, ceramic, paper, Aluminum, electrolyte etc. The value of capacitance never

remains constant. It changes with temperature, frequency and aging. The capacitance value

marked on the capacitor strictly applies only at specified temperature and at low frequencies.

4.2.11 LED (Light Emitting Diode): -

Figure4.2.11.1 Light Emitting Diode

A light-emitting diode (LED) is a semiconductor diode that emits

incoherent narrow spectrum light when electrically biased in the forward

direction of the pn-junction, as in the common LED circuit. This effect is a form

of electroluminescence.

While sending a message in the form of bits such as 1,the data is

sent to the receiver side correspondingly the LED glows representing the data is

being received simultaneously when we send 8 as a data the LED gets off .

Page 42: Automatic College Bell Original Report

As in the simple LED circuit, The effect is a form of electroluminescence where incoherent

and narrow-spectrum light is emitted from the p-n junction.

LED’s are widely used as indicator lights on electronic devices and

increasingly in higher power applications such as flashlights and area lighting. An LED is

usually a small area (less than 1 mm2) light source, often with optics added to the chip to

shape its radiation pattern and assist in reflection. The color of the emitted light depends on

the composition and condition of the semi conducting material used, and can be infrared,

visible, or ultraviolet. Besides lighting, interesting applications include using UV-LED’s for

sterilization of water and disinfection of devices, and as a grow light to enhance

photosynthesis in plants.

COLOR CODING:

Color - Potential Difference

Infrared - 1.6 V

Red - 1.8 V to 2.1 V

Orange - 2.2 V

Yellow - 2.4 V

Page 43: Automatic College Bell Original Report

Green - 2.6 V

Blue - 3.0 V to 3.5 V

White - 3.0 V to 3.5 V

Ultraviolet - 3.5V

(Close-up of a typical LED in its case showing the internal structure)

ADVANTAGES:

LED’s have many advantages over other technologies like lasers. As

compared to laser diodes or IR sources

LED’s are conventional incandescent lamps. For one thing, they don't

have a filament that will burn out, so they last much longer. Additionally,

their small plastic bulb makes them a lot more durable. They also fit

more easily into modern electronic circuits.

The main advantage is efficiency. In conventional incandescent bulbs, the

light-production process involves generating a lot of heat (the filament

must be warmed). Unless you're using the lamp as a heater, because a

Page 44: Automatic College Bell Original Report

huge portion of the available electricity isn't going toward producing

visible light.

LED’s generate very little heat. A much higher percentage of the

electrical power is going directly for generating light, which cuts down

the electricity demands considerably.

LED’s offer advantages such as low cost and long service life. Moreover

LED’s have very low power consumption and are easy to maintain.

DISADVANTAGES OF LEDS:

LED’s performance largely depends on the ambient temperature of the

operating environment.

LED’s must be supplied with the correct current.

LED’s do not approximate a "point source" of light, so cannot be used in

applications needing a highly collimated beam.

But the disadvantages are quite negligible as the negative properties of LED’s

do not apply and the advantages far exceed the limitations.

LED INTERFACING WITH THE MICROCONTROLLER

LED stands for Light Emitting Diode. LEDs are the most widely used input/output

devices of the 8051.

Microcontroller port pins cannot drive these LEDs as these require high currents to

switch on. Thus the positive terminal of LED is directly connected to Vcc, power supply and

the negative terminal is connected to port pin through a current limiting resistor. This current

Page 45: Automatic College Bell Original Report

limiting resistor is connected to protect the port pins from sudden flow of high currents from

the power supply.

Thus in order to glow the LED, first there should be a current flow through the LED.

In order to have a current flow, a voltage difference should exist between the LED terminals.

To ensure the voltage difference between the terminals and as the positive terminal of LED is

connected to power supply Vcc, the negative terminal has to be connected to ground. Thus

this ground value is provided by the microcontroller port pin. This can be achieved by writing

an instruction “CLR P1.0”. With this, the port pin P1.0 is initialized to zero and thus now a

voltage difference is established between the LED terminals and accordingly, current flows

and therefore the LED glows. LED and switches can be connected to any one of the four port

pins.

Fig 3.2.1: LED Interfacing with 89C51

As its name implies it is a diode, which emits light when forward biased. Charge carrier

recombination takes place when electrons from the N-side cross the junction and recombine

with the holes on the P side. Electrons are in the higher conduction band on the N side

whereas holes are in the lower valence band on the P side. During recombination, some of

the energy is given up in the form of heat and light. In the case of semiconductor materials

like Gallium arsenide (GaAs), Gallium phosphide (GaP) and Gallium arsenide phosphide

(GaAsP) a greater percentage of energy is released during recombination and is given out in

the form of light. LED emits no light when junction is reverse biased.

Page 46: Automatic College Bell Original Report

4.2.12 LIQUID CRYSTAL DISPLAY:

LCD stands for Liquid Crystal Display. LCD is finding wide spread use

replacing LEDs (seven segment LEDs or other multi segment LEDs) because of the

following reasons:

1. The declining prices of LCDs.2. The ability to display numbers, characters and graphics.

This is in contrast to LEDs, which are limited to numbers and a few characters.3.

Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the task

of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep displaying

the data.4. Ease of programming for characters and graphics.These components are

“specialized” for being used with the microcontrollers, which means that they cannot be

activated by standard IC circuits. They are used for writing different messages on a miniature

LCD.

LCD DISPLAY

Page 47: Automatic College Bell Original Report

A model described here is for its low price and great possibilities most frequently

used in practice. It is based on the HD44780 microcontroller (Hitachi) and can display

messages in two lines with 16 characters each. It displays all the alphabets, Greek letters,

punctuation marks, mathematical symbols etc. In addition, it is possible to display symbols

that user makes up on its own. Automatic shifting message on display (shift left and right),

appearance of the pointer, backlight etc. are considered as useful characteristics.

PIN DESCRIPTION OF LCD:

Page 48: Automatic College Bell Original Report

FunctionPin

NumberName

Logic

StateDescription

Ground 1 Vss - 0V

Power supply 2 Vdd - +5V

Contrast 3 Vee - 0 - Vdd

Control of

operating

4 RS0

1

D0 – D7 are interpreted as

commands

D0 – D7 are interpreted as

data

5 R/W0

1

Write data (from controller

to LCD)

Read data (from LCD to

controller)

6 E

0

1

From 1

to 0

Access to LCD disabled

Normal operating

Data/commands are

transferred to LCD

Data /

commands

7 D0 0/1 Bit 0 LSB

8 D1 0/1 Bit 1

9 D2 0/1 Bit 2

10 D3 0/1 Bit 3

11 D4 0/1 Bit 4

12 D5 0/1 Bit 5

13 D6 0/1 Bit 6

14 D7 0/1 Bit 7 MSB

Page 49: Automatic College Bell Original Report

Pins Functions:

There are pins along one side of the small printed board used for connection to the

microcontroller. There are total of 14 pins marked with numbers (16 in case the background

light is built in). Their function is described in the above table.

LCD screen consists of two lines with 16 characters each. Each character consists of

5x7 dot matrix. Contrast on display depends on the power supply voltage and whether

messages are displayed in one or two lines. For that reason, variable voltage 0-Vdd is applied

on pin marked as Vee. Trimmer potentiometer is usually used for that purpose. Some

versions of displays have built in backlight (blue or green diodes). When used during

operating, a resistor for current limitation should be used (like with any LE diode).

CD Interfacing

LCD Basic Commands:

All data transferred to LCD through outputs D0-D7 will be interpreted as commands

or as data, which depends on logic state on pin RS:

Page 50: Automatic College Bell Original Report

RS = 1 - Bits D0 - D7 are addresses of characters that should be displayed. Built in processor

addresses built in “map of characters” and displays corresponding symbols.

Displaying position is determined by DDRAM address. This address is either previously

defined or the address of previously transferred character is automatically incremented.

RS = 0 - Bits D0 - D7 are commands which determine display mode. List of commands

which LCD recognizes are given in the table below:

Table :LCD Commands

Command RS RW D7 D6 D5 D4 D3 D2 D1 D0Execution

Time

Clear display 0 0 0 0 0 0 0 0 0 1 1.64mS

Cursor home 0 0 0 0 0 0 0 0 1 x 1.64mS

Entry mode set 0 0 0 0 0 0 0 1 I/D S 40uS

Display on/off control 0 0 0 0 0 0 1 D U B 40uS

Cursor/Display Shift 0 0 0 0 0 1 D/C R/L x x 40uS

Function set 0 0 0 0 1 DL N F x x 40uS

Set CGRAM address 0 0 0 1 CGRAM address 40uS

Set DDRAM address 0 0 1 DDRAM address 40uS

Read “BUSY” flag (BF) 0 1 BF DDRAM address -

Write to CGRAM or DDRAM 1 0 D7 D6 D5 D4 D3 D2 D1 D0 40uS

Read from CGRAM or DDR 1 1 D7 D6 D5 D4 D3 D2 D1 D0 40uS

I D: 1 = Increment (by 1) R/L: 1 = Shift right

0 = Decrement (by 1) 0 = Shift left

Page 51: Automatic College Bell Original Report

S: 1 = Display shift on DL: 1 = 8-bit interface

0 = Display shift off 0 = 4-bit interface

D: 1 = Display on N: 1 = Display in two lines

0 = Display off 0 = Display in one line

U: 1 = Cursor on F: 1 = Character format 5x10 dots

0 = Cursor off 0 = Character format 5x7 dots

B : 1 = Cursor blink on D/C: 1 = Display shift

0 = Cursor blink off 0 = Cursor shift

LCD Initialization:

Once the power supply is turned on, LCD is automatically cleared. This process lasts for approximately 15mS. After that, display is ready to operate. The mode of operating is set by default. This means that:

1. Display is cleared

2. Mode

DL = 1 Communication through 8-bit interface

N = 0 Messages are displayed in one line

F = 0 Character font 5 x 8 dots

3. Display/Cursor on/off

D = 0 Display off

U = 0 Cursor off

B = 0 Cursor blink off

4. Character entry

Page 52: Automatic College Bell Original Report

ID = 1 Addresses on display are automatically incremented by 1

S = 0 Display shift off

Automatic reset is mainly performed without any problems. Mainly but not always! If for any reason

power supply voltage does not reach full value in the course of 10mS, display will start perform

completely unpredictably. If voltage supply unit cannot meet this condition or if it is needed to

provide completely safe operating, the process of initialization by which a new reset enabling display

to operate normally must be applied. Algorithm according to the initialization is being performed

depends on whether connection to the microcontroller is through 4- or 8-bit interface. All left over

to be done after that is to give basic commands and of course- to display messages.

Page 53: Automatic College Bell Original Report
Page 54: Automatic College Bell Original Report

5.KIEL SOFTWARE

Many companies provide the 8952 assembler, some of them provide

shareware version of their product on the Web, Kiel is one of them. We can download them

from their Websites. However, the size of code for these shareware versions is limited and we

have to consider which assembler is suitable for our application.

KIEL:

This is an IDE (Integrated Development Environment) that helps you write,

compile, and debug embedded programs. It encapsulates the following components:

A project manager

A make facility

Tool configuration

Editor

A powerful debugger

To get start here are some several example programs

Page 55: Automatic College Bell Original Report

BUILDING AN APPLICATION:

To build (compile, assemble, and link) an application in uVision2, you must:

Select Project - Rebuild all target files or Build target. UVision2 compiles,

assembles, and links the files in your project.

CREATING YOUR OWN APPLICATION:

To create a new project, you must:

Select Project - New Project.

Select a directory and enter the name of the project file.

Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from the

Device

Database.

Create source files to add to the project.

Select Project - Targets, Groups, and Files. Add/Files, select Source Group1, and add

the source files to the project.

Select Project - Options and set the tool options. Note when you select the target

device from the Device Database all-special options are set automatically. You only

need to configure the memory map of your target hardware. Default memory model

settings are optimal for most.

Page 56: Automatic College Bell Original Report

APPLICATIONS:

Select Project - Rebuild all target files or Build target.

DEBUGGING AN APPLICATION:

To debug an application created, you must:

Select Debug - Start/Stop Debug Session.

Use the Step toolbar buttons to single-step through your program. You may enter G,

main in the Output Window to execute to the main C function.

Open the Serial Window using the Serial #1 button on the toolbar.

Debug your program using standard options like Step, Go, Break, and so on.

LIMITATIONS OF EVALUATION SOFTWARE:

The following limitations apply to the evaluation versions of the C51, C251, or C166

tool chains. C51 Evaluation Software Limitations:

The compiler, assembler, linker, and debugger are limited to 2 Kbytes of object code

but source Code may be any size. Programs that generate more than 2 Kbytes of

object code will not compile, assemble, or link the startup code generated includes

LJMP's and cannot be used in single-chip devices supporting Less than 2 Kbytes of

program space like the Philips 750/751/752.

The debugger supports files that are 2 Kbytes and smaller.

Programs begin at offset 0x0800 and cannot be programmed into single-chip devices.

Page 57: Automatic College Bell Original Report

No hardware support is available for multiple DPTR registers.

No support is available for user libraries or floating-point arithmetic.

EVALUATION SOFTWARE:

Code-Banking Linker/Locator

Library Manager.

RTX-51 Tiny Real-Time Operating System.

PERIPHERAL SIMULATION:

The Keil debugger provides complete simulation for the CPU and on chip peripherals

of most embedded devices. To discover which peripherals of a device are supported, in u

vision2. Select the Simulated Peripherals item from the Help menu. You may also use the

web-based device database. We are constantly adding new devices and simulation support for

on-chip peripherals so be sure to check Device Database often.

1. ABOUT KEIL COMPILER:

KEIL SOFTWARE:

Keil development tools for the 8051 Microcontroller Architecture support every level

of software developer from the professional applications engineer to the student just learning

about embedded software development.

The industry-standard Keil C Compilers, Macro Assemblers, Debuggers, Real-time

Kernels, Single-board Computers, and Emulators support all 8051 derivatives and help you

get your projects completed on schedule.

Page 58: Automatic College Bell Original Report

6.Simulation

The µVision Simulator allows you to debug programs using only your PC using

simulation drivers provided by Keil and various third-party developers. A good simulation

environment, like µVision, does much more than simply simulate the instruction set of a

microcontroller — it simulates your entire target system including interrupts, startup code,

on-chip peripherals, external signals, and I/O.

This software is used for execution of microcontroller programs.

Keil development tools for the MC architecture support every level of software developer

from the professional applications engineer to the student just learning about embedded

software development. The industry-standard keil C compilers, macro assemblers, debuggers,

real, time Kernels, Single-board computers and emulators support all microcontroller

derivatives and help you to get more projects completed on schedule. The keil software

development tools are designed to solve the complex .

Problems facing embedded software developers.

When starting a new project, simply select the microcontroller you the

device database and the µvision IDE sets all compiler, assembler, linker,

and memory options for you.

Numerous example programs are included to help you get started with the

most popular embedded avr devices.

The keil µ Vision debugger accurately simulates on-chip peripherals

(PC, CAN, UART, SPI,Interrupts,I/O ports, A/D converter, D/A converter

and PWM modules)of your avr device. Simulation helps you understand h/w

configurations and avoids time wasted on setup problems. Additionally,with

simulation, you can write and test applications before target h/w is available.

Page 59: Automatic College Bell Original Report

When you are ready to begin testing your s/w application with target h/w,

use the MON51, MON390, MONADI, or flash MON51 target monitors, the

ISD51 In-System Debugger, or the ULINK USB-JTAG adapter to download

and test program code on your target system.

POWER SUPPLY :

HERE THE BATTERY IS CONNECTED 40TH PIN OF MICROCONTROLLER

SOURCE CODE

1. Click on the Keil uVision Icon on Desktop

2. The following fig will appear

3. Click on the Project menu from the title bar

Page 60: Automatic College Bell Original Report

4. Then Click on New Project

5.Save the Project by typing suitable project name with no extension in u r own folder sited in either C:\ or D:\

Page 61: Automatic College Bell Original Report

5. Then Click on Save button above.

6. Select the component for u r project. i.e. Atmel……

7. Click on the + Symbol beside of Atmel

Page 62: Automatic College Bell Original Report

8. Select AT89C52 as shown below

Page 63: Automatic College Bell Original Report

9. Then Click on “OK”

10. The Following fig will appear

Page 64: Automatic College Bell Original Report

11. Then Click either YES or NO………mostly “NO”

12. Now your project is ready to USE

13. Now double click on the Target1, you would get another option “Source group 1” as

shown in next page.

Page 65: Automatic College Bell Original Report

14. Click on the file option from menu bar and select “new”

Page 66: Automatic College Bell Original Report

15. The next screen will be as shown in next page, and just maximize it by double clicking on

its blue boarder.

Page 67: Automatic College Bell Original Report

16. Now start writing program in either in “C” or “ASM”

17. For a program written in Assembly, then save it with extension “. asm” and for “C”

based program save it with extension “ .C”

18. Now right click on Source group 1 and click on “Add files to Group Source”

Page 68: Automatic College Bell Original Report

19. Now you will get another window, on which by default “C” files will appear.

20. Now select as per your file extension given while saving the file

Page 69: Automatic College Bell Original Report

21. Click only one time on option “ADD”

22. Now Press function key F7 to compile. Any error will appear if so

happen.

23. If the file contains no error, then press Control+F5 simultaneously.

24. The new window is as follows

Page 70: Automatic College Bell Original Report

25. Then Click “OK”

Page 71: Automatic College Bell Original Report

26. Now Click on the Peripherals from menu bar, and check your

required port as shown in fig below

27. Drag the port a side and click in the program file.

28. Now keep Pressing function key “F11” slowly and observe.

Page 72: Automatic College Bell Original Report

29. You are running your program successfully

7.BOARD TYPES

The two most popular PCB types are:

Single Sided Boards

Double Sided Boards

The single sided PCBs are mostly used in entertainment electronics where

manufacturing costs have to be kept at a minimum. However in industrial electronics cost

factors cannot be neglected and single sided boards should be used wherever a particular

circuit can be accommodated on such boards.

Double-sided PCBs can be made with or without plated through holes. The

production of boards with plated through holes is fairly expensive. Therefore plated through

hole boards are only chosen where the circuit complexities and density of components does

not leave any other choice.

DESIGN SPECIFICATION:-

4.2.1 STEPS TAKEN WHILE PREPARING CIRCUIT

4.2.1.1 PCB DESIGNING:-

The main purpose of printed circuit is in the routing of electric currents and signal through a

thin copper layer that is bounded firmly to an insulating base material sometimes called the

substrate. This base is manufactured with an integrally bounded layer of thin copper foil

which has to be partly etched or removed to arrive at a pre-designed pattern to suit the circuit

connections or other applications as required.

Page 73: Automatic College Bell Original Report

The term printed circuit board is derived from the original method where a printed pattern is

used as the mask over wanted areas of copper. The PCB provides an ideal baseboard upon

which to assemble and hold firmly most of the small components.

From the constructor’s point of view, the main attraction of using PCB is its role as the

mechanical support for small components. There is less need for complicated and time

consuming metal work of chassis contraception except perhaps in providing the final

enclosure. Most straight forward circuit designs can be easily converted in to printed wiring

layer the thought required to carry out the inversion cab footed high light an possible error

that would otherwise be missed in conventional point to point wiring .The finished project is

usually neater and truly a work of art.

Actual size PCB layout for the circuit shown is drawn on the copper board. The board is then

immersed in FeCl3 solution for 12 hours. In this process only the exposed copper portion is

etched out by the solution.

Now the petrol washes out the paint and the copper layout on PCB is rubbed with a smooth

sand paper slowly and lightly such that only the oxide layers over the Cu are removed. Now

the holes are drilled at the respective places according to component layout as shown in

figure.

LAYOUT DESIGN:-

When designing the layout one should observe the minimum size

(component body length and weight). Before starting to design the layout we need all the

required components in hand so that an accurate assessment of space can be made. Other

space considerations might also be included from case to case of mounted components over

the printed circuit board or to access path of present components.

It might be necessary to turn some components around to a different angular position

so that terminals are closer to the connections of the components. The scale can be checked

Page 74: Automatic College Bell Original Report

by positioning the components on the squared paper. If any connection crosses, then one can

reroute to avoid such condition.

All common or earth lines should ideally be connected to a common line routed

around the perimeter of the layout. This will act as the ground plane. If possible try to route

the outer supply line to the ground plane. If possible try to route the other supply lines around

the opposite edge of the layout through the center. The first set is tearing the circuit to

eliminate the crossover without altering the circuit detail in any way.

Plan the layout looking at the topside to this board. First this should be translated

inversely, later for the etching pattern large areas are recommended to maintain good copper

adhesion. It is important to bear in mind always that copper track width must be according to

the recommended minimum dimensions and allowance must be made for increased width

where termination holes are needed. From this aspect, it can become little tricky to negotiate

the route to connect small transistors.

There are basically two ways of copper interconnection patterns under side the board.

The first is the removal of only the amount of copper necessary to isolate the junctions of the

components to one another. The second is to make the interconnection pattern looking more

like conventional point wiring by routing uniform width of copper from component to

component.

ETCHING PROCESS:-

Etching process requires the use of chemicals. Acid resistant dishes and running water

supply. Ferric chloride is mostly used solution but other etching materials such as ammonium

per sulphate can be used. Nitric acid can be used but in general it is not used due to poisonous

fumes. The pattern prepared is glued to the copper surface of the board using a latex type of

adhesive that can be cubed after use. The pattern is laid firmly on the copper using a very

sharp knife to cut round the pattern carefully to remove the paper corresponding to the

required copper pattern areas. Then apply the resistant solution, which can be a kind of ink

Page 75: Automatic College Bell Original Report

solution for the purpose of maintaining smooth clean outlines as far as possible. While the

board is drying, test all the components.

Before going to next stage, check the whole pattern and cross check with the circuit

diagram. Check for any free metal on the copper. The etching bath should be in a glass or

enamel disc. If using crystal of ferric- chloride these should be thoroughly dissolved in water

to the proportion suggested. There should be 0.5 lt. of water for 125 gm of crystal.

To prevent particles of copper hindering further etching, agitate the solutions

carefully by gently twisting or rocking the tray. The board should not be left in the bath a

moment longer than is needed to remove just the right amount of copper. Inspite of there

being a resistive coating there is no protection against etching away through exposed copper

edges. This leads to over etching. Have running water ready so that etched board can be

removed properly and rinsed. This will halt etching immediately.

Drilling is one of those operations that calls for great care. For most purposes a

0.5mm drill is used. Drill all holes with this size first those that need to be larger can be easily

drilled again with the appropriate larger size.

COMPONENT ASSEMBLY: -

From the greatest variety of electronic components available, which runs into

thousands of different types it is often a perplexing task to know which is right for a given

job.

There could be damage such as hairline crack on PCB. If there are, then they can

be repaired by soldering a short link of bare copper wire over the affected part.

The most popular method of holding all the items is to bring the wires far apart

after they have been inserted in the appropriate holes. This will hold the component in

position ready for soldering.

Page 76: Automatic College Bell Original Report

Some components will be considerably larger .So it is best to start mounting the

smallest first and progressing through to the largest. Before starting, be certain that no

further drilling is likely to be necessary because access may be impossible later.

Next will probably be the resistor, small signal diodes or other similar size

components. Some capacitors are also very small but it would be best to fit these

afterwards. When fitting each group of components mark off each one on the circuit as it

is fitted so that if we have to leave the job we know where to recommence.

Although transistors and integrated circuits are small items there are good reasons for

leaving the soldering of these until the last step. The main point is that these components are

very sensitive to heat and if subjected to prolonged application of the soldering iron, they

could be internally damaged.

All the components before mounting are rubbed with sand paper so that oxide layer is

removed from the tips. Now they are mounted according to the component layout.

SOLDERING: -

This is the operation of joining the components with PCB after this operation the

circuit will be ready to use to avoid any damage or fault during this operation following care

must be taken.

1. A longer duration contact between soldering iron bit & components lead can exceed

the temperature rating of device & cause partial or total damage of the device. Hence before

soldering we must carefully read the maximum soldering temperature & soldering time for

device.

2. The wattage of soldering iron should be selected as minimum as permissible for that

soldering place.

3. To protect the devices by leakage current of iron its bit should be earthed properly.

Page 77: Automatic College Bell Original Report

4. We should select the soldering wire with proper ratio of Pb & Tn to provide the

suitable melting temperature.

5. Proper amount of good quality flux must be applied on the soldering point to avoid

dry soldering.

8.APPLICATION & ADVANTAGES

1. It can be used in the college, school for belling purpose.

2. It can be used in the any type of examination for belling because we can set

the ringing time.

3. Automatic scheduling of college bell is possible.

4. Compact in size so takes less space.

5. Time editable facility is available

LIMITATIONS

The all ringing time should be given at a time.

The previous ringing time will removed from the memory itself.

We have used the 24-hour mode for the input of the ringing time.

Page 78: Automatic College Bell Original Report

9.PROGRAM

#include<reg51.h>

#include<intrins.h>

#include "lcddisplay.h"

sbit SCL=P3^6;

sbit SDA=P3^7;

sbit enter = P2^0;

sbit dec = P2^1;

sbit inc = P2^2;

sbit alarm_sw = P2^3;

sbit bel = P2^7;

void start(void);

void write(unsigned char,unsigned char);

unsigned char read(unsigned char);

void ptos(unsigned char );

void stop(void);

Page 79: Automatic College Bell Original Report

void delay(unsigned int );

void settime(void);

unsigned char COUNT,dat,add,hr,min,x,binbyte,B1,B2,B3,digit1,digit2,digit3,digit4;

unsigned int i;

unsigned char h_break[10],m_break[10],d11,d22,memory,zzz;

void delay1(unsigned int itime);

unsigned char time[7],temptime[7],alarmcheck,day,type,dispcount=0,dispdata;

bit pm=0,pm1,dayselect;

void daydisplay(unsigned char);

void main()

unsigned char z;

dayselect=0;

bel=0;

delay(100);

lcd_init();

lcd_init();

msgdisplay("welcome");

lcdcmd(0x0c);

z=read(0);

bel=0;

if(z==0x80)

Page 80: Automatic College Bell Original Report

start:

lcdcmd(0x01);

msgdisplay(" SET THE TIME ");

type=6;

settime();

write(0,0);

delay(10);

write(1,temptime[1]);

delay(10);

write(2,temptime[0]);

delay(10);

for(add=4;add<7;add++)

write(add,temptime[add-1]);

delay(10);

/*

write(0x07,0x10);

delay(100);

*/

write(0x20,0);

delay(10);

dayselect=1;

Page 81: Automatic College Bell Original Report

delay(300);

alarmcheck=read(0x20);

timedisp:

if(alarmcheck)

d22=0x15;

for(d11=0;d11<7;d11++)

h_break[d11]=read(d22++);

delay(100);

m_break[d11]=read(d22++);

delay(100);

back1:

lcdcmd(0x01);

msgdisplay("Dt:");

while(1)

lcdcmd(0x04);

for(add=0;add<7;add++)

Page 82: Automatic College Bell Original Report

time[add]=read(add);

z=time[add];

if(add==0)

lcdcmd(0x04);

lcdcmd(0xC9);

if(add==4)

lcdcmd(0x06);

lcdcmd(0x84);

if(add==2)

z=time[2]&(0x60);

if(z==0x40)

pm1=0;

else

pm1=1;

z=time[2]&0x1f;

B1=z&0x0f;

B2=(z&0xf0)>>4;

if(add<3)

Page 83: Automatic College Bell Original Report

lcddata(B1+48);

lcddata(B2+48);

if(add>3)

lcddata(B2+48);

lcddata(B1+48);

if(add<2)

lcddata(':');

if((add>3)&&(add<6))

lcddata('/');

delay(5);

lcdcmd(0xca);

if(pm1)

msgdisplay("pm");

else

msgdisplay("am");

if(dayselect==1)

lcdcmd(0x1);

Page 84: Automatic College Bell Original Report

msgdisplay("SELECT DAY: SUN");

while(enter==1)

lcdcmd(0x8d);

lcdcmd(0xe);

if(inc==0)

while(inc==0);

if(day<8)

day=day+1;

daydisplay(day);

if(dec==0)

while(dec==0);

if(day>1)

day=day-1;

daydisplay(day);

write(3,day);

while(enter==0);

dayselect=0;

Page 85: Automatic College Bell Original Report

lcdcmd(0x0c);

goto timedisp;

lcdcmd(0x8d);

daydisplay(time[3]);

if(alarmcheck)

if(((time[2]==h_break[0])&&(time[1]==m_break[0])&&(time[0]<5)))

bel=1;

lcd_init();

lcd_init();

delay(500);

goto back1;

else

if(((time[2]==h_break[1])&&(time[1]==m_break[1])&&(time[0]<5)))

bel=1;

lcd_init();

lcd_init();

delay(500);

goto back1;

Page 86: Automatic College Bell Original Report

else

if(((time[2]==h_break[2])&&(time[1]==m_break[2])&&(time[0]<5)))

bel=1;

lcd_init();

lcd_init();

delay(500);

goto back1;

else

if(((time[2]==h_break[3])&&(time[1]==m_break[3])&&(time[0]<5)))

bel=1;

lcd_init();

lcd_init();

delay(500);

goto back1;

else

if(((time[2]==h_break[4])&&(time[1]==m_break[4])&&(time[0]<5)))

bel=1;

Page 87: Automatic College Bell Original Report

lcd_init();

lcd_init();

delay(500);

goto back1;

else

if(((time[2]==h_break[5])&&(time[1]==m_break[5])&&(time[0]<5)))

bel=1;

lcd_init();

lcd_init();

delay(500);

goto back1;

else

if(((time[2]==h_break[6])&&(time[1]==m_break[6])&&(time[0]<5)))

bel=1;

lcd_init();

lcd_init();

delay(500);

goto back1;

Page 88: Automatic College Bell Original Report

/*else

if(((time[2]==h_break[7])&&(time[1]==m_break[7])&&(time[0]<10)))

bel=0;

else

if(((time[2]==h_break[8])&&(time[1]==m_break[8])&&(time[0]<10)))

bel=0;

//else

//if(((time[2]==h_break[9])&&(time[1]==m_break[9])&&(time[0]<10)))

// bel=0; */

else

bel=0;

if(alarm_sw==0)

while(alarm_sw==0);

alarmcheck=read(0x20);

delay(200);

alarmcheck=~alarmcheck;

write(0x20,alarmcheck);

if(alarmcheck)

lcdcmd(0x01);

msgdisplay("ENTER BELL TIMES");

Page 89: Automatic College Bell Original Report

delay(500);

memory=0x15;

for(zzz=1;zzz<8;zzz++)

lcdcmd(0x01);

msgdisplay("ENTR BELL TIME ");

lcddata(zzz+48);

type=3;

settime();

write(memory++,temptime[0]);

delay(10);

write(memory++,temptime[1]);

delay(10);

delay(500);

goto timedisp;

if(enter==0)

lcdcmd(0x01);

msgdisplay("SET THE TIME ");

while(enter==0);

Page 90: Automatic College Bell Original Report

goto start;

void settime(void)

unsigned char keycount=0,h,g,d1,d2,cmd,uplimit;

lcdcmd(0xC0);

if(type==6)

msgdisplay("hh:mmAM dd/mm/yr");

else

msgdisplay("hh:mmAM ");

lcdcmd(0x0e); //cursor blinking

while(keycount<type) // to select alarm or current time

h=0;

if(keycount==0)

cmd=0xc0;

uplimit=12;

else

if(keycount==1)

Page 91: Automatic College Bell Original Report

cmd=0xc3;

uplimit=59;

else

if(keycount==2)

cmd=0xc5;

uplimit=1;

else

if(keycount==3)

cmd=0xc8;

uplimit=31;

else

if(keycount==4)

cmd=0xcb;

uplimit=12;

else

Page 92: Automatic College Bell Original Report

if(keycount==5)

cmd=0xce;

uplimit=99;

else;

while(enter==1)

lcdcmd(cmd);

while((inc==1)&&(dec==1)&&(enter==1)); //wait till any switch is pressed

if(inc==0)

while(inc==0);

if(h==uplimit)

h=0;

h=h+1;

if(dec==0)

while(dec==0);

if(h)

h=h-1;

else

Page 93: Automatic College Bell Original Report

h=uplimit;

if(keycount==2)

if(h)

msgdisplay("pm");

pm=1;

else

msgdisplay("am");

pm=0;

else

g=h;

d1=g/10;

d2=g%10;

lcddata(d1+48);

lcddata(d2+48);

g=(d1<<4)|(d2%10);

Page 94: Automatic College Bell Original Report

temptime[keycount]=g;

if(keycount==2)

lcddata(' ');

keycount=keycount+1;

while(enter==0);

delay(500);

if(pm)

temptime[0]= temptime[0]|0x60;

else

temptime[0]=temptime[0]|0x40;

lcdcmd(0x01); // clear the lcd

lcdcmd(0x0c); //curser blink off;

void write(unsigned char add,unsigned char dat)

start();

ptos(0Xd0); //device addr in write mode//

ptos(add); //byte addr//

ptos(dat); //data//

stop();

Page 95: Automatic College Bell Original Report

//%%%%%%%%%%%%%%%%%%%% READING FUNCTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

unsigned char read(unsigned char add)

unsigned char v,i;

start();

ptos(0Xd0); //device addr in write mode//

ptos(add); //byte addr//

_nop_();

start();

ptos(0Xd1); //device addr in read mode//

v=0;

SDA=1;

for(i=0;i<=7;i++)

SCL=0;

_nop_();

_nop_();

SCL=1;

v=v|SDA;

if(i<=6)

v=v<<1;

Page 96: Automatic College Bell Original Report

SCL=0;

delay1(100);

stop();

return(v);

// ####################################### DATA READING FUNCTION ##################################

void daydisplay(unsigned char day)

if(day==1)

msgdisplay("SUN");

else

if(day==2)

msgdisplay("MON");

else

if(day==3)

msgdisplay("TUE");

else

if(day==4)

msgdisplay("WED");

else

if(day==5)

Page 97: Automatic College Bell Original Report

msgdisplay("THU");

else

if(day==6)

msgdisplay("FRI");

else

if(day==7)

msgdisplay("SAT");

else;

//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ START FUNCTION $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

void start(void)

SCL=1;

SDA=1;

_nop_();

_nop_();

SDA=0;

SCL=0;

//aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa DATA SENDING TO EEPRAM IN READ MODE AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

void ptos(unsigned char a)

Page 98: Automatic College Bell Original Report

unsigned char i,c;

for(i=0;i<=7;i++)

c=a&128;

if(c==0)

SDA=0;

else

SDA=1;

SCL=1;

_nop_();

_nop_();

SCL=0;

a=a<<1;

SDA=1;

_nop_();

_nop_();

SCL=1;

_nop_();

_nop_();

SCL=0;

Page 99: Automatic College Bell Original Report

//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS STOP FUNCTION SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

void stop(void)

SDA=0;

SCL=1;

_nop_();

_nop_();

SDA=1;

SCL=0;

void delay1(unsigned int itime)

unsigned int i,j;

for(i=0;i<itime;i++)

for(j=0;j<3;j++);

Page 100: Automatic College Bell Original Report

10.REFERENCE

www.google.com

www.8051projects.info

www.en.wikipedia.org

www.yahoo.com/search

www.alldatasheet.com

www.datasheetcatalog.com/datasheets_pdf/7/8/0/5/7805.shtml

Page 101: Automatic College Bell Original Report

8051 Microcontroller and Embedded Systems by Mazidi and Mazidi

Applied Electronics by R. S. Sedha


Recommended