Essay Writing Service

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

System for Counting Passengers and Fire Protection



1.1 Introduction

The aim of the project is to avoid the congestion of people and also to prevent the passengers from fire accidents. The purpose of the project is to know the number of persons entering and exiting the train and to detect fire using fire sensor and buzzer and SMS alert on detection of fire. As metro trains will be closed so there may be problem of oxygen deficiency due to congestion and if any fire accidents occur then also escaping chances and alerting the people will be a difficult task. Hence to avoid these two problems our project prototype proposes a automation system which detects the count of the persons entering in to the each compartment and also detects the fire accidents. This project consists of two parts: one is the detection of number of persons entering and exiting the train and the second part is detecting fire using a fire sensor and on detection of fire sending an SMS alert and ringing of the buzzer.
Here two IR pairs are placed in station to detect the entrance and exit of train in stations. After the train reached to the station the engine will stops and door will be opens automatically. Another IR pairs are placed inside of the train compartment which is used to count the number of persons entering and exiting the train and the count will be displayed on the LCD monitor. The maximum limit for the number of persons to enter a compartment is 10. If this number exceeds then   the doors will be closed automatically. Next part of this project is the fire detection. The fire sensor will detect the fire and the passengers in train will be alerted by buzzer.

1.2 Objective

In this project, part of this automation tasks are considered, and a microcontroller based prototype is developed. Actions such as traveling through a given path with predefined stations, sensing the arrival at the station and hence, proper stopping are implemented in the prototype. Messages that are synchronized with the train’s progression through its path are announced to passengers via a display. Moreover, alarm signals are produced as appropriate. Controlling of the doors in terms of open and close and timings of such actions are considered.

1.3 Embedded Systems:

An embedded system is an exceptional reason system in which the PC is totally typified by or committed to the device or system it controls. Not at all like a general-purpose PC, for example, a PC, an embedded system performs one or a couple predefined tasks, for the most part with particular prerequisites. Since the system is devoted to particular tasks, design engineers can streamline it, decreasing the size and cost of the item. embedded systems are regularly mass-delivered, profiting by economies of scale.
Personal Digital Assistants (PDAs) or handheld Computers are by and large thought to be embedded devices in light of the way of their equipment configuration, despite the fact that they are more expandable in programming terms. This line of definition keeps on obscuring as devices grow. With the presentation of the OQO Model 2 with the Windows XP working system and ports, for example, a USB port — both components more often than not have a place with “general-purpose Computers”, — the line of classification hazy spots significantly more. Embedded systems assumes significant part in devices changes from compact devices to extensive stationary establishments like advanced watches and MP3 players, movement lights, industrial facility controllers, or the systems controlling atomic power plants. As far as unpredictability embedded systems can go from extremely basic with a single microcontroller chip, to exceptionally complex with multiple units, peripherals and systems mounted inside an expansive suspension or fenced in area.
Cases of Embedded Systems:

  • Avionics, such as inertial guidance systems, flight control hardware or software and     other integrated systems in aircrafts and missiles.
  • Cellular telephones and telephone switches .
  • Engine controllers and automated stopping device controllers for cars
  • Home computerization items, for example, indoor regulators, aeration and cooling systems, sprinklers, and security observing systems
  • Handheld calculators



2.1 Microcontroller (LPC 2148)

ARM remains for Advanced RISC Machines. It is a 32 bit processor core, utilized for top of the line application. It is broadly utilized as a part of Advanced Robotic Applications.
Key features:

  • 16-bit/32-bit ARM7TDMI-S microcontroller in a little LQFP64 package.
  • 8 kB to 40 kB of on-chip static RAM and 32 kB to 512 kB of on-chip flash memory.
  • 128-bit wide interface/accelerator enables high speed 60 MHz operation.
  • In-System Programming/In-Application Programming (ISP/IAP) through on-chip boot loader programming. Single flash area or full chip erase in 400 ms and programming of 256 bytes in 1 ms.
  • Embedded ICE RT and Embedded Trace interfaces offer ongoing debugging with the on-chip Real Monitor programming and fast following of instruction execution.
  • USB 2.0 Full-speed agreeable device controller with 2 kB of end point RAM.
  • What’s more, the LPC2146/48 gives 8 kB of on-chip RAM available to USB by DMA.
  • Maybe a couple (LPC2141/42 versus LPC2144/46/48) 10-bit ADCs give an aggregate of 6/14 analog inputs, with change times as low as 2.44 μs per channel.
  • Single 10-bit DAC gives variable analog o/p (LPC2142/44/46/48 as it were).
  • Two 32-bit timers/external event counters (with four catch and four look at channels each), PWM unit (six outputs) and guard dog.
  • Low power Real-Time Clock (RTC) with free power and 32 kHz clock input.
  • Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s),
  • SPI and SSP with buffering and variable data length abilities.
  • Vectored Interrupt Controller (VIC) with configurable needs and vector addresses.
  • Up to 45 of 5 V tolerant quick general purposeI/O pins in a small LQFP64 bundle.
  • Up to 21 external interrupt with pins available.
  • 60 MHz greatest CPU clock available from programmable on-chip PLL with settling time of 100 μs.
  • On-chip integrated oscillator works with an external crystal from 1 MHz to 25 MHz.
  • Power saving modes incorporate Idle and Power-down.
  • Individual enable/disable of peripheral functions and additionally peripheral clock scaling for extra power enhancement.
  • Processor wake-up from Power-down mode by means of external interrupt or BOD.
  • Single power supply chip with POR and BOD circuits:
  • CPU operating voltage range of 3.0 V to 3.6 V (3.3 V ± 10 %) with 5 V tolerant I/O pads.

2.2 Power Supply

The power supply is designed to convert over high voltage AC mains power to a reasonable low voltage supply for electronic circuits and different devices. A power supply can by broken down into a progression of interrupts, each of which plays out a specific function. A D.C. power supply which keeps up the output voltage steady regardless of a.c mains converts or load varieties is known as “Regulated D.C Power Supply”
For example a 5V regulated power supply system as display as follows:
Fig 2.2.1 Functional Block Diagram of Power supply
A transformer is an electrical device which is utilized to convert over electrical power starting with one electrical circuit then onto the next without convert in frequency.
Transformers convert over AC power starting with one voltage then onto the next with little loss of power. Transformers work just with AC and this is one reason why mains power is AC. Step-up transformers increment in output voltage, step down transformers decrease in output voltage. Most power supplies utilize a step down transformer to reduce the hazardously high mains voltage to a more secure low voltage. The input coil is known as the primary and the output coil is known as the secondary. There is no electrical connection between the two coils; rather they are connected by a substituting magnetic field made in the delicate iron core of the transformer. The two lines in the middle of the circuit image represents to the core. Transformers waste next to no power so the power out is (practically) equivalent to the power in. Take note of that as voltage is stepd down current is stepd up. The proportion of the quantity of turns on each coil, called the turn’s proportion, decides the proportion of the voltages. A step down transformer has an extensive number of turns on its primary (data) coil which is associated with the high voltage mains supply, and few turns on its secondary (output) coil to give a low output voltage.

Fig 2.2.2 An Electrical transformer
Turns ratio = Vp/VS = Np/NS
Power Out= Power In
Versus X IS=VP X IP
Vp = primary (data) voltage
Np = number of turns on primary coil
Ip = primary (data) current
A circuit, which is utilized to convert over a.c to dc, is known as RECTIFIER. The procedure of convert a.c to d.c is called “rectification”
Types of Rectifiers:
Half wave Rectifier
Full wave rectifier
1. Center  tap full wave rectifier.
2. Bridge type full bridge rectifier.
Full-wave Rectifier:
From the above examinations we came to realize that full wave bridge rectifier as a bigger number of favorable circumstances than the other two rectifiers. In this way, in our step we are utilizing full wave bridge rectifier circuit.
Bridge Rectifier:
A bridge rectifier makes utilization of four diodes in a bridge arrangement of action to accomplish full-wave correction. This is a generally utilized design, both with individual diodes wired as appeared and with single component bridges where the diode bridge is wired inside.
A bridge rectifier makes utilization of four diodes in a bridge arrangement as appeared in Figure (2.2.3) to accomplish full-wave rectification. This is a broadly utilized arrangement, both with individual diodes wired as appeared and with single component bridges where the diode bridge is wired inside.

Fig 2.2.3 Bridge rectifier
During positive half cycle of secondary, the diodes D2 and D3 are in forward one-sided while D1 and D4 are backward one-sided as appeared in the Fig. The current flow arrangement is appeared in the Figure (b) with dabbed
Fig 2.2.4 Bridge rectifier operation1
during negative half cycle of optional voltage, the diodes D1 and D4 are in forward one-sided while D2 and D3 are backward one-sided as appeared in the Figure(c). The current flow arrangement is appeared in the Figure (c) with specked bolts.

Fig 2.2.5 Bridge rectifier operation2
A Filter is a device, which expels the a.c component of rectifier output however permits the d.c part to achieve the heap.
Capacitor Filter:
We have seen that the swell substance in the amended output of half wave rectifr is 121% or that of full-wave or bridge rectifier or bridge rectifier is 48% such high rates of swells is not adequate for the vast majority of the applications. Swells can be evacuated by one of the accompanying techniques for separating:
(a) A capacitor, in parallel to the heap, gives a simpler by –pass to the swells voltage however it because of low impedance. At swell frequency and leave the displays up the heap.
(b) An inductor, in arrangement with the heap, keeps the section of the swell current (because of high impedance at swell frequency) while permitting the d.c (because of low imperviousness to d.c)
(c) Various mixes of capacitor and inductor, for example, L-component filter Component filter, different component filter and so forth which make utilization of both the properties specified in (an) and (b) above. Two examples of capacitor filter, one bridgeed on half wave rectifier and another with full wave rectifier.
Voltage controller ICs is available with settled (normally 5, 12 and 15V) or variable output voltages. The greatest current they can pass additionally rates them. Negative voltage controllers are available, chiefly for use in double supplies. Most controllers incorporate some programmed insurance from unreasonable current (‘over-burden assurance’) and overheating (‘warm security’). A large number of the settled voltage controllers ICs have 3 leads and look like power transistors, for example, the 7805 +5V 1A controller appeared on the privilege. The LM7805 is easy to utilize. You basically associate the positive lead of your unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin, interface the negative prompt the Common pin and afterward when you turn on the power, you get a 5 volt supply from the output pin.

Fig 2.2.6 Three Terminal Voltage Regulator
The Bay Linear LM78XX is integrated direct positive controller with three terminals. The LM78XX offer a few settled output voltages making them valuable in extensive variety of uses. At the point when utilized as a zener diode/resistor mix substitution, the LM78XX ordinarily brings about a successful output impedance convert of two requests of greatness, lower tranquil current. The LM78XX is available in the TO-252, TO-220 and TO-263packages,

  • Output Current of 1.5A
  • Output Voltage Tolerance of 5%
  • Internal warm over-burden insurance
  • Internal Short-Circuit Limited
  • No External Component
  • Output Voltage 5.0V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24V
  • Offer in plastic TO-252, TO-220 and TO-263
  • Direct Replacement for LM78XX

2.3 Liquid crystal display

