You are on page 1of 97

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.

1.

INTRODUCTION

In todays life, everyone gives importance to time. Time does not wait for anybody.
Everything should be performed in time & accurately. Now a days 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.

Figure 1.1Conventional Bell

Figure 1.2Manually operated College Bell

Figure 1.3 Automatic College Bell

BLOCK DIAGRAM :

LCD Display
Power supply Micro BUZZER DRIVER KEY INPUT PAD controller

REAL TIME CLOK (RTC)

Buzzer

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 .

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 .

2.

CIRCUIT DESCRIPTION

2.1. CIRCUIT DIAGRAM:-

Figure 2.1.1 Circuit Diagram of Automatic College Bell

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

2.3. OPERATION: 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 DEC INC : to set the present time and it is also acts as ENTER or OK switch. : to decrease the value of time and date : 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 . 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.

COMPONENT REQUIREMENT
4.1. COMPONENT LIST:S. NO. NAME OF COMPONENTS TYPE
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.. 12. 13. 14. IC 89AT8252 IC DS 1307 IC 7805 Voltage Regulator Transformer Crystal Diode Relay Switch Resistor Transistor (BC 107) Capacitors LED Display Buzzer I.C. Base Microcontroller Real Time Clock 5V Step-Down

QUANTITY
1 1 1 1

11.059 MHz, 32.768KHz 1,1 1N4700 12V Magnetic Relay (8.2,10,1) K,330E NPN 1000 F, 10 F,104pF General 16x2 LCD 6-12 V operated 8 Pin & 40 Pin 3 1 1,4,1 & 1 5 1,1,3 1 4 1 1,1

4.2. COMPONENT 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 Atmels high-density nonvolatile memory technology and is compatible with the indus-trystandard 80C51 instruction set and pinout. 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 o scillator, disabling all other chip functions until the next interrupt

or hardware reset.

IC 89S52

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

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 pullups.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 sink/source four TTL inputs. When 1s are written to Port 1 pins, they by the inter-nal pull-ups and can be used as inputs. As inputs, Port 1 externally being pulled low will source current (IIL) because of the addition, P1.0 and P1.1 can be configured to be the timer/ (P1.0/T2) and the timer/counter 2 trigger input follow-ing table. programming and Port 1 also receives verification. buffers can

are pulled high pins that are

internal pull-ups. In

counter 2 external count input

(P1.1/T2EX), respectively, as shown in the the low-order address bytes during Flash

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

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 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. 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 Code 1 2 4 6 E 80 C0 38

Command to LCD Instruction Register Clear screen display Return home Decrement cursor Increment cursor Display ON, Cursor ON Force the cursor to the beginning of the 1st line Force cursor to the beginning of the 2nd line Use 2 lines and 5x7 matrix

Pin 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Symbol VSS VCC VEE RS R/W EN DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 Led+ Led-

Description Ground Main power supply Power supply to control contrast Register Select Read/write Enable

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.

Backlight VCC Backlight Ground

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 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):-

PIN CONFIGURATIONS:-

Figure 4.2.2.1 Pin Diagram

Figure 4.2.2.2 IC DS 1307 The DS1307 serial real-time clock (RTC) is a low power, full binarycoded 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: 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: - 40C to +85C. PIN DISCRIPTION:PIN Number 1 2 3 4 5 6 7 8 Description X1 Crystal X2 Crystal VBAT GND SDA SCL SQW/OUT VCC

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:

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.

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. 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 selfcontained 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 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. Its 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

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, dont supply more than 18V or less than 8V in input. There used two capacitors in this voltage regulator circuit, they arent 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 ICs, 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 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 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.

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

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:-

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.

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 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:-

Figure 4.2.8.3

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

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. LEDs 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-LEDs for sterilization of water and disinfection of devices, and as a grow light to enhance photosynthesis in plants.

COLOR CODING:

Color Infrared Red Orange Yellow Green Blue White Ultraviolet

Potential Difference 1.6 V 1.8 V to 2.1 V 2.2 V 2.4 V 2.6 V 3.0 V to 3.5 V 3.0 V to 3.5 V 3.5V

(Close-up of a typical LED in its case showing the internal structure) ADVANTAGES: LEDs have many advantages over other technologies like lasers. As compared to laser diodes or IR sources

LEDs 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 huge portion of the available electricity isn't going toward producing visible light. LEDs 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. LEDs offer advantages such as low cost and long service life. Moreover LEDs have very low power consumption and are easy to maintain. DISADVANTAGES OF LEDS: LEDs performance largely depends on the ambient temperature of the operating environment. LEDs must be supplied with the correct current. LEDs 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 LEDs 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 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.

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 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:

Function Ground Power supply Contrast

Pin Number 1 2 3

Name Vss Vdd Vee

Logic State -

Description 0V +5V 0 - Vdd D0 D7 are interpreted as

4 Control of operating 5

RS

0 1

commands D0 D7 are interpreted as data

R/W

0 1

Write data (from controller to LCD)

Read data (from LCD to controller) 0 6 E 1 From 1 to 0 7 8 9 Data / commands 10 11 12 13 14 D0 D1 D2 D3 D4 D5 D6 D7 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 Access to LCD disabled Normal operating Data/commands are transferred to LCD Bit 0 LSB Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 MSB
Pins Fun ctio ns: 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: 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


Execution Time 1.64mS 1.64mS 40uS

Command Clear display Cursor home Entry mode set Display on/off control Cursor/Display Shift Function set Set CGRAM address Set DDRAM address Read BUSY flag (BF) Write to CGRAM or DDRAM Read from CGRAM or DDR I D: 1 = Increment (by 1) 0 = Decrement (by 1) S: 1 = Display shift on 0 = Display shift off D: 1 = Display on 0 = Display off U: 1 = Cursor on 0 = Cursor off B : 1 = Cursor blink on 0 = Cursor blink off

RS RW D7 D6 D5 D4 D3 D2 D1 D0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 D 0 1 1 x

I/D S

U B 40uS x x 40uS 40uS 40uS 40uS -

D/C R/L x F x

DL N

CGRAM address

DDRAM address

BF DDRAM address

D7 D6 D5 D4 D3 D2 D1 D0 40uS D7 D6 D5 D4 D3 D2 D1 D0 40uS R/L: 1 = Shift right 0 = Shift left DL: 1 = 8-bit interface 0 = 4-bit interface N: 1 = Display in two lines 0 = Display in one line F: 1 = Character format 5x10 dots 0 = Character format 5x7 dots D/C: 1 = Display shift 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 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.

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

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.

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.

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.

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. (PC, 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 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. 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. 2.

Click on the Keil uVision Icon on Desktop The following fig will appear

3. 4.

Click on the Project menu from the title bar 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:\

5. 6. 7.

Then Click on Save button above. Select the component for u r project. i.e. Atmel Click on the + Symbol beside of Atmel

8.

Select AT89C52 as shown below

9. 10.

Then Click on OK The Following fig will appear

11. 12. 13.

Then Click either YES or NOmostly NO Now your project is ready to USE Now double click on the Target1, you would get another option Source group 1 as shown in next page.

14.

Click on the file option from menu bar and select new

15.

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

16. 17.

Now start writing program in either in C or ASM 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

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

21. 22.

Click only one time on option ADD Now Press function key F7 to compile. Any error will appear if so happen.

23. 24.

If the file contains no error, then press Control+F5 simultaneously. The new window is as follows

25. 26.

Then Click OK 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. 29.

Now keep Pressing function key F11 slowly and observe. 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. 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 constructors 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 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 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. 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. 4. To protect the devices by leakage current of iron its bit should be earthed properly. 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.

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 sbit inc = P2^1; = 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); 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) { 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; } 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++) { 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) { 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); 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; 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; } 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; 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; } /*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"); 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); 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) { h=0; if(keycount==0) { cmd=0xc0; uplimit=12; } else if(keycount==1) { cmd=0xc3; uplimit=59; } else if(keycount==2) { // to select alarm or current time

cmd=0xc5; uplimit=1; } else if(keycount==3) { cmd=0xc8; uplimit=31; } else if(keycount==4) { cmd=0xcb; uplimit=12; } else if(keycount==5) { cmd=0xce; uplimit=99; } else; while(enter==1)

{ lcdcmd(cmd); while((inc==1)&&(dec==1)&&(enter==1)); 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 h=uplimit; } if(keycount==2) { if(h) { msgdisplay("pm"); //wait till any switch is pressed

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); 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(); } //%%%%%%%%%%%%%%%%%%%% 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; } SCL=0; delay1(100); stop(); return(v); } // ####################################### ################################## void daydisplay(unsigned char day) DATA READING FUNCTION

{ 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) msgdisplay("THU"); else if(day==6) msgdisplay("FRI"); else if(day==7) msgdisplay("SAT"); else; }

//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ START $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ void start(void) { SCL=1; SDA=1; _nop_(); _nop_(); SDA=0; SCL=0; }

FUNCTION

//aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa DATA SENDING TO EEPRAM IN READ MODE AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA void ptos(unsigned char a) { 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; } //SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS void stop(void) { SDA=0; SCL=1; _nop_(); _nop_(); SDA=1; SCL=0; } STOP FUNCTION

void delay1(unsigned int itime) { unsigned int i,j; for(i=0;i<itime;i++) for(j=0;j<3;j++); }

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 8051 Microcontroller and Embedded Systems by Mazidi and Mazidi Applied Electronics by R. S. Sedha

You might also like