Railway station alert and advertisement system by nibts23


More Info


   Introduction

   Circuit Diagram & Block diagram

   PCB Fabrication

   Power Supply Unit

   Microcontroller unit

   RF communication techniques

   Program

   LCD Display

   Advantages & Applications

   Future scope

   Conclusion

   Entrepreneurship & Management

   Bibliography

    Alerting and advertising the passengers with station name and

advertisement simultaneously by advertising through LCD and alerting

through buzzer. The LCD & buzzer are placed in each compartment.

       Today we are living in a technical world. In this Railways play a major role. They

become worldwide and hence this leading to increase their infrastructure with new


       To serve this situation we in our project implement a new idea to inform the

station details inside the train through LCD panel. As for general purpose usage i.e. to use

the same module in all train we are using RF communication technique.

       Here RF transmitter module will be placed at each station and a receiver unit of

same frequency will be placed inside the train to receive those signals sent from that

transmitter. Here the transmitter will be programmed to send the particular station name

continuously with certain time delay and up to certain distance.

       The receiver unit placed inside the train receives this signal before some distance

as it nears the particular station. This received information is then displayed through the

LCD which is placed in each compartment with a beep sound to indicate the display of

this message. This station information will be displayed until the receiver receives the

signal from the transmitter and after that advertisements are displayed until it reaches the

next station.

 STATION                        TRAIN

    RF - TX       RF - Rx








                                                                                              VCC 4

A0                         VCC
A1    1              18                                    D_OUT
A2    2              17               R2        1K
A3    3              16
A4    4              15
A5    5              14    D3
A6    6              13    D2
A7    7              12    D1
      8              11    D0
      9              10

                                                                      SW DIP-4

                                  ANTENNA            J1





                                                                              VCC 5

     A0                    VCC
     A1     1         18   VT
     A2     2         17         R3 1K
     A3     3         16
     A4     4         15   D_IN
     A5     5         14   D3
     A6     6         13   D2

     A7     7         12   D1

            8         11   D0
            9         10                                    R5
                HT 6030                         R8

                                                            D5             D6
                                  D2       D3
                                                            LED               LED


   VCC                                                                                  J16
+ C2                                                                              VCC
                                                                                        2       2         100K
 10MF/25V                                                                               3
                                                                  VCC                   4

                                                            40                          5
    10K R11 2                 1                      VCC    39      2                   6

            3                 2   P1.0               P0.0   38      3                   7
            4                 3   P1.1               P0.1   37      4                   8
            5                 4   P1.2               P0.2   36      5                   9
            6          D0     5   P1.3               P0.3   35      6                   10
            7          D1     6   P1.4               P0.4   34      7                   11
                       D2         P1.5               P0.5                               12
      R13 8                   7
                                  P1.6               P0.6
                                                            33      8
            9          D3     8                             32      9
      10K                     9   P1.7    8          P0.7   31   VCC          C         14
            9                10   RESET             EA/VP   30                          CON14
                                          9                             R12

            8                11   RXD               ALE/P   29
                                  TXD               PSEN
                             13   INT0    C          P2.7
                                                                    3 10K
                                  INT1               P2.6
            5                14
                                  T0      5          P2.5
                                                            26      4
            4                15                             25      5
            3                16   T1
                                          1          P2.4
                                                            24      6
            2                17                             23      7
                             18   RD                 P2.2   22      8
                             19   X2                 P2.1   21      9
                                  X1                 P2.0                     C


                       Q1                                               10K

               30PF   11.0592MHZ 30PF
                       C4         C5

      For the benefit of electronic hobbyists, the procedure for making PCB is being

given. The list of the items required for the job is as below.


1. Copper clad board (PCB laminate).

2. Tracing paper.

3. Sketch pen.

4. Carbon paper.

5. Head drill machine or Power drill machine.

6. Paints.

7. Small drawing brush.

8. Ferric chloride solution.

9. Hydrochloric acid.

10. Hacksaw and a file.


      The procedure of making a PCB layout consists of steps like preparing drawing of

the sketching layout, printing of PCB, etching of PCB.


      With the circuit diagram and all the components at hand, draw complete layout plan

on the sheet of a tracing paper in the same way as assembling the circuit.

      A thermocouple base may be use large, should be taken regarding the location

shape and size of the components. Avoid over crowding while making full space

utilisation. Keep the ground line on the side and the supply line on the other side, as far as

possible. After the circuit diagram is fully drawn a final touch is given.

      The drawing so prepared has to be imposed over the copper clad PCB keeping in

view that the component would be mounted from the non-clad side of the board.

      Take PCB laminate sheet and cut the required size file the edges. The sheet must be

free from dust, oxide, etc.

      Now put a carbon paper on it with its side facing the copper surface over it put the

drawing with its marked side facing the carbon paper and the other side on top.

      Since the tracing paper is a transparent, we can now reproduce a carbon print over

the copper surface by using a drill.      The holes may be drawn with 1m.m. bit for

component leads, and for fastening screws etc., now portion of the carbon print should be

erased or wiped.

      Paint the connecting lines with the help of an ordinary brush and allow the board to

dry in open.

Any excess paint should be scratched of with tip of razor blade, after drying.


      In a tube of water add few teaspoons of Ferric chloride. Add few drops of

Hydrochloric acid to it. Short the solution then immerse the PCB in the solution for about

30minutes. Occasionally short the solution and it reduces etching time. Observe the

changing of the copper surface, take our PCB.

      Only when taking portion of the copper surface is completely dissolved in the

solution, now wash the PCB with Water. After the PCB has been thoroughly wasted to

through wasted to remove the paint by a soft piece of cloth dipped in thinner or

turpentine. Now the PCB is ready for use.
                                    POWER SUPPLY

         Available power source is an Ac voltage arrives at 230V.Since our electronic

circuits require only very minimal voltage and current we use step down power

transformer. Step down transformer is designed in such a way that the input is 230V

and output of 12V. Another thing is that electronic circuits operate in DC where as

available output of transformer is Ac of 12V. So rectifier circuit is used to convert AC

to DC.     Rectifier circuit consists of four diodes formed in bridge fashion so as to

convert incoming AC to DC.

         Even though output of rectifier circuit is DC it is not smooth or fixed DC. So