Fluid gem displays (LCDs) have materials, which consolidate the properties of both fluids and crystals. As opposed to having a liquefying point, they have a temperature run inside which the particles are practically as versatile as they would be in a fluid, yet are assembled together in a requested frame like a gem.
A LCD comprises of two glass boards, with the fluid gem material sand witched in the middle of them. The internal surface of the glass plates are covered with straightforward cathodes which characterize the character, images or examples to be display polymeric layers are available in the middle of the terminals and the fluid crystal, which makes the fluid gem particles to keep up a characterized introduction edge.
At the point when the LCD is in the off state, light beams are pivoted by the two polarizers and the fluid gem, to such an extent that the light beams left the LCD with no introduction, and consequently the LCD seems straightforward.
This area depicts the operation methods of LCD’s then portray how to program and interface a LCD to 8051 utilizing Assembly and C.
LCD operation
As of late the LCD is finding broad utilize supplanting LEDs (seven-section LEDs or other multi fragment LEDs).This is because of the accompanying reasons:

  1. The declining costs of LCDs.
  2. The function to display numbers, characters and illustrations. This is in contract to LEDs, which are restricted to numbers and a couple characters.
  3. Fuse of an invigorating controller into the LCD, there by alleviating the CPU of the errand of reviving the LCD. In the complexity, the LED must be revived by the CPU to continue displaying the data.
  4. Simplicity of programming for characters and recurrentation.

Image result for lcd display module
Fig 2.3.1 LCD

2.4 Fire sensor (MQ3)

Smoke sensor is utilized to identify any spillage of smoke and any risky gasses with the end goal that an alert can be started to maintain a strategic distance from any harms in the enterprises. These sensors are likewise utilized as a part of multiple applications like corporate and in any office work regions these are bridged to flame cautions And ringers through the small scale controller.
There are two principle types of smoke indicators: Ionization locators and photoelectric finders. A smoke caution utilizes one or both strategies, now and then in addition to a warmth identifier, to caution of a fire.
IR transmitter and receiver:
Here the IR transmitter is only the IR LED. It just resembles a typical LED yet transmits the IR signals. Since the IR beams are out of the noticeable range we can’t watch the beams from the transmitter.
These are infrared LEDs; the light output is not unmistakable by our eyes. They can be utilized as swap LEDs for remote powers, night vision for camcorders, imperceptible shaft sensors, and so on.
IR LED (5mm)
Fig 2.4.1 IR LED

2.5 Buzzer:

A ringer or beeper is a flagging device, normally electronic, commonly utilized as a part of autos, family unit apparatuses, for example, a microwave broilers, and amusement appears.
“Buzzer” originates from the scratching commotion that signals made when they were electromechanical devices, worked from stepd down AC line voltage at 50 or 60 cycles. Different sounds regularly used to show that a catch has been squeezed are a ring or a beep. The “Piezoelectric sound parts” current in this work on an imaginative rule using normal wavering of piezoelectric pottery. These bells are offered in lightweight minimal sizes from the littlest breadth of 12mm to vast Piezo electric sounders. Today, piezoelectric sound components are utilized as a part of multiple arrangements, for example, home apparatuses, OA gear, sound hardware phones, and so forth. What’s more, they are bridgeed broadly, for example, in alerts, recurrentsers, phone ringers, recipients, transmitters, beep sounds, and so on.
Fig 2.5.1 Types of Buzzers

2.6 DC Motor

DC motors are configured in many types and sizes, including brush less, servo, and rigging motor types. A motor comprises of a rotor and a convert less magnetic field stator. The magnetic field is kept up utilizing either convert less magnets or electromagnetic windings. DC motors are most normally utilized as a part of variable speed and torque.
Movement and powers cover an extensive variety of parts that somehow are utilized to produce as well as power movement. Zones inside this classification incorporate arrangement and bushings, grips and brakes, powers and drives, drive parts, encoders and resolves, Integrated movement power, confine switches, straight actuators, direct and rotating movement components, direct position detecting, motors (both AC and DC motors), introduction position detecting, pneumatics and pneumatic components, situating stages, slides and aides, power transmission (mechanical), seals, slip rings, solenoids, springs.
The L293 is a integrated circuit motor driver that can be utilized for synchronous, bi-instructional power of two little motors. Little means little. The L293 is restricted to 600 mA, however in actuality can just deal with much little flows unless you have done some genuine warmth sinking to hold the case temperature down. Uncertain about whether the L293 will work with your motor? Attach the circuit and run your motor while keeping your finger on the chip. On the off chance that it gets excessively hot, making it impossible to touch, you can’t utilize it with your motor. (Note to ME2011 understudies: The L293 ought to be OK for your little motor yet is not OK for your rigging motor.)

  • You can power 2 motors in both instructions instead of 4 in only one instruction.


  • There is a 1.5V voltage drop within the L293D driver chip.




Software used is
*KEIL µVision utilizing Embedded C programming
*Express PCB for lay out design
*Express SCH for schematic design
Express PCB:
Express PCB is a Circuit Design Software and PCB fabricating administration. One can learn nearly all that you have to think about Express PCB from the help themes included with the projects given.
Express PCB, Version 5.6.0
Express SCH
The Express SCH schematic design program is anything but difficult to use. This product enables the user to draw the Schematics with intuitive choices.
A Quick Start Guide is given by which the user can figure out how to use it.
Express SCH, Version 5.6.0


The programming Language used here in this step is an Embedded C Language. This Embedded C Language is not quite the same as the non specific C dialect in couple of things like
Access over the architecture addresses.
The Embedded C Programming Language frames the easy to understand dialect with access over Port locations, SFR Register addresses and so on.
Embedded C Data types:

Data Types Size in Bits Data Range/Usage
unsigned char 8-bit 0-255
signed char 8-bit -128 to +127
unsigned int 16-bit 0 to 65535
signed int 16-bit -32,768 to +32,767

Table 3.1.a Embedded c data types
Signed char:

  • Used to represents to the – or + values.
  • Accordingly, we have just 7 bits for the extent of the marked number, giving us values from – 128 to +127.

KEIL µVision utilizing Embedded C programming


It is possible to make the source documents in a content tool, for example, Notepad, run the Compiler on every C source record, indicating a rundown of powers, run the Assembler on every Assembler source document, determining another rundown of powers, run either the Library Manager or Linker (again indicating a rundown of powers) lastly running the Object-HEX Converter to convert over the Linker output document to an Intel Hex File. Once that has been finished the Hex File can be downloaded to the objective equipment and repaired. On the other hand KEIL can be used to make source records; naturally arrange, Bridgeton and secretive utilizing alternatives set with a simple to use UI lastly recreate or perform troubleshooting on the equipment with access to C factors and memory. Unless you need to use the tolls on the summon line, the decision is clear.
The user of KEIL center es on “steps”. A step is a rundown of all the source records required to manufacture a single application, all the instrument choices which determine precisely how to fabricate the application, and – if required – how the application ought to be reenacted. A step contains enough data to take an arrangement of source records and create precisely the twofold code required for the application. In light of the high level of adaptability required from the instruments, there are multiple alternatives that can be set to configure the devices to work in a particular way. It is repetitive to need to set these choices up each time the application is being manufactured; in this manner they are put away in a step record. Stacking the step document into KEIL educates KEIL which source records are required, where they are, and how to configure the apparatuses in the right way. KEIL can then execute each instrument with the right choices. It is additionally conceivable to make new undertakings in KEIL. Source documents are added to the step and the device choices are set as required. The step can then be spared to safeguard the settings.
The simulator/debugger in KEIL can play out an exceptionally point by point recreation of a small scale controller alongside external signs. It is conceivable to see the exact execution time of a single get together instruction, or a single line of C code, as far as possible up to the whole application, primaryly by entering the crystal frequency. A window can be opened for every peripheral on the device, demonstrating the condition of the peripheral. This enables snappy debugging of mis-conFigd peripherals. Breakpoints might be determined to either get together instructions or lines of C code, and execution might be step through one guideline or C line at once.











Fig 4.1.1 Block Diagram

4.2 Functional Block Diagram:

Fig 4.2.1 functional block diagram
LPC2148 Pin Description

Table 4.2.a MC LPC2148 Pin Description

  • ARM Prime Cell™ Vectored Interrupt Regulator
  • 32 interrupt on request inputs
  • 16 vectored IRQ interrupts
  • 16 priority levels dynamically allocated to interrupt on request
  • Software interrupts generation.

The Vectored Interrupt Regulator (VIC) takes 32 interrupt with request inputs and programmable assigns them into 3 classifications, FIQ, vectored IRQ, and non-vectored IRQ. The programmable task plot implies that needs of interrupts from the different peripherals can be powerfully appointed and balanced. Quick Interrupt ask for (FIQ) asks for have the most noteworthy need. On the off chance that more than one request is assigned to FIQ, the VIC ORs the request to deliver the FIQ flag to the ARM processor. The speediest conceivable FIQ inactivity is accomplished when just a single request is delegated FIQ, in light of the fact that then the FIQ benefit routine can basically begin managing that device.
Be that as it may, if more than one request is relegated to the FIQ class, the FIQ benefit routine can read a word from the VIC that distinguishes which FIQ source(s) is (are) asking for an interrupt. Vectored IRQs have the center need, however just 16 of the 32 request can be relegated to this classification. Any of the 32 requests can be doled out to any of the 16 vectored IRQ openings, among which space 0 has the most elevated need and space 15 has the least.
Non-vectored IRQs have the least need
The VIC ORs the request from all the vectored and non-vectored IRQs to create the IRQ flag to the ARM processor. The IRQ benefit routine can begin by perusing an enroll from the VIC and bouncing there. In the event that any of the vectored IRQs are asking for, the VIC gives the address of the most astounding need asking for IRQs benefit normal, else it gives the address of a default schedule that is shared by all the non-vectored IRQs.
LPC2148 MC Register description:

Table 4.2.b MC LPC2148 Pin Description

  • 16 byte Receive and Transmit FIFOs
  • Register locations conformed in with ‘550 industry standard
  • Receiver FIFO trigger points  at 1, 4, 8, and 14 bytes
  • Worked in fragmentary baud rate generator with autobauding capabilities.
  • Instrument that enables software and equipment flow power execution

UART-0 Pin description:

Table 4.2.b UART0  pin description
UART-0 Register description:

Table 4.2.c UART-0 Register Description
UART0 register description

  • The VPB interface gives an interconverts bridge between the CPU or have and the UART0.
  • The UART0 recipient bit, U0RX, screens the serial input line, RXD0, for legitimate data. The
  • UART0 RX Shift Register (U0RSR) acknowledges legitimate characters through RXD0. After a substantial character
  • is gathered in the U0RSR, it is passed to the UART0 RX Buffer Register FIFO to anticipate access by the CPU or host through the non-specific host interface.
  • The UART0 transmitter block, U0TX, acknowledges data composed by the CPU or host and cradles the data in the UART0 TX Holding Register FIFO (U0THR). The UART0 TX Shift Register (U0TSR) peruses the data put away in the U0THR and collects the data to transmit by means of the serial output pin, TXD0

The UART0 Baud Rate Generator bit, U0BRG, produces the designing enables used by the UART0 TX block. The U0BRG clock input source is the VPB clock (PCLK). The fundamental clock is isolated down per the divisor indicated in the U0DLL and U0DLM registers. This separated down clock is a 16x oversample clock, NBAUDOUT. The interrupt on interface contains registers U0IER and U0IIR. The interrupt on interface gets a few one clock wide enables from the U0TX and U0RX blocks. Status data from the U0TX and U0RX is put away in the U0LSR. Power data for the U0TX and U0RX is put away in the U0LCR
Fig 4.2.2 UART0 block diagram

  • UART1 is indistinguishable to UART0, with the expansion of a modem interface.
  • 16 byte Receive and Transmit FIFOs.
  • Register sections conformed in with ‘550 industry standard.
  • Beneficiary FIFO trigger points at 1, 4, 8, and 14 bytes.
  • Worked in partial baud rate generator with autobauding capabilities.
  • Component that enables softwaring and equipment flow power execution.
  • Standard modem interface signals included with flow power (auto-CTS/RTS) completely upheld in equipment (LPC2144/6/8 as it were).

UART-1 Pin description:

Table 4.2.e UART1 pin description
UART-1 Register description:

Table 4.2.f UART1 register description
The VPB interface gives an interconverts bridge between the CPU or have and the UART1. The UART1 receiver bit, U1RX, screens the serial input line, RXD1, for legitimate data. The UART1 RX Shift Register (U1RSR) acknowledges substantial characters through RXD1. After a substantial character is amassed in the U1RSR, it is passed to the UART1 RX Buffer Register FIFO to anticipate access by the CPU or host by means of the nonexclusive host interface The UART1 transmitter block, U1TX, acknowledges data composed by the CPU or host and supports the data in the UART1 TX Holding Register FIFO (U1THR). The UART1 TX Shift Register
U1TSR) peruses the data put away in the U1THR and gathers the data to transmit through the serial output pin, TXD1. The UART1 Baud Rate Generator block, U1BRG, produces the designning enables used by the UART1 TX bit. The U1BRG clock input source is the VPB clock (PCLK). The primary clock is separated down per the divisor determined in the U1DLL and U1DLM registers. This separated down clock is a 16x oversample clock, NBAUDOUT The modem interface contains registers U1MCR and U1MSR. This interface is in charge of handshaking between a modem peripheral and the UART1
The interrupt on interface contains registers U1IER and U1IIR. The interrupt on interface gets a few one clock wide enables from the U1TX and U1RX bits. Status data from the U1TX and U1RX is put away in the U1LSR. Power data for the U1TX and U1RX is put away in the U1LCR.
     Fig 4.2.3 UART1 block diagram

  • 10 bit successive approximation analog to digital converter (one in LPC2141/2 and two in LPC2144/6/8).
  • Input multiplexing among 6 or 8 pins (ADC0 and ADC1).
  • power down mode.
  • Burst conversion mode for single or various data sources.
  • Optional conversion on transition data pin or Timer Match flag.
  • Worldwide Start order for both converters (LPC2144/6/8 as it were).

Primary timing for the A/D converters is given by the VPB clock. A programmable divider is incorporated into every converter, to scale this clock to the 4.5 MHz (max) clock required by the successive estimation handle. A completely precise transformation requires 11 of these tickers.
ADC Pin description:

Table 4.2.g ADC pin description
ADC Register description:
    Table 4.2.h ADC register description
Hardware triggered conversion:
In the event that the BURST bit in the ADCR is 0 and the START field contains 010-111, the ADC will begin a transformation when a move happens on a chose pin or Timer Match flag. Th decisions incorporate convert on a predetermined edge of any of 4 Match signs, or transformation on a predefined edge of both of 2 Capture/Match pins. The pin state from the chose cushion or the chose Match flag, XORed with ADCR bit 27, is used as a part of the edge identification rationale
An interrupt with request is attested to the Vectored Interrupt Regulator (VIC) when the DONE bit is 1. Softwareing can use the Interrupt Enable bit for the A/D Converter in the VIC to power whether this declaration brings about an interrupt. DONE is nullified when the ADDR is perused.

  • Measures the progression of time to keep up a schedule and clock.
  • Ultra Low Power configuration to bolster battery fueled systems
  • Gives Seconds, Minutes, Hours, Day of Month, Month, Year, Day of Week, and Day of Year
  • Committed 32 kHz oscillator or programmable prescalar from VPB clock.
  • Committed power supply pin can be associated with a battery or to the principle 3.3v

On, and alternatively when it is off. It uses little power in Power-down mode. On the LPC2141/2/4/6/8, the RTC can be timed by a different 32.768 KHz oscillator, or by a programmable prescales divider in light of the VPB clock. Additionally, the RTC is powered by it’s, which can be associated with a battery or to the same 3.3 V supply used by whatever is left of the device.
Fig 4.2.4 RTC Block diagram
RTC Register description:
The RTC incorporates various registers. The address space is part into four sections by usefulness. The initial eight locations are the Miscellaneous Register Group. The second arrangement of eight sections is the Time Counter Group. The third arrangement of eight sections contain the Alarm Register Group. The rest of the registers power the Reference Clock Divider. The Real Time Clock incorporates the register appeared in Table 263. Point by point descriptions of the registers take after.

Table 4.2.i RTC pin description
RTC interrupts:
Interrupt with era is powerled through the Interrupt Location Register (ILR), Counter Increment Interrupt Register (CIIR), the alert registers, and the Alarm Mask Register (AMR). Interrupts are produced just by the move into the interrupt on state. The ILR independently enables CIIR and AMR interrupts. Each bit in CIIR relates to one of the time counters. In the event that CIIR is enableed for a specific counter, then every time the counter is Incremented a interrupt is produced. The caution registers enable the client to determine a date and time for a interrupt to be created. The AMR gives a component to cover alert Compares. On the off chance that all non masked caution registers coordinate the incentive in their relating time counter, then a interrupt is created. The RTC interrupt can bring the micro controller out of shut down mode if the RTC is operating from its own oscillator on the RTCX1-2 pins. At the point when the RTC interrupt is enabled for wakeup and its chose event happens, XTAL1/2 pins related oscillator wakeup cycle is begun
Miscellaneous register group:

Clock Tick Counter Register (CTCR – 0xE002 4004):
The Clock Tick Counter is read only. It can be reset to zero through the Clock Control Register (CCR). The CTC consists of the bits of the clock divider counter

4.3 LCD Pin Description

The LCD discussed in this section has 14 pins. The function of each pins is given in table.

Pin symbol I/O Description
1 Vss Ground
2 Vcc +5V power supply
3 VEE Power supply to control contrast
4 RS I RS=0 to select command register 
RS=1 to select
data register
5 R/W I R/W=0 for write 
R/W=1 for  read
6 E I/O Enable
7 DB0 I/O The 8-bit data bus
8 DB1 I/O The 8-bit data bus
9 DB2 I/O The 8-bit data bus
10 DB3 I/O The 8-bit data bus
11 DB4 I/O The 8-bit data bus
12 DB5 I/O The 8-bit data bus
13 DB6 I/O The 8-bit data bus
14 DB7 I/O The 8-bit data bus

Table 4.3.a LCD pin description
TABLE 2: LCD Command Codes

Command to LCD Instruction 
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 on
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 1st line
C0 Force cursor to beginning of 2nd line
38 2 lines and 5×7 matrix

Table 4.3.b LCD commands
LCD ConnectionSending commands and data to LCDs with a time delay:
Fig 4.3.1 Interfacing of LCD to a micro controller
To send any command from table 2 to the LCD, make pin RS=0. For data, make RS=1.Then sends a high –to-low pulse to the E pin to enable the internal latch of the LCD.

oscillating system:

Basically, the sound wellspring of a piezoelectric sound component is a piezoelectric stomach. A piezoelectric stomach comprises of a piezoelectric fired plate which has terminals on both sides and a metal plate (metal or stainless steel, and so forth.). A piezoelectric ceramic plate is attached to a metal              plate              with              adhesives. Figure. 2 shows the oscillating system of a piezoelectric diaphragm. Applying D.C. voltage between anodes of a piezoelectric stomach causes mechanical bending because of the piezoelectric impact. For a deformed piezoelectric element, the distortion of the piezoelectric element expands in a radial instruction. And the piezoelectric diaphragm              bends              toward              the              instruction.

Fig 4.4.1 structure and oscillation system of piezoelectric
The metal plate bonded to the piezoelectric element does not expand. Conversely, when the piezoelectric element shrinks, the piezoelectric diaphragm bends in the direction. Thus,when AC voltage is applied across electrodes, the bending producing sound waves in the air.

4.5 DC Motor

In any electric motor, operation depends on basic electromagnetism. A current-conveying conductor produces an magnetic field; when this is then set in an external magnetic field, it will encounter a compel relative to the current in the conductor, and to the quality of the external magnetic field. As you are very much aware of from playing with magnets as a child, inverse (North and South) polarities pull in, while like polarities (North and North, South and South) repulse. The interior arrangement of a DC motor is designed to saddle the magnetic poles between a current-conveying conductor and an external magnetic field to produce rotational movement.
We should begin by taking a gander at a straightforward 2-shaft DC electric motor (here red communicates to a magnet or twisting with a “North” polarization, while green communicates to a magnet or twisting with a “South” polarization).
Fig 4.5.1Block Diagram of the DC motor
Each DC motor has six primary parts – hub, rotor (a.k.a., armature), stator, commutator, field magnet(s), and brushes. In most normal DC motors (and all that Beamers will see), the external magnetic field is created by high-quality lasting magnets1. The stator is the stationary bit of the motor – this incorporates the motor packaging, and also at least two convertless magnet post bits. The rotor (together with the pivot and appended commutator) turns concerning the stator. The rotor comprises of windings (by and large on a center), the windings being electrically associated with the commutator. The above chart demonstrates a typical motor format – with the rotor inside the stator (field) magnets. In actuality, however, DC motors will dependably have more than two shafts (three is an extremely basic number). Specifically, this keeps away from “dead spots” in the commutator. You can envision how with our case two-shaft motor, if the rotor is precisely at the center of its turn (consummately lined up with the field magnets), it will get “stuck” there. In the interim, with a two-shaft motor, there is a minute where the commutator shorts out the power supply (i.e., both brushes touch both commutator contacts all the while). This would be terrible for the power supply, waste vitality, and harm motor components also. However another disservice of such a straightforward motor is, to the point that it would show a high measure of torque” swell” (the measure of torque it could create is cyclic with the position of the rotor).
2-pole motor in action
Fig 4.5.2 Block Diagram of the DC motor having two poles only
Image                  So since most small DC motors are of a three-pole design, let’s tinker with the workings of one via an interactive animation (JavaScript required):
Fig 4.5.3 Block Diagram of the DC motor having Three poles
You’ll notice a few things from this — namely, one pole is fully energized at a time (but two others are “partially” energized). As each brush transitions from one commutator contact to the next, one coil’s field will rapidly collapse, as the next coil’s field will rapidly charge up (this occurs within a few microsecond). We’ll see more about the effects of this later, but in the meantime you can see that this is a direct result of the coil windings’ series wiring:

Fig 4.5.4 Internal Block Diagram of the Three pole DC motor
There’s probably no better way to see how an average dc motor is put together, than by just opening one up. Unfortunately this is tedious work, as well as requiring the destruction of a perfectly good motor.  This is a basic 3-pole dc motor, with 2 brushes and three commutator contacts.
DC motors are typically controlled by using a transistor configuration called an “H-bridge“. This consists of a minimum of four mechanical or solid-state switches, such as two NPN and two PNP transistors. One NPN and one PNP transistor are activated at a time. Both NPN and PNP transistors can be activated to cause a short across the motor terminals, which can be useful for slowing down the motor from the back EMF it creates.

  1. Using Relays:

A simple implementation of an H Bridge using four SPST relays is displayn. Terminal A is High Side Left, Terminal B is High Side Right, Terminal C is Low Side Left and Terminal D is Low Side Right. The logic followed is according to the table above.
Warning:Never turn on A and C or B and D at the same time. This will lead to a short circuit of the battery and will lead to failure of the relays due to the large current.
D:Documents and Settings123Local SettingsTemporary Internet FilesContent.IE5DesktophbridgeH-Bridge s_fileshb3.png
Fig 4.5.5 H-Bridge Using Relays

  1. Using Transistors:

We can better control our motor by using transistors or Field Effect Transistors (FETs). Most of what we have discussed about the relays H-Bridge is true of these circuits. See the diagram displaying how they are connected. You should add diodes across the transistors to catch the back voltage that is generated by the motor’s coil when the power is switched on and off. This fly back voltage can be many times higher than the supply voltage!
WarningIf you don’t use diodes, you could burn out your transistors. Also the same warning as in the diode case. Don’t turn on A and C or B and D at the same time.
D:Documents and Settings123Local SettingsTemporary Internet FilesContent.IE5DesktophbridgeH-Bridge s_fileshb7.png
Fig 4.5.6 H-Bridge Using Transistor
Transistors, being a semiconductor device, will have some resistance, which causes them to get hot when conducting much current. This is called not being able to sink or source very much power, i.e.: Not able to provide much current from ground or from plus voltage.
MOSFETs are much more efficient, they can provide much more current and not get as hot. They usually have the fly back diodes built in so you don’t need the diodes anymore. This helps guard against fly back voltage frying your ICs. To use MOSFETs in an H-Bridge, you need P-Channel MOSFETs on top because they can “source” power, and N-Channel MOSFETs on the bottom because then can “sink” power.
It is important that the four quadrants of the H-Bridge circuits be turned on and off properly. When there is a path between the positive and ground side of the H-Bridge, other than through the motor, a condition exists called “shoot through”. This is basically a direct short of the power supply and can cause semiconductors to become ballistic, in circuits with large currents flowing. There are H-bridge chips available that are much easier, and safer, to use than designing your own H-Bridge circuit.

  1. Using H-Bridge Devices

The L293 has 2 H-Bridges (actually 4 Half H-Bridges), can provide about 1 amp to each and occasional peak loads to 2 amps.
The L298 has 2 h-bridges on board, can handle 1amp and peak current draws to about 3amps. The LMD18200 has one h-bridge on board, can handle about 2 or 3 amps and can handle a peak of about 6 amps. There are several more commercially designed H-Bridge chips as well.
Once a Half H-bridge is enabled, it truth table is as follows:


So you just give a High level when you want to turn the Half H-Bridge on and Low level when you want to turn it off. When the Half H-Bridge is on, the voltage at the output is equal to Vcc2.If you want to make a Full H-Bridge, you connect the motor (or the load) between the outputs of two Half H-Bridges and the inputs will be the two inputs of the Half H-Bridges.
Suppose we have connected Half H-Bridges 1 and 2 to form a Full H-Bridge. Now the truth table is as follows:

L L L L Braking (both terminals of motor are Gnd)
L H L H Forward Running
H L H L Backward Running
H H H H Braking (both terminals of motor at Vcc2

The L293 comes in a standard 16-pin, dual-in line integrated circuit package. There is an L293 and an L293D part number. Pick the “D” version because it has built in fly back diodes to minimize inductive voltage spikes. The pinout for the L293 in the 16-pin package is display below in top view. Pin 1 is at the top left when the notch in the package faces up. Note that the names for pin functions may be slightly different than what is displayn in the following diagrams.

Fig 4.5.7 Pin Diagram of L293D
The following schematic displays how to connect the L293 to your motor and the Stamp. Each motor takes 3 Stamp pins. If you are only using one motor, leave pins 9, 10, 11, 12, 13, 14, and 15 empty.

Fig 4.5.8 DC motor operation
Assume you have only one motor connected with the enable tied to Stamp Pin 0, and the two direction controls tied to Stamp Pins 1 and 2.
Here is a table describing the control pin functions.

H H L Turn right
H L H Turn left
H L/H L/H Fast stop
L either Either Slow stop

Table 4.5.a DC motor control pin functions

4.6 Software Implementation

About KeilARM:

  1. Click on the Keil u Vision3  Icon on Desktop
  2. The  following Fig will appear

Fig 4.6.1 eil procedure step -1
3.Click on the Project menu from the title bar
4.Then Click on New Project

Fig 4.6.2 keil procedure step -2
5.Save the Project by typing suitable project name with no extension in u r own folder sited in either C: or D:

Fig 4.6.3 keil procedure step -3
6. Then Click on Save button above.
7. Select the component for u r project. i.e.NXP……
8. Click on the + Symbol beside of NXP

Fig 4.6.4 Keil procedure step -4
9.Select LPC2148 as displayn below

Fig 4.6.5 keil procedure step -5
10.Then Click on “OK”
11.The Following Fig will appear

Fig 4.6.6 keil procedure step -6
12.Then Click   YES
13.Now your project is ready to USE
14.Now double click on the Target1, you would get another option “Source group 1” as displayn in next page.

Fig 4.6.7 keil procedure step -7
15.Click on the file option from menu bar and select “new”

Fig 4.6.8 keil procedure step -8
16.The next screen will be as displayn in next page, and just maximize it by double clicking on its blue boarder.

Fig 4.6.9 keil procedure step -9
17.Now start writing program in either in “C”  or “ASM”
18.For a program written in Assembly, then save it with extension “. asm”  and  for “C” based program save it with extension “ .C”

Fig 4.6.10 keil procedure step -10
19.Now right click on Source group 1 and click on “Add files to Group Source”

Fig 4.6.11 keil procedure step -11
20.Now you will get another window, on which by default “C” files will appear

Fig 4.6.12 keil procedure step -12
21.Now select as per your file extension given while saving the file
22.Click only one time on option “ADD”
23.Now Press function key F7 to compile. Any error will appear if so happen.

Fig 4.6.13 keil procedure step -13
24.If the file contains no error, then press Control+F5 simultaneously.
25.The new window is as follows

Fig 4.6.14 keil procedure step -14
26.Then Click “OK”
27.Now Click on the Peripherals from menu bar, and check your required port as displayn in Fig below

Fig 4.6.15 keil procedure step -15
29.Drag the port a side and click in the program file

Fig 4.6.16 keil procedure step -16
29.Now keep Pressing function key “F11” slowly and observe.
30.You are running your program successfully
Flash magic
Flash Magic is a PC tool for programming flash based microcontrollers from NXP using a serial or Ethernet protocol while in the target hardware. The Figureures below display how the baud rate is selected for the microcontroller, how are the registers erased before the device is programmed.
Fig 4.6.17 Dumping of the code into Microcontroller
Fig 4.6.18 Dump process finished
If dumping process of the hex file is completed, then the controller will work as per our requirement




By this prototype we can implement a safety system which avoids the deficiency of oxygen due to congestion control and also passengers will be saved from fire accidents.

Fig 4.1.1 result-1

  • When power is on the liquid crystal display (LCD) shows “WELCOME TO THE METRO TRAIN”.

Fig 4.6.2 result-2

  • Whenever the train arrives at the station it stops automatically as sensed by an IR sensor. Which is placed at entry of the station.
  • Whenever the train is entered into the station the door is automatically opens and engine stops.
  • Door motor will rotate in forward direction according to this door will open and train engine motor stops rotating.

Fig 4.6.3 result-3

  • When persons entered into the train the IR sensor sense the persons entry which is placed at entry of the door. Then persons count will be increment.
  • Count is displayed on the LCD shown in above fig.

Fig 4.6.4 redult-4

  • When persons exit from the train IR sensor sense the persons exit which is placed at exit door. And count is decremnt.
  • In this project we are used seperated doors for entry and exit.
  • In the above fig shows exit count.

Fig 4.6.5 result-5

  • The persons count is limited to 10 so after 10 passengers getting into the train irrespective of the time the doors will be automatically closed and the train will be starts.
  • Then door motor will rotate in reverse direction so that door will be closed. And engine motor starts rotating.
  • Or there will be a time set already as how many minutes the train will stops at every station that is 20 seconds which is set in the controller by the program

Fig 4.6.6 result-6

  • Fir sensor sense the temperature when temperature is greater than 50 the train incorporates a buzzer to alert the passengers.




Integrating features of all the hardware components used have developed it. Presence of every module has been reasoned out and placed carefully thus contributing to the best working of the unit.
Secondly, using highly advanced IC’s and with the help of growing technology the project has been successfully implemented. The project “AUTO METRO TRAIN TO SHUTTLE BETWEEN STATIONS” has been successfully designed and tested.
This project is useful in developing countries and this project has a bright future as it is being used in countries like Germany, France and Japan. This project help us to control train without a driver and the stations are display on the LCD so the passengers doesn’t have any type of difficulty. This project will lead to increase in technological trends and this will help the people in many ways.


[1]. ARM7TDMI “Datasheet ARM
[2]. LPC2119/2129/2194/2292/2294 “User Manual Philips
[3]. ARM System on chip architecture “Steve Furber
[4]. Architecture “Reference Manual David Seal
[5]. ARM System developers guide “Andrew N. Sloss Dominic Symes
[7]. Micro C/OS-II “Jean J. Labrosse GCC The complete reference Arthur  Griffith
[8]. “ for Embedded Development Tools
[4]. “ for ARM processor”
[8]. “ for embedded software
[10]. “Evaluation Boards And Modules


#include “lcd.h”
#include “ADC0.h”
unsigned char temp;
#define m1 (1 << 20)
#define m2 (1 << 21)
#define m3 (1 << 22)
#define b (1 << 10)
int main()
disp_loc(0x80,”  WELCOME TO   “);
disp_loc(0xc0,” METRO TRAIN “);
lcd_str(“TRAIN ENTERED “);
lcd_str(“INTO STATION “);
lcd_str(“FROM STATION “);
lcd_str(“ENTRY COUNT”);
lcd_str(“EXIT COUNT”);
{ IOSET0|=b;
disp_loc(0x80,”FIRE  “);
disp_loc(0xC0,”FIRE DETECTED”);

EssayHub’s Community of Professional Tutors & Editors
Tutoring Service, EssayHub
Professional Essay Writers for Hire
Essay Writing Service, EssayPro
Professional Custom
Professional Custom Essay Writing Services
In need of qualified essay help online or professional assistance with your research paper?
Browsing the web for a reliable custom writing service to give you a hand with college assignment?
Out of time and require quick and moreover effective support with your term paper or dissertation?