filter circuits are used to convert rippling DC to smooth DC. The filter circuit is a

capacitor, connected parallel to the output of rectifier circuit. This smooth DC voltage

will be in the range of 12+ volts. But we require only 5V supply for the operation of

micro controllers and its supporting components. Here again regulator ICs such as

7805 is used to regulate the incoming 12VDC to fixed regulated 5V as output. This DC

regulated 5V is applied to the circuits.

         Even though the circuit is functioning with 5V, the relays are driven by 6V or

12V. For this purpose 7806/7812 regulator IC is additionally connected to the rectifier

filter circuit. Thus 12V regulated is used for driving 12V relays.


             For most no critical applications the best choice for a voltage regulator is the

simple –terminal type. It has only three connections (input, output, and ground) and is

factory-trimmed to provide a fixed output. Typical of this type is the 78xx. The voltage

is specified by the last two digits of the part number and can be any of the following: 05,

08, 10, 12, 15, 18, or 24. It is to make a +5 volt regulator, for instance, with one of these

regulators. The capacitor across the output improves transient response and keeps the

impedance low at high frequencies (an input capacitor of at least 0.33F should be used

in addition if the regulator is located a considerable distance from the filter capacitors).

        The 7800 series is available in plastic or metal power packages (same as power

transistors). A low-power version, the 78Lxx, comes in the same plastic and metal

packages as small-signal transistors. The 7900 series of negative regulators works the

same way (with negative input voltage, of course). The 7800 series can provide up to 1

amp load current and has on-chip circuitry to prevent damage in the event of overheating

or excessive load current; the chip simply shuts down, rather than blowing out. In

addition, on-chip circuitry prevents operation outside.

        The Transistor safe operating area by reducing available output current for large

input-output voltage differential. These regulators are in-expensive and easy to use, and

they make it practical to design a system with many printed-circuit boards in which the

unregulated dc is brought to each board and regulation is done locally on each circuit


        Three - terminal fixed regulators come in some highly useful variants. The LP 2950

works just like a 7805, but draws only 75A of quiescent current (compared with the

7805’s 5mA or the 78L05’s 3mA); it also regulates with as little sas a 0.4 volt drop from
unregulated input to regulated output (called the “drop out voltage”), compared with 2

volts drop out for the classic 7805. The LM291 is also low-dropout, but you might call it

milli power (0.4mA quiescent current), compared with the “micro power” LP 2950.

Low-dropout regulators also come in high – current versions for example, the LT

1085/4/3 series from LTC (A, 5A, and 7.5A, respectively, with both + 5V and + 12V

available in each type). Regulators like the LM 2984 are basically three-terminal fixed

regulators, but with extra outputs to signal a microprocessor that power has failed, or

resumed. Finally, regulators like the 4195 contain a pair of 3-terminal 15-volt regulators,

one positive and one negative.

LM78XX Series Voltage Regulators


     The LM78xx series of three terminal regulators is available with several fixed

output voltages making them useful in a wide range of applications. One of these is local

on card regulation, eliminating the distribution problems associated with single point

regulation. The voltages available allow these regulators to be used in logic systems,

instrumentation, HiFi, and other solid-state electronic equipment.

     Although designed primarily as fixed voltage regulators these devices can be used

with external components to obtain adjustable voltages and currents.

     sThe LM78XX series is available in an aluminum TO-3 package which will allow

over 1.0A load current if adequate heat sinking is provided. Current limiting is included

to limit the peak output current to a safe value. Safe area protection for the output

transistor is provided to limit internal power dissipation. If internal power dissipation

becomes too high for the heat sinking provided, the thermal shutdown circuit takes over

preventing the IC from overheating.
      Considerable effort was expanded to make the LM78XX series of regulators easy to

use and minimize the number of external components. It is not necessary to bypass the

output, although this does improve transient response. Input by-passing is needed only if

the regulator is located far from the filter capacitor of the power supply.


         Output current in excess of 1A
         Internal thermal overload protection
         No external components required
         Output transistor safe area protection
         Internal short circuit current limit
Voltage Range
         LM7805C         5V

         LM7812C         12V

         LM7815C         15V

         LM7912C         12V
                           CIRCUIT DIAGRAM OF POWER SUPPLY UNIT

                 12-0-12 / 500MA
230 V AC/50 HZ
                                                             1                   3

                                                                       GN D
INPUT                                                             IN       OUT
                                      1N 4007                                                  +5 Volt
                                                                                     + 0.1MF
                                                 + 1000 MF/25 V

                                                                                               0 GND
                              0 GND



The 8051 generic power number actually includes a whole family of microcontroller that

numbers ranging from 8031 to 8751 and are available in N-Channel Metal Oxide Silicon

(NMOS) and Complementary Metal Oxide Silicon (CMOS) contraction in a variety The

8051 microcontroller generic power number actually includes a whole family of

microcontroller that numbers ranging form 8031 to of package types. An enhanced

version of the 8085, the 8052 also exist with its own family of variations and even

includes one member that can be programmed in BASIC.

       In addition, the AT89C51 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 contents but freezes the

oscillator disabling all other chip functions until the next hardware reset.

      This galaxy of parts, the result of desire by the manufactures to leave to market

niche unfilled, would require many chapters to cover in a 40 pin DIP, and direct the

investigation of a particular type of the data books. The block diagram of the 89C52 in

figure shows all of the features unique to microcontrollers.

    Internal ROM and RAM

    I/O ports with programmable pins

    Timers and counters

    Serial data Communication

    The figure also shows the usual components program counter.

    ALU, working register, and clock circuits.







                        AT89C51 MICROCONTROLLER:
The 89C51 architecture consists of these specific features.

    Eight-bit CPU with register A(the accumulator) and B

    Sixteen –bit program counter(PC) and data pointer(DPTR)

    Eight- bit program status word(PSW)

    Eight- bit stack pointer(SP)

    Internal ROM or E EPROM (8751) of(8031) to 4K989C51)

    Internal RAM of 128 bytes.

    Four register banks, each containing eight register

    Sixteen bytes which may be addressed at any level

    Eight bytes of general – purpose data memory.

    Thirty – two input/ output pins arrange as four 8-bitt ports: P0-P3

    Two 16 bit timer/ counter : T0- T1

    Full duplex serial data receiver/ transmitter :SPUF

    Control register :TCON<TMOD,SCON,PCON,IP and IE

    Two external and three internal interrupt source

    Oscillator and clock circuits

   The clock frequency, f establishes the smallest interval of time within the

microcontroller called the pulse P time. The smallest interval of time to accomplish any

simple instruction, or part of a complex instruction, however, is the machine cycle, the

machine cycle itself is made up six state. A state is the basic time interval for discrete

operations of the microcontroller an opcode, executing, or writing a data type. Two

oscillator pulses define each state.
      Program instructions may require one, two, or four machine cycle to be executed,

type of instruction, Instruction are fetched and executed by the microcontroller

automatically, beginning with the instruction located at ROM address 0000H at the time

the micro controller is first reset.To calculate the time any particular instruction will take

to be executed, find the number of cycle ,C. the time to time execute that instruction is

then found by multiply C by 12 and dividing the products by the crystal frequency.


      The 89C51 contains two 16 bit register, the program counter (PC) and the data

pointer (DPTR). Each is used to hold the address of the byte memory. Program

instruction bytes are fetched from location in memory that is addressed by the PC.

Program may be on the chip at addressed 0000H to 0FFFH, external to the chip for

addresses that exceed 0FFFH, or totally external for the addresses from 000H to FFFH.

The PC is automatically incremented after every instruction byte is fetched and may also

be altered by certain instructions. The PC is the only register that does not have an

internal address. The DPTR register is made up to 8 bit register, named DPH and DPL,

which are used to furnish memory addresses for internal and external code access and

external data access. The DPTR is under the control of the program and can be specified

by its 16-bits name, DPTR, or by each individual byte name, DPH and DPL, DPTR does

not have a single internal address: DPH and DPL are each assigned an address.

     The 89C51 contains 34 register general- purposes or working register. Two of these

registers A and B , hold results of many instructions, particularly math and logical

operations of the 89C51 central processing Unit(CPU).The other 32 are arranged as part

of the internal RAM in four banks, B0-B3, of eight register and comprise the

mathematical core.

     The A (accumulator) register is the most versatile of the two CPU register and is

used for many operations, including addition, subtraction, integer multiplication and

division, and Boolean bit manipulations. The A register is also used for all data transfers

between the 89C51 and any external memory. The B register is used with the A register

for multiplication and division operations and has no other function other than as

allocation where data may be stored.


    Flags are 1 bit registers provided to store the results of certain program instruction.

Other instruction can test condition of the flags and make decisions based on the flags. In

order that the flags may be conveniently addressed, they are grouped inside the program

status word (PSW) and the power control (PCON) register.

     The 89C51 has four mathematical flags that respond automatically to the outcome

of mathematical operations and three general-purpose user flags that can be set 1 or

cleared to 0 by the programmer as desired. Overflow (OV), and Parity (P), user flags are

named F0, GF0, and GF1, they are general purpose flags that may be used the

programmer to record some events in the program. Note that all of the flags can be set
and cleared by the programmer at will. The mathematical flags, however, are also

affected by math operations.


       CY         AC            F0          RS1           RS0    OV       ------    P

                                 BIT    SYMBOL FUNCTION
   7        Cy    Carry Flag: Used in arithmetic: Jump, rotate, and

                  Boolean instructions

   6        AC Auxiliary Carry Flag: Used for BCD arithmetic

   5        F0    User Flag 0

   4        RS1 Register bank select bit 1

   3        RS0 Register bank select bit 0

   2        OV Over flow flag: Used in arithmetic instructions

   1        ---   Reserved for future use

   0        P     Parity flag shows parity of register A: 1= Odd parity

                  Bit addressable as PSW, 0 to PSW. 7

            RS1        RS0

            0          0        Select register bank 0

            0          1        Select register banks 1

            1          0        Select register bank 2

            1          1        Select register bank 3

       The program status word is shown above. The PSW contains such math flags, user

   program F0 and the register select bits that identify which of the four general –

   purpose register banks is currency in use by the Programmer. The remaining two user

   flags. GF0 and GF1 are stored in PCON.
A functioning computer must have memory for program code bytes commonly in ROM

and RAM memory for variable data that can be altered while the program runs. The

89C51 internal RAM and ROM memories for these functions. Additional memory can be

added externally using suitable circuits.

      Unlike micro controller with Von Neumann architecture, this can be a single

memory address for either program code or data. But not for both, the 89C51 has

Hardware architecture, which uses the same address in different memories, for code and

data. Internal circuitry access the correct memory based on the nature of operation in the



      The 128 Bytes internal RAM, which is shown in details in figure, is organized into

three areas.

      1. Thirty – two addresses from 00H to 1FH that makes up 32 working register

   organized as four banks of eight register each. The four register banks are numbered 0

   to 3 and are made up of eight register named R0 to R7 .Each register can be addressed

   by name ( When its bank is selected) or by its RAM address. Thus R0 of bank 3 is R0

   (if bank 3 is currently selected) or address 18H (Whether bank 3 is currently selected

   or not). Bits RS0 and RS1 in the PSW determine which bank of register is currently

   used at any time when the program is running. When Register banks are not selected,

   they can be used as general – purpose RAM.
              Byte Address

        1F     R7
        1E     R6
        1D     R5
Bank1 1C       R4
        1B     R3
        1A     R2
        19     R1
        18     R0
        17     R7
        16     R6                 Bit Address
Bank2    15    R5
        14     R4
        13     R3                 Byte address(or)   Bit

        12     R2

        11     R1
        10     R0            2F   7F            78
        0F     R7            2E   77            70
        0E     R6            2D   6F            68
        0D     R5            2C   67            60
Bank1   0C     R4            2B   5F            58
        0B     R3            2A   57            50
        0A     R2            29   4F            48
        09     R1            28   47            40
        08     R0            27   3F            38
        07     R6            26   37            30
        06     R5            25   2F            28
        05     R4            24   27            20
Bank0 04       R3            23   1F            18
        03     R2            22   17            10
        02     R1            21   0F            08
        01     R0            20   07            00

      The stack refers to area of internal RAM that is used in conjunction with certain

opcodes to store and retrieve data quickly. The 8-bit stack pointer (SP) register is used by

the 89C51 to hold an internal RAM address that is called the top of the stack. The address

held in the SP register is location in internal RAM where the last byte of data was stored

by a stack operation.

      When data to be placed on the stack, the SP increments before storing , data on the

stack that the stack grows up as data is stored. As data is retrieved from the stack, the byte

is read from the stack, and then the SP decrements to point tom the next available byte of

stored data.

      The stack is limited in height to the internal RAM. The stack has the potential (If

the programmer is not careful to limit its growth) to overwrite valuable data in the register

banks; bit addressable RAM, and scratchpad RAM areas. The programmer is responsible

for making sure the stack does grow beyond predefined bounds.

      The stack ids normally high in internal RAM, by an appropriate choice of the

number placed in the SP register, to avoid conflicts with the register, bit and scratch

internal RAM areas.


      The 89C51 that do not use the internal 128 bytes RAM addresses from 00H to 7FH

are done by a group of specific internal a register , each called a special –Function

register(SFR). This may be addressed much like internal RAM, using addresses from 80H

to FFH.
       Some SFRs are bit addressable, as is the case the bit of RAM. This feature allows

the programmer to change only what needs to be altered, leaving the remaining bits in

that SFR unchanged.

      Name                      Function           Internal RAM addresses

A               Accumulator                                     0E0

B               Arithmetic                                      0F0
DPH             Addressing external memory                       83
DPL             Addressing external memory                       82
IE              Interrupt enabled Memory                        0A8
IP              Interrupt Priority                              0B3
P0              Input/Output port latch                          80
P1              Input/Output port latch                          90
P2              Input/Output port latch                         A0
P3              Input/Output port latch                         0B0
PCON            Power Control                                    87
PSW             Program Status word                             0D0
SCON            Serial port control                              98
SBUF            Serial port data buffer                          99
SF              Stack Pointer                                    81
TMOD            Timer/Counter mode control                       89
TCON            Timer/Counter Control                            88
TL0             Timer 0 low byte                                8A
TH0             Timer 0 high byte                               8C
TL1             Timer 1 low byte                                8B
TH1             Timer 1 high byte                               8D

       SFR named in certain opcodes by their functions names, such as A or TH0, and are

referenced by other opcode by their address such as 0E0H or 8CH. Note that any address

used in the program must start with the number thus address E0h for the A SFR with 0.

Failure to use this number convention will result in an assembler error when the program

is assembled.

     The 89C51 is organized so that data memory and program code memory can be in

two entirely different memory entities. Each has the same address ranges.

     The structure of the internal Ram has been discussed previously. A corresponding

block of internal code, Contained in an internal Rom, occupies code address space 000H

to 0FFFH. The PC is ordinarily used to address program code bytes from addresses

0000H to FFFH. Program addresses higher than 0FFFH, which exceed the internal ROM

capacity, will cause the 89C51 to automatically fetch code byte from external program

memory code bytes can also be fetched exclusively from external memory, addresses

000H to FFFH, by connecting the external access pin (EA pin 31 on the DIP) to ground.

The PC does not care where the code is the circuit designers decide whether the code is

found totally internal ROM, totally in external ROM or in a combination of internal and

external ROM.

       Port 0 is an 8 bit drain bi-directional I/O port. As an output port, each pin can sink

eight TTL inputs. When are written to port 0 pins can be used as high impedance inputs.

     Port 0 may also be configured to be 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 bytes during flash programming and output program verification.

     Port 1 is an 8 bit bi-directional I/O port with external pull-ups. The port 1 output

buffer can sink / source four TTL inputs. When 1s are written to port 1 pins are pulled

high by the internal pull-ups and can be used as inputs. As input, input port 1 pin that are

externally pulled low will source current because of the internal pull-up.


       Port 2 is an 8 bit bi-directional I/O port with internal pull-up. The port 2 output

buffer can sink/ Source four TTL inputs. When 1 s is written to port 2 pins they are pulled

high by the internal pull-up and can be used as inputs. As inputs port 2 pins that are

externally being pulled low will source current because of the internal pull-ups. Port 2

emits the higher order address byte during fetches from external memory and during

access to external data memory that uses 16 bit addresses .In this application. It uses

strong internal pull-up when emitting 1s.


       Port 3 is an eight bit bi-directional I/O port with internal port pull-ups. The Port

output buffer can sink / Source four TTL inputs. When 1s are written to port 3 pins they

are pulled high by the internal pull-ups and can be used as inputs. As input, port 3 pins

that are externally being pulled. Low source current because pull-ups. Port 3 also receive

some control signals fro Flash programming and Verification.


       Reset input. A high on this pin for two machine cycle while the oscillator is

running reset the device.

       Address Latch Enable output pulse for the latching the low bytes of the address

during access to external memory. The pin is also the program pulse input (PROG) during

flash programming.

       In normal operations ALE is enabled at a constant rate 1/6th of the oscillator

frequency, any may be used for external timing or clocking purpose. Note, however, that

one ALE pulse is skipped during each access to external data memory.

     If desired, ALE operation can be disabled by setting bit 0 in SFR location 8 EH.

With the bit set, ALE is active only during a MOV X or Mov C instruction. Otherwise,

the pin weakly pulled high. Setting the ALE-disable bit has no effect microcontroller is in

external execution mode.


       Program Strobe Enable is the read strobe to external program memory. When the

AT89C51 is executing code from external program cycle, except that two PSEN

activations are skipped during each access to external data memory.


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

device to fetch from external program memory locations starting at 0000H up to FFFFH.

Note, however, that if lock bit 1 bit programmed, EA will be internal latched on reset. EA

should be strapped to VCC for internal programmable execution. This pin also receives

the 12 V programming enable voltage (VPP) during Flash programming, f or parts that

require 12 Volt VPP.

           Input to the inverting oscillator amplifier and input to the internal clock operating



           Output from the inverting oscillator amplifier.


           XTAL1 and XTAL2 are the input and output, respectively, of an inverting

amplifier, which can be configured for use as an on-chip oscillator, as shown in Figure 1.

Either a quartz crystal or ceramic resonator may be used. To drive the device from an

external clock source, XTAL2 should be left unconnected while XTAL1 is driven as

shown in Figure 2. There are no requirements on the duty cycle of the external clock

signal, since the input to the internal clocking circuitry is through a divide-by-two flip-

flop, but minimum and maximum voltage high and low time specifications must be


                                     Oscillator Connections

       Programming the IC 89C51 is normally shipped with the on chip Flash Memory

array in the erased state (i.e.) Contents= FFH and ready to be programmed. The IC 89C51

is programmed byte – by- byte in programming mode. Before the on- chip flash code

memory can be re-programmed, the entire memory array must be erased electrically.


      The AT89C51 has a total of six interrupt vectors: two external interrupts (INT0 and

INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. These

interrupts are all shown in Figure. Each of these interrupt sources can be individually

enabled or disabled by setting or clearing a bit in Special Function Register IE. IE also

contains a global disable bit, EA, which disables all interrupts at once.

      Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register

T2CON. Neither of these flags is cleared by hardware when the service routine is

vectored to. In fact, the service routine may have to determine whether it was TF2 or

EXF2 that generated the interrupt, and that bit will have to be cleared in software.

      The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which

the timers overflow. The values are then polled by the circuitry in the next cycle.

However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same cycle in which

the timer overflows.


       The serial port is full duplex, meaning it can transmit and receives simultaneously.

It is also receive-buffered, meaning it can commence reception of a second byte before a

previously received byte has been read from the register. (However, if the first byte still

hasn’t been read by the time reception of the second byte is complete, one of the bytes

will be lost.) The serial port receive and transmit registers are both accessed at Special

Function Register SBUF. Writing to SBUF loads the transmit register, and reading SBUF

accesses a physically separate receive register. The serial port can operate in 4 modes:

      Serial data enters and exits through RxD. TxD outputs the shift clock. 8 bits are

transmitted/received (LSB first).

The baud rate is fixed at 1/12 the oscillator frequency.


      10 bits are transmitted (through TxD) or received (through RxD): a start bit (0), 8

data bits (LSB first), and a stop bit (1). On receive; the stop bit goes into RB8 in Special

Function Register SCON. The baud rate is variable.


      11 bits are transmitted (through TxD) or received (through RxD): start bit (0), 8

data bits (LSB first), a programmable 9th data bit, and a stop bit (1). On Transmit, the 9th

data bit (TB8 in SCON) can be assigned the value of 0 or 1. Or, for example, the parity

bit (P, in the PSW) could be moved into TB8. On receive; the 9th data bit goes into RB8

in Special Function Register SCON, while the stop bit is ignored. The baud rate is

programmable to either 1/32 or 1/64 the oscillator frequency.


      11 bits are transmitted (through TxD) or received (through RxD): a start bit (0), 8

data bits (LSB first), a programmable 9th data bit, and a stop bit (1). In fact, Mode 3 is the

same as Mode 2 in all respects except baud rate. The baud rate in Mode 3 is variable. In

all four modes, transmission is initiated by any instruction that uses SBUF as a

destination register. Reception is initiated in Mode 0 by the condition RI = 0 and REN =

1. Reception is initiated in the other modes by the incoming start bit if REN = 1.

      Modes 2 and 3 have a special provision for multiprocessor communications. In

these modes, 9 data bits are received. The 9th one goes into RB8. Then comes a stop bit.

The port can be programmed such that when the stop bit is received, the serial port

interrupt will be activated only if RB8 = 1. This feature is enabled by setting bit SM2 in

SCON. A way to use this feature in multiprocessor systems is as follows:

      When the master processor wants to transmit a block of data to one of several

slaves, it first sends out an address byte which identifies the target slave. An address byte

differs from a data byte in that the 9th bit is 1 in an address byte and 0 in a data byte.

With SM2 = 1, no slave will be interrupted by a data byte. An address byte, however, will

interrupt all slaves, so that each slave can examine the received byte and see if it is being

addressed. The addressed slave will clear its SM2 bit and prepare to receive the data bytes

that will be coming.

      The slaves that weren’t being addressed leave their SM2s set and go on about their

business, ignoring the coming data bytes. SM2 has no effect in Mode 0, and in Mode 1

can be used to check the validity of the stop bit. In a Mode 1 exception, if SM2 = 1, the

receive interrupt will not be activated unless a valid stop bit is received.


      The serial port control and status register is the Special Function Register SCON.

This register contains not only the mode selection bits, but also the 9th data bit for

transmit and receive (TB8 and RB8), and the serial port interrupt bits (TI and RI).

The baud rate in Mode 0 is fixed:

Mode 0 Baud Rate = Oscillator Frequency / 12.

     The baud rate in Mode 2 depends on the value of bit SMOD in Special Function

Register PCON. If SMOD = 0 (which is the value on reset), the baud rate is 1/64 the

oscillator frequency. If SMOD = 1, the baud rate is 1/32 the oscillator frequency.

Mode 2 Baud Rate =2SMOD/ 64 *(Oscillator Frequency)

     In the 80C51, the baud rates in Modes 1 and 3 are determined by the Timer 1

overflow rate.


   When Timer 1 is used as the baud rate generator, the baud rates in Modes 1and 3 are

determined by the Timer 1 overflow rate and the value of SMOD as follows:

Mode 1, 3 Baud Rate = 2SMOD/ 32 *(Timer 1 Overflow Rate)

The Timer 1 interrupt should be disabled in this application. The Timer itself can be

configured for either “timer or counter” operation, and in any of its 3 running modes. In

the most typical applications, it is configured for “timer” operation, in the auto-reload

mode (high nibble of TMOD = 0010B). In that case the baud rate is given by the formula:

Mode 1, 3 Baud Rate = 2SMOD/32 *Oscillator Frequency/12*256-(TH1)]

     One can achieve very low baud rates with Timer 1 by leaving the Timer 1 interrupt

enabled, and configuring the Timer to run as a 16-bit timer (high nibble of TMOD =

0001B), and using the Timer 1 interrupt to do a 16-bit software reload. Figure 12 lists

various commonly used baud rates and how they can be obtained from Timer 1.

                   MSB                                                 LSB

                   SM0   SM1      SM2      REN     TB8   RB8     TI     RI

              00   0     shift register fOSC/ 12
              01   1     8-bit UART variable
              10   2     9-bit UART fOSC/64 or fOSC/32
              11   3     9-bit UART variable

       Enables the multiprocessor communication feature in modes 2 and 3. In Mode 2 or

3, if SM2 is set to 1, then Rl will not be activated if the received 9th data bit (RB8) is 0.

In Mode 1, if SM2=1 then RI will not be activated if a valid stop bit was not received. In

Mode 0, SM2 should be 0.

      Enables serial reception. Set by software to enable reception. Clear by software to

disable reception.

       The 9th data bit that will be transmitted in Modes 2 and 3. Set or clear by software

as desired.

      In Modes 2 and 3, is the 9th data bit that was received. In Mode 1, it SM2=0, RB8

is the stop bit that was received. In Mode 0, RB8 is not used.


      Transmit interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or

at the beginning of the stop bit in the other modes, in any serial transmission. Must be

cleared by software.

      Receive interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or

halfway through the stop bit time in the other modes, in any serial reception (except see

SM2). Must be cleared by software.


                     KONGU ECE

                   College program


              #include <reg51.h>

              #include <stdio.h>

              #include <lcd.h>

              #define KEYS_DELAY 15000

              #define GEN_DELAY 10000

              Port: LCD_PORT = 0x80;

              Pin: LCD_RS   = P1 ^ 0;

              Pin: LCD_RW   = P1 ^ 1;

              Pin: LCD_EN   = P1 ^ 2;

              Pin: DATA_D1 = P1 ^ 5;

              Pin: DATA_D2 = P1 ^ 6;

              Pin: DATA_D3 = P1 ^ 7;

              Pin: BUZER    = P2 ^ 7;
Bit advt_flag;

Unsigned int sec;

Main ()


    Uputs (0, 0, 16, "WELCOME TO KONGU");

    Uputs (16, 0, 16,"   POLYTECHNIC “);

    Delay (60000);

    Uputs (0, 0, 16, " WELCOME TO OUR ");

    Uputs (16, 0, 16," ECE DEPARTMENT ");

    Delay (60000);

    Uputs (0, 0, 16, "THANKS TO H.O.D ");

    Uputs (16, 0, 16,” GUIDE & ALL    ");

    Delay (60000);

    Uputs (0, 0, 16, “P.R.PRAWINRAGAV");

    Uputs (16, 0, 16,"   B.DINESH    ");

    Delay (60000);

    Uputs (0, 0, 16, "   D.GOPINATH “);
         Uputs (16, 0, 16,"        G.PRAKASH     ");

         Delay (60000);

         Uputs (0, 0, 16, “T.MADHANKUMAR ");

         Uputs (16, 0, 16,"        B.LOGESHWAR “);

         Delay (60000);

    While (1)


         BUZER = 0;

         If            ((DATA_D1==1)        &&         (DATA_D2==0)



                  Uputs (0, 0, 16, “THIS IS ERODE ");

                  Uputs (16, 0, 16,” STATION ZONE “);

                  BUZER = 1;

                  advt_flag = 0;


         If        ((DATA_D1==0)       &&    (DATA_D2==1)       &&



                  Uputs (0, 0, 16, “THIS IS SALEM ");

                        Uputs (16, 0, 16,” STATION ZONE “);
              BUZER = 1;

                 advt_flag = 0;


         If    ((DATA_D1==0)        &&   (DATA_D2==0)   &&



              Uputs (0, 0, 16, “THIS IS KOVAI ");

                 Uputs (16, 0, 16,” STATION ZONE “);

              BUZER = 1;

                 advt_flag = 0;


         If     ((DATA_D==0)        &&   (DATA_D2==0)   &&



                 advt_flag = 1;

                 BUZER       = 0;


         If    ((DATA_D1==1)        &&   (DATA_D2==1)   &&



         advt_flag = 1;

         BUZER        = 0;

         If      ((DATA_D1==1)   &&   (DATA_D2==0)   &&



             advt_flag = 1;

             BUZER     = 0;


         If      ((DATA_D1==0)   &&   (DATA_D2==1)   &&



             advt_flag = 1;

             BUZER     = 0;


         If      ((DATA_D1==0)   &&   (DATA_D2==1)   &&



             advt_flag = 1;

             BUZER     = 0;


        If       ((DATA_D1==1)   &&   (DATA_D2==1)   &&



             advt_flag = 1;

             BUZER     = 0;

        If ((advt_flag == 1))


                  Switch (SEC)


                      Case 1: {uputs (0, 0, 16, "WELCOME TO


                                Uputs (16, 0, 16,” POLYTECHNIC




                      Case 2: {uputs (0, 0, 16, "     COLLEGE


                                Uputs (16, 0, 16,” PERUNDURAI




                        Case 3: {     uputs (0, 0, 16, "WELCOME

TO E.C.E");

                            Uputs (16, 0, 16,"** DEPARTMENT



             Case 4: {

                                     Uputs    (0,        0,         16,


                               Uputs (16, 0, 16," IS BROUHT U

BY ");



                       Case 5: {

                                     Uputs (16, 0, 16,"KONGU


                                     Uputs   (0,    0,        16,     "

STUDENT      ");








       LCD stands for liquid crystal; this is an output device with a limited viewing

angle. The choice of LCD as an output device was Because of its cost of use and is better

with alphabets when compared with a 7-segment LED display. We have so many kinds of

LCD today and our application requires a LCD with 2 lines and 16 characters per line,

this gets data from the microcontroller and displays the same. It has 8 data lines, 3 control

line, a supply voltage Vcc (+5v and a GND. This makes the whole device user friendly by

showing the balance left in the card. This also shoes the card that is currently being used.

      In recent years the LCD is finding widespread use replacing LED’s. This is due to

the following reasons:

   1. The declining prices of LCD’s.

   2. The ability to display numbers, characters and graphics. This is in contrast to

       LED’s, which are limited to numbers and few characters.

   3. Incorporation of a refreshing controller into the LCD, there by 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.



       While VCC and VSS provide +5v and ground respectively, VEE is used for

controlling LCD contrast.
      There are two very important registers inside the LCD. The RS pin used for their

selection as follows. If RS=0, the instruction command code register is selected, allowing

the user to sent a command such as clear display, cursor at home ,etc .IF RS=1 the data

register is selected, allowing the user to sent data to be displayed on the LCD.

           R/W input allows the user to write information to the LCD or read information

from it.

R/W=1 when reading; R/W=0 when writing.


      The enable pin is used by the LCD to latch information present to its data pins.

When data is supplied to data pins, a high to low pulse must be applied to this pin in order

for the LCD to latch in the data present at the data pins. This pulse must be a minimum of

450ns wide.


      The 8-bit data pins, D0-D7, are used to sent information to LCD or read the

contents of the LCD’s internal registers.

      To display letters and numbers, we send ASCII codes for the letters A-Z, a-z, and

numbers 0-9 to these pins while making RS=1.

      There are also instruction commands codes that can be send to the LCD to clear the

display or force the cursor to the home position or blink the cursor.

      We also use RS=0 to check the busy flag bit see if the LCD is ready to receive

information. The busy flag is D7 and can be read when R/W=1 and RS=0, as follows, if

R/W=1, RS=0. When D7=1, The LCD is busy taking care of internal operations and will

not accept any new information. When D7=0, the LCD is ready to receive new


1           Clear display screen
2           Return home
4           Decrement cursor
6           Increment cursor
5           Shift display right
7           Shift display left
8           Display off, cursor off
A           Display off, cursor on
C           Display on, cursor off
E           Display on, cursor blinking
F           Display on, cursor blinking
10          Shift cursor position to left
14          Shift cursor position to right
18          Shift the entire display to the left
1C          Shift the entire display to the right
80          Force cursor to beginning of the 1st line
C0          Force cursor to beginning of the 2nd line
38          2 lines and 2*7 matrix


                       A 16x2 Liquid Crystal Display
                                 LCD CIRCUIT DIAGRAM


                31                                39   14   D B7
                      EA/VP                P0.0   38   13   D B6
                19                                37   12   D B5                 VCC        HI
                      X1                   P0.2
                                                  36   11   D B4                  2              +5V
            11.0592                               35   10   D B3
               18                                 34   9    D B2                        POT
                      X2                   P0.5   33   8    D B1                 V EE   10K
          1mf                              P0.7
                                                  32   7    D B0                   3
      2     1   9
                      RESET                       21   6 EN                      V SS
                                           P2.0   22   5 R/W                       1
                12           AT 89C52      P2.1   23   4 RS
                13    INT0                 P2.2   24
  0             14    INT1                 P2.3   25                                    0
                15    T0                   P2.4   26
                      T1                   P2.5   27
                1                          P2.6   28
                2     P1.0                 P2.7
                3     P1.1                        17
                      P1.2                   RD
                4                                 16        L C D JH D 1 6 2 A
                5     P1.3                  WR    29
                6     P1.4                PSEN    30
                7     P1.5                ALE/P   11
                8     P1.6                  TXD   10
                      P1.7                 RXD


      The LCD requires either 8 or 11 I/O lines to communicate with. For the sake of this

tutorial, we are going to use an 8-bit data bus--so we'll be using 11 of the 8051's I/O pins

to interface with the LCD.

      The EN line is used to tell the LCD that you are ready for it to execute an

instruction that you've prepared on the data bus and on the other control lines. Note that

the EN line must be raised/lowered before/after each instruction sent to the LCD

regardless of whether that instruction is read or write, text or instruction. In short, you

must always manipulate EN when communicating with the LCD. EN is the LCD's way of

knowing that you are talking to it. If you don't raise/lower EN, the LCD doesn't know

you're talking to it on the other lines.

                  Character set for 5x7 dot font

                INTERFACING 8051 WITH LCD

      Before you may really use the LCD, you must initialize and configure it. This is

accomplished by sending a number of initialization instructions to the LCD.

      The first instruction we send must tell the LCD whether we'll be communicating

with it with an 8-bit or 4-bit data bus. We also select a 5x8 dot character font. These two

options are selected by sending the command 38h to the LCD as a command. As you will

recall from the last section, we mentioned that the RS line must be low if we are sending

a command to the LCD. The second byte of the initialization sequence is the instruction

0Eh. Thus we must repeat the initialization code from above, but now with the

instruction. Thus the next code segment is:

      The last byte we need to send is used to configure additional operational parameters

of the LCD. We must send the value 06h.

      Thus, the first character in the upper left-hand corner is at address 00h. The

following character position (character #2 on the first line) is address 01h, etc. This

continues until we reach the 16th character of the first line which is at address 0Fh.

      However, the first character of line 2, as shown in the memory map, is at address

40h. This means if we write a character to the last position of the first line and then write

a second character, the second character will not appear on the second line. That is

because the second character will effectively be written to address 10h--but the second

line begins at address 40h. Thus we need to send a command to the LCD that tells it to

position the cursor on the second line. The "Set Cursor Position" instruction is 80h. To

this we must add the address of the location where we wish to position the cursor.



     Income for government.

     Easy installation.

     Low cost.

     Avoid tension among passengers.

     Compact in size.


   Used mainly in trains.

   Used in buses.

   In future we can develop this project further for effective use. The development is

    made by increasing the infrastructure of buzzer and LCD. The process involves is that

    in buzzer we can produce human voice by recording the sound in order to serve for

    blind people. Also in LCD we can able to display different languages for peoples of

    different states and countries.

     This     project    named         RAILWAY       STATION         ALERT        AND

ADVERTISEMENT SYSTEM is successfully completed by us in a sophisticated

manner. The future development of this project is going on by us which are nearly to be

completed. It was a good exercise for us in both theory and practical point of view .This

can be effectively used in Railways.


Project and Basic Management

     When we start a small scale industry, the following points are to be considered,

      To select economically and technically feasible project.

      Select the most suitable location for the industry.

      Follow the local rules and regulations for starting the industry.

      Apply for the loans and other advance from banks and financial institutions.

      Follow the formatives and procedures that need to be done for procuring


      Prepare the documents for getting loans.

      Selections and appointment of suitable personnel for manufacture of the


      Identify the different organization types for a small industry.

      Select the suitable machine tools and equipments for manufacture.

      Plan the layout of the factory in the must economical way.

      Select the post procedure for selling.

      The required amount of electricity is available easily.

The above points are discussed below:

1.   Select economically and technically feasible project:

     In this type of project we will technically start the DC shunt motor. We can use the

automatic starting. This type of starting is low expensive compared to other type of

starting. The fully automatic DC other starting is which consists of electronic circuit for

accurate control. The manual operation can be minimized into an appreciable amount.

So we can select this type of project for good demand in this project.
2.    Select the most suitable location for the industry:

      The industry manufacturing this machine is to be located where the following

facilities are easily available.

       There should not be any frequent power failure.

       Water should be easily available for molding process.

       The raw materials should be easily available.

       The land should be somewhat less in cost and should be near to an industrial


       Transportation should be easy.

3.    Follow the local rules and regulations for starting the


      High tension machines are not be operated during a period of 6 to 9 P.M since they

affect other illuminations nearby industries given out should not be mingle with the pure

water and pollution it. The people residing at the surrounding areas should be not

affected by the noise pollution. Hence suitable arrangement has to be made in order to

overcome these problems.

4.    Follow the formalities and procedures that need to be done

for procuring materials:

      After receiving the quotation of the price of various items required for

manufacturing the machine they are directly produced from them. Material such as

electrical components, compressor, drilling machines, sprayer, welding machine, shaper

machine, are purchased in bulk from wholesale merchant nearer to industry. Quality
paints are produced from a dealer nearby industry. The other miscellaneous materials like

wires, soldering iron, lead and paste are purchased in bulk from the dealer.

     Apply for loans and other advance from banks and

financial institutions:

     One of the essential requirements for any self-employment venture is capital. With

the nationalization of major commercial banks, the credit to small-scale industries is

made available on priority. The bank primarily looks to the soundness of the proposed

enterprise and the competence to run it successfully. Some of the points we have to note

before applying for the loan for small-scale industries are given below.

       Should have personal knowledge either of the techniques of production of

          management of particular industry.

       Ensure scope and demand for the products we must have the knowledge up to
          get information about the market for the product. We prepare to manufacture

          the latest techniques and the market.

       We should ensure continuous.

       Supply of raw materials.

       Before starting the must, prepare an action plan for the unit.

       Where small industrial units supplying goods against order to a government or

         semi government or other reputed firms supply bills are discounted by the bank.

       When large order have been secured by a small industrial unit and is required

         money to by new materials, to employ and pay wages to additional workers,

         clean advances up to a reasonable extent are made by the bank in deserving

5.    Margin Money:

      No margin is to be maintained for loans up to Rs.25, 000/- for loans over Rs.25,

000/- 10% in backward areas and 12% in other areas. Short term loans not exceeding

14% for up to and inclusive of Rs.2 lakhs 16.5% for ever Rs.2 Lakhs and up to Rs.25

lakhs and 18% for above Rs.25 lakhs term loans not less than 3 years 12.5 in backward

areas and 13.5 in other areas.

6.    Prepare the documents for getting loans:

      For composite loans up to Rs.25, 000/- given to artisans cottage and village

industries hanks may have a security pledge of hypothecation or mortgage of assets

created out of the loans. Collateral securities as determined by them on the merits of each

case for advance Rs.25, 000/- collected security of their party quarter may be asked for

only in cases where primary security is inadequate.

7.    Selection and appointment of suitable personnel for

manufacture of product

      In order to assist the industry to set the product, the following personal are


      Electronics Engineering

      An electronics engineering of diploma qualification is selected after interview and

looking into his experience. He has to supervise the PCB marking section.

      A welder of an I.T.I. qualification is selected in order to do mechanical work which

is need mainly for the enclosure. In additional of the employees about 3 helpers are

selected under the experience in the particular job.
8.   Select     suitable         machine      tools     and       equipments   for


     The following equipments are used for the manufacture of product.


               Drilling Machine

               Grinding Machine

               Lathe

               Welding Machine



               Soldering iron

               De-soldering tool

               PCB making machine

               Screw driver

               Cutting pliers

               Nose pliers

               Multi meter

               Insulation tape

               Load

               Wire and etc.,

9.   Layout of industries

     Plan the layout of the factory in the most economical way.
10. Select the correct procedure for the selling

      The o/p goods are marked either directly or marketing through any organized like

SIDCO etc. The first access the units, for the technical capabilities financial capabilities

and local standing as when an offer is received by SIDCO desires to participate in a

tender the SSI units have to send their safes, amounts other things which contain to only

break up cost for the products offered by also the other salient terms and conditions of


12. List down the various sources which can give technical and

other guidance

      The sources like District Industries Center (DIC); small industries Service

Industries Service Institute (SISI), government of India leather finishing center will

provide adequate technical assistance. For the financial assistance Tamilnadu Industrial

Corporation Limited (TIIC).

      1. Know the growth of the industry in the locality

      The industry manufacturing the automatic coil winding will have the great demand

in the days to come. This type of machine power consumption low cast and hence the

goods will have a good market in future.

       Never start the unit promises money. At the time of starting the unit, we should

          have sufficient money for starting and running the unit.

       If the industry to start one among the list of industries whose production are to

          be got approved we have to get the production program approved by the state

          director able of industries.
       Much thought will have to be given by us to where to locate the plane electricity

          raw materials and skilled workers should be available easily and facilities for

          repairs and maintenance may preparable are available nearby.

       Before we finalize our arrangement for starting the unit gets place of work

          approved by the corporation, municipal and panchayat authorities.

       The bank will help us with finance but we have to provide part of the finance


Normally the bank provide assistant to small-scale industries in the form of


       These are repayable within a period of 5 to 7 years installment and are granted

          for the purchase of land.    Construction of factory buildings acquisition of

          machinery and for expansion. The security of the loans will be fixed assets of

          our concern or new machinery of equipment that is required for the loan.


         There are repayable on demand are renewable advances are granted both

          against raw materials and finished goods.







                     ─ B.L.THERAJA & R.S. SEDHA


                     ─MUHAMMAD ALI MAZIDI,

                      JANICE GILLISPIE MAZIDI

To top