0% found this document useful (0 votes)
46 views

Automatic Movable Railway Platform With Train Arrival Detection

The document discusses power supply systems used in embedded systems. It describes how AC power from a mains supply is stepped down by a transformer, rectified by a bridge rectifier, filtered by a capacitor to remove ripples, and regulated to produce a clean DC output. Key components discussed are the transformer, rectifier, filter, and voltage regulator.

Uploaded by

RUSHI Gadgerao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Automatic Movable Railway Platform With Train Arrival Detection

The document discusses power supply systems used in embedded systems. It describes how AC power from a mains supply is stepped down by a transformer, rectified by a bridge rectifier, filtered by a capacitor to remove ripples, and regulated to produce a clean DC output. Key components discussed are the transformer, rectifier, filter, and voltage regulator.

Uploaded by

RUSHI Gadgerao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 52

CHAPTER 1

INTRODUCTION

1
INTRODUCTION TO EMBEDDED SYSTEMS

An embedded system can be defined as a computing device that does a specific focused job.
Appliances such as the air-conditioner, VCD player, DVD player, printer, fax machine, mobile
phone etc. are examples of embedded systems. Each of these appliances will have a processor
and special hardware to meet the specific requirement of the application along with the
embedded software that is executed by the processor for meeting that specific requirement. The
embedded software is also called “firm ware”. The desktop/laptop computer is a general purpose
computer. You can use it for a variety of applications such as playing games, word processing,
accounting, software development and so on. In contrast, the software in the embedded systems
is always fixed listed below:
Embedded systems do a very specific task, they cannot be programmed to do different
things. . Embedded systems have very limited resources, particularly the memory. Generally,
they do not have secondary storage devices such as the CDROM or the floppy disk. Embedded
systems have to work against some deadlines. A specific job has to be completed within a
specific time. In some embedded systems, called real-time systems, the deadlines are stringent.
Missing a deadline may cause a catastrophe-loss of life or damage to property. Embedded
systems are constrained for power. As many embedded systems operate through a battery, the
power consumption has to be very low.
Some embedded systems have to operate in extreme environmental conditions such as very high
temperatures and humidity.

Application Areas
Nearly 99 per cent of the processors manufactured end up in embedded systems. The embedded
system market is one of the highest growth areas as these systems are used in very market
segment- consumer electronics, office automation, industrial automation, biomedical
engineering, wireless communication, data communication, telecommunications, transportation,
military and so on.

2
Consumer appliances: At home we use a number of embedded systems which include digital
camera, digital diary, DVD player, electronic toys, microwave oven, remote controls for TV and
air-conditioner, VCO player, video game consoles, video recorders etc. Today’s high-tech car
has about 20 embedded systems for transmission control, engine spark control, air-conditioning,
navigation etc. Even wristwatches are now becoming embedded systems. The palmtops are
powerful embedded systems using which we can carry out many general-purpose tasks such as
playing games and word processing.

Office automation: The office automation products using em embedded systems are copying
machine, fax machine, key telephone, modem, printer, scanner etc.

Industrial automation: Today a lot of industries use embedded systems for process control.
These include pharmaceutical, cement, sugar, oil exploration, nuclear energy, electricity
generation and transmission. The embedded systems for industrial use are designed to carry out
specific tasks such as monitoring the temperature, pressure, humidity, voltage, current etc., and
then take appropriate action based on the monitored levels to control other devices or to send
information to a centralized monitoring station. In hazardous industrial environment, where
human presence has to be avoided, robots are used, which are programmed to do specific jobs.
The robots are now becoming very powerful and carry out many interesting and complicated
tasks such as hardware assembly.

Medical electronics: Almost every medical equipment in the hospital is an embedded system.
These equipments include diagnostic aids such as ECG, EEG, blood pressure measuring devices,
X-ray scanners; equipment used in blood analysis, radiation, colonoscopy, endoscopy etc.
Developments in medical electronics have paved way for more accurate diagnosis of diseases.

Computer networking: Computer networking products such as bridges, routers, Integrated


Services Digital Networks (ISDN), Asynchronous Transfer Mode (ATM), X.25 and frame relay
switches are embedded systems which implement the necessary data communication protocols.
For example, a router interconnects two networks. The two networks may be running different
3
protocol stacks. The router’s function is to obtain the data packets from incoming pores, analyze
the packets and send them towards the destination after doing necessary protocol conversion.
Most networking equipments, other than the end systems (desktop computers) we use to access
the networks, are embedded systems.
Telecommunications: In the field of telecommunications, the embedded systems can be
categorized as subscriber terminals and network equipment. The subscriber terminals such as key
telephones, ISDN phones, terminal adapters, web cameras are embedded systems. The network
equipment includes multiplexers, multiple access systems, Packet Assemblers Dissemblers
(PADs), sate11ite modems etc. IP phone, IP gateway, IP gatekeeper etc. are the latest embedded
systems that provide very low-cost voice communication over the Internet.
Wireless technologies: Advances in mobile communications are paving way for many
interesting applications using embedded systems. The mobile phone is one of the marvels of the
last decade of the 20’h century. It is a very powerful embedded system that provides voice
communication while we are on the move. The Personal Digital Assistants and the palmtops can
now be used to access multimedia services over the Internet. Mobile communication
infrastructure such as base station controllers, mobile switching centers are also powerful
embedded systems.
Security: Security of persons and information has always been a major issue. We need to protect
our homes and offices; and also the information we transmit and store. Developing embedded
systems for security applications is one of the most lucrative businesses nowadays. Security
devices at homes, offices, airports etc. for authentication and verification are embedded systems.
Encryption devices are nearly 99 per cent of the processors that are manufactured end up in~
embedded systems.

4
CHAPTER 2
POWER SUPPLY

5
POWER SUPPLY:

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

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

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

output voltage from the rectifier is fed to a filter to remove any a.c components present even after

rectification. Now, this voltage is given to a voltage regulator to obtain a pure constant dc

voltage.

230V AC
50Hz D.C
Output

Step down Bridge


transformer Rectifier Regulator
Filter

Fig: Power supply

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

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

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

6
This is done by a transformer. Thus, a step down transformer is employed to decrease the voltage

to a required level.

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

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

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

The Bridge rectifier is a circuit, which converts an ac voltage to dc voltage using both half cycles
of the input ac voltage. The Bridge rectifier circuit is shown in the figure. The circuit has four
diodes connected to form a bridge. The ac input voltage is applied to the diagonally opposite
ends of the bridge. The load resistance is connected between the other two ends of the bridge.

For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct, whereas diodes D2
and D4 remain in the OFF state. The conducting diodes will be in series with the load resistance
RL and hence the load current flows through RL.

For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct whereas, D1 and
D3 remain OFF. The conducting diodes D2 and D4 will be in series with the load resistance
RL and hence the current flows through RL in the same direction as in the previous half cycle.
Thus a bi-directional wave is converted into a unidirectional wave.

7
8
Filter:

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

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

is maintained constant. However, if either of the two is varied, D.C. voltage received at this point

changes. Therefore a regulator is applied at the output stage.

9
Voltage regulator:

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

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

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

voltage regulators are to be used. The first number 78 represents positive supply and the numbers

05, 12 represent the required output voltage levels. The L78xx series of three-terminal positive

regulators is available in TO-220, TO-220FP, TO-3, D2PAK and DPAK packages and several

fixed output voltages, making it useful in a wide range of applications. These regulators can

provide local on-card regulation, eliminating the distribution problems associated with single

point regulation. Each type employs internal current limiting, thermal shut-down and safe area

protection, making it essentially indestructible. If adequate heat sinking is provided, they can

deliver over 1 A output current. Although designed primarily as fixed voltage regulators, these

devices can be used with external components to obtain adjustable voltage and currents.

10
CHAPTER 3

ARDUINO

11
ARDUINO
Overview:

The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14
digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a
16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button.
It contains everything needed to support the microcontroller; simply connect it to a computer
with a USB cable or power it with a AC-to-DC adapter or battery to get started.

The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver
chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter.
The Uno board has a resistor pulling the 8U2 HWB line to ground, making it easier to put
into DFU mode.

The board has the following new features:

1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two other new pins
placed near to the RESET pin, the IOREF that allow the shields to adapt to the voltage
provided from the board. In future, shields will be compatible with both the board that uses
the AVR, which operates with 5V and with the Arduino Due that operates with 3.3V. The
second one is a not connected pin, that is reserved for future purposes.

 Stronger RESET circuit.


 Atmega 16U2 replace the 8U2.

12
"Uno" means one in Italian and is named to mark the upcoming release of Arduino 1.0. The Uno
and version 1.0 will be the reference versions of Arduino, moving forward. The Uno is the latest
in a series of USB Arduino boards, and the reference model for the Arduino platform; for a
comparison with previous versions, see the index of Arduino boards.

Summary
Microcontroller ATmega328
Operating Voltage 5V
InputVoltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz
Length 68.6 mm
Width 53.4 mm
Weight 25 g

13
Schematic & Reference Design

Note: The Arduino reference design can use an Atmega8, 168, or 328, Current models use
an ATmega328, but an Atmega8 is shown in the schematic for reference. The pin configuration
is identical on all three processors.

14
Power
The Arduino Uno can be powered via the USB connection or with an external power supply. The
power source is selected automatically.

External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery.
The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power
jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER
connector.

The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V,
however, the 5V pin may supply less than five volts and the board may be unstable. If using
more than 12V, the voltage regulator may overheat and damage the board. The recommended
range is 7 to 12 volts.

The power pins are as follows:

 VIN. The input voltage to the Arduino board when it's using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source). You can supply
voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
 5V.This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the
VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator,
and can damage your board. We don't advise it.
 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50
mA.
 GND. Ground pins.
 IOREF. This pin on the Arduino board provides the voltage reference with which the
microcontroller operates. A properly configured shield can read the IOREF pin voltage and
select the appropriate power source or enable voltage translators on the outputs for working with
the 5V or 3.3V.

15
Memory
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of SRAM
and 1 KB of EEPROM (which can be read and written with the EEPROM library).

Input and Output


Each of the 14 digital pins on the Uno can be used as an input or output,
using pinMode(), digitalWrite(), anddigitalRead() functions. They operate at 5 volts. Each pin
can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected
by default) of 20-50 kOhms. In addition, some pins have specialized functions:

 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low
value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication
using the SPI library.
 LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.

The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution
(i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible
to change the upper end of their range using the AREF pin and the analogReference() function.
Additionally, some pins have specialized functionality:

 TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire
library.

Communication

The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
16
communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the
board channels this serial communication over USB and appears as a virtual com port to
software on the computer. The '16U2 firmware uses the standard USB COM drivers, and no
external driver is needed. However, on Windows, a .inf file is required. The Arduino software
includes a serial monitor which allows simple textual data to be sent to and from the Arduino
board. The RX and TX LEDs on the board will flash when data is being transmitted via the
USB-to-serial chip and USB connection to the computer (but not for serial communication on
pins 0 and 1).

A SoftwareSerial library allows for serial communication on any of the Uno's digital pins.

The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software
includes a Wire library to simplify use of the I2C bus; see the documentation for details. For SPI
communication, use the SPI library.

Programming
The Arduino Uno can be programmed with the Arduino software (download). Select "Arduino
Uno from the Tools > Board menu (according to the microcontroller on your board). For details,
see the reference and tutorials.

The ATmega328 on the Arduino Uno comes preburned with a bootloader that allows you to
upload new code to it without the use of an external hardware programmer. It communicates
using the original STK500 protocol (reference, C header files).

You can also bypass the bootloader and program the microcontroller through the ICSP (In-
Circuit Serial Programming) header using Arduino ISP or similar; see these instructions for
details.

The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available .
The ATmega16U2/8U2 is loaded with a DFU bootloader, which can be activated by:

17
 On Rev1 boards: connecting the solder jumper on the back of the board (near the map of
Italy) and then resetting the 8U2.
 On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to
ground, making it easier to put into DFU mode.

You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and
Linux) to load a new firmware. Or you can use the ISP header with an external programmer
(overwriting the DFU bootloader). See this user-contributed tutorial for more information.

Automatic (Software) Reset


Rather than requiring a physical press of the reset button before an upload, the Arduino Uno is
designed in a way that allows it to be reset by software running on a connected computer. One of
the hardware flow control lines (DTR) of theATmega8U2/16U2 is connected to the reset line of
the ATmega328 via a 100 nanofarad capacitor. When this line is asserted (taken low), the reset
line drops long enough to reset the chip. The Arduino software uses this capability to allow you
to upload code by simply pressing the upload button in the Arduino environment. This means
that the bootloader can have a shorter timeout, as the lowering of DTR can be well-coordinated
with the start of the upload.

This setup has other implications. When the Uno is connected to either a computer running Mac
OS X or Linux, it resets each time a connection is made to it from software (via USB). For the
following half-second or so, the bootloader is running on the Uno. While it is programmed to
ignore malformed data (i.e. anything besides an upload of new code), it will intercept the first
few bytes of data sent to the board after a connection is opened. If a sketch running on the board
receives one-time configuration or other data when it first starts, make sure that the software with
which it communicates waits a second after opening the connection and before sending this data.

The Uno contains a trace that can be cut to disable the auto-reset. The pads on either side of the
trace can be soldered together to re-enable it. It's labeled "RESET-EN". You may also be able to
disable the auto-reset by connecting a 110 ohm resistor from 5V to the reset line; see this forum
thread for details.

18
USB Over current Protection

The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from shorts
and overcurrent. Although most computers provide their own internal protection, the fuse
provides an extra layer of protection. If more than 500 mA is applied to the USB port, the fuse
will automatically break the connection until the short or overload is removed.

Physical Characteristics

The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively, with the
USB connector and power jack extending beyond the former dimension. Four screw holes allow
the board to be attached to a surface or case. Note that the distance between digital pins 7 and 8
is 160 mil (0.16"), not an even multiple of the 100 mil spacing of the other pins.

SWITCHES AND PUSHBUTTONS

There is nothing simpler than this! This is the simplest way of controlling appearance of some
voltage on microcontroller’s input pin. There is also no need for additional explanation of how
these components operate.

19
Nevertheless, it is not so simple in practice... This is about something commonly unnoticeable
when using these components in everyday life. It is about contact bounce- a common problem
with m e c h a n i c a l switches. If contact switching does not happen so quickly, several
consecutive bounces can be noticed prior to maintain stable state. The reasons for this are:
vibrations, slight rough spots and dirt. Anyway, whole this process does not last long (a few
micro- or miliseconds), but long enough to be registered by the microcontroller. Concerning
pulse counter, error occurs in almost 100% of cases!

3.3 Embedded C language


Embedded C is a set of language extensions for the C Programming language by the C
Standards committee to address commonality issues that exist between C extensions for different
embedded systems. Historically, embedded C programming requires nonstandard extensions to

20
the C language in order to support exotic features such as fixed-point arithmetic, multiple distinct
memory banks, and basic I/O operations.

The C programming language is perhaps the most popular programming language for
programming embedded systems. We mentioned other popular programming languages).
Most C programmers are spoiled because they program in environments where not only there is
a standard library implementation, but there are frequently a number of other libraries available
for use. The cold fact is, that in embedded systems, there rarely are many of the libraries that
programmers have grown used to, but occasionally an embedded system might not have a
complete standard library, if there is a standard library at all. Few embedded systems have
capability for dynamic linking, so if standard library functions are to be available at all, they
often need to be directly linked into the executable. Oftentimes, because of space concerns, it is
not possible to link in an entire library file, and programmers are often forced to "brew their
own" standard c library implementations if they want to use them at all. While some libraries are
bulky and not well suited for use on microcontrollers, many development systems still include
the standard libraries which are the most common for C programmers.

C remains a very popular language for micro-controller developers due to the code
efficiency and reduced overhead and development time. C offers low-level control and is
considered more readable than assembly. Many free C compilers are available for a wide variety
of development platforms. The compilers are part of an IDEs with ICD support, breakpoints,
single-stepping and an assembly window. The performance of C compilers has improved
considerably in recent years, and they are claimed to be more or less as good as assembly,
depending on who you ask. Most tools now offer options for customizing the compiler
optimization. Additionally, using C increases portability, since C code can be compiled for
different types of processors.

21
Figure. 3.4 Embedded System Development Environment

22
CHAPTER 4
LIQUID CRYSTAL DISPLAY

23
LCD screen:
LCD screen consists of two lines with 16 characters each. Each character consists of 5x7

dot matrix. Contrast on display depends on the power supply voltage and whether messages are

displayed in one or two lines. For that reason, variable voltage 0-Vdd is applied on pin marked as

Vee. Trimmer potentiometer is usually used for that purpose. Some versions of displays have

built in backlight (blue or green diodes). When used during operating, a resistor for current

limitation should be used (like with any LE diode).

24
LCD Basic Commands

All data transferred to LCD through outputs D0-D7 will be interpreted as commands or as data,
which depends on logic state on pin RS:

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


addresses built in “map of characters” and displays corresponding symbols. Displaying position
is determined by DDRAM address. This address is either previously defined or the address of
previously transferred character is automatically incremented.

RS = 0 - Bits D0 - D7 are commands which determine display mode. List of commands which
LCD recognizes are given in the table below:

CONTRAST CONTROL:

To have a clear view of the characters on the LCD, contrast should be adjusted. To adjust the
contrast, the voltage should be varied. For this, a preset is used which can behave like a variable
voltage device. As the voltage of this preset is varied, the contrast of the LCD can be adjusted.

Fig: Variable resistor

25
CHAPTER 5
IR SENSOR

26
IR SENSOR:
It is the same principle in ALL Infra-Red proximity sensors. The basic idea is to send
infra red light through IR-LEDs, which is then reflected by any object in front of the sensor.
Then all you have to do is to pick-up the reflected IR light. For detecting the reflected IR
light, we are going to use a very original technique: we are going to use another IR-LED, to
detect the IR light that was emitted from another led of the exact same type. This is an electrical
property of Light Emitting Diodes (LEDs) which is the fact that a led Produce a voltage
difference across its leads when it is subjected to light. As if it was a photo-cell, but with much
lower output current. In other words, the voltage generated by the leds can't be - in any way -
used to generate electrical power from light, It can barely be detected. that's why as you will
notice in the schematic, we are going to use a Op-Amp (operational Amplifier) to accurately
detect very small voltage changes.

27
The sender is composed of an IR LED (D2) in series with a 470 Ohm resistor, yielding a
forward current of 7.5mA. The receiver part is more complicated, the 2 resistors R5 and R6 form
a voltage divider which provides 2.5V at the anode of the IR LED (here, this led will be used as a
sensor). When IR light falls on the LED (D1), the voltage drop increases, the cathode's voltage of
D1 may go as low as 1.4V or more, depending on the light intensity. This voltage drop can be
detected using an Op-Amp (operational Amplifier LM358).
You will have to adjust the variable resistor (POT.) R8 so the the voltage at the positive
input of the Op-Amp (pin No. 5) would be somewhere near 1.6 Volt. if you understand the
functioning of Op-Amps, you will notice that the output will go High when the volt at the
cathode of D1 drops under 1.6. So the output will be High when IR light is detected, which is the
purpose of the receiver.

If the +ve input's voltage is higher than the -ve input's voltage, the output goes High (5v, given
the supply voltage in the schematic), otherwise, if the +ve input's voltage is lower than the -ve
input's voltage, then the output of the Op-Amp goes to Low (0V). It doesn't matter how big is the
difference between the +ve and -ve inputs, even a 0.0001 volts difference will be detected, and
the the output will swing to 0v or 5v according to which input has a higher voltage.

28
CHAPTER 6
MOTOR DRIVER (L293D)

29
MOTOR DRIVER (L293D)

Features:
 Wide supply-voltage range: 4.5V to 36V
 Separate input- logic supply
 Internal ESD protection
 Thermal shutdown
 High-Noise-Immunity input
 Functional Replacements for SGS L293 and SGS L293D
 Output current 1A per channel (600 mA for L293D)
 Peak output current 2 A per channel (1.2 A for L293D)
 Output clamp diodes for Inductive Transient Suppression(L293D)

DESCRIPTION:

L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act as
current amplifiers since they take a low-current control signal and provide a higher-current
signal. This higher current signal is used to drive the motors.

L293D contains two inbuilt H-bridge driver circuits. In its common mode of operation,
two DC motors can be driven simultaneously, both in forward and reverse direction. The motor
operations of two motors can be controlled by input logic at pins 2 & 7 and 10 & 15. Input logic
00 or 11 will stop the corresponding motor. Logic 01 and 10 will rotate it in clockwise and
anticlockwise directions, respectively.

Enable pins 1 and 9 (corresponding to the two motors) must be high for motors to start
operating. When an enable input is high, the associated driver gets enabled. As a result, the

30
outputs become active and work in phase with their inputs. Similarly, when the enable input is
low, that driver is disabled, and their outputs are off and in the high-impedance state.

Block diagram:

FIG(13): BLOCK DIAGRAM


OF L293D

Pin Diagram:

31
Fig (14)Pin Diagram

Pin description:

DC MOTOR
What is DC Motor?
A DC motor is an electric motor that runs on direct current (DC) electricity. In any electric
motor, operation is based on simple electromagnetism. A current-carrying conductor generates a
magnetic field; when this is then placed in an external magnetic field, it will experience a force
proportional to the current in the conductor, and to the strength of the external magnetic field. As
you are well aware of from playing with magnets as a kid, opposite (North and South) polarities
attract, while like polarities (North and North, South and South) repel. The internal configuration
of a DC motor is designed to harness the magnetic interaction between a current-carrying
conductor and an external magnetic field to generate rotational motion.

32
Let's start by looking at a simple 2-pole DC electric motor (here red represents a magnet
or winding with a "North" polarization, while green represents a magnet or winding with a
"South" polarization).

Fig.(15) DC motor
Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator, commutator,
field magnet(s), and brushes. In most common DC motors, the external magnetic field is
produced by high-strength permanent magnets1. The stator is the stationary part of the motor --
this includes the motor casing, as well as two or more permanent magnet pole pieces. The rotor
rotates with respect to the stator. The rotor consists of windings (generally on a core), the
windings being electrically connected to the commutator. The above diagram shows a common
motor layout -- with the rotor inside the stator (field) magnets.
The geometry of the brushes, commutator contacts, and rotor windings are such that
when power is applied, the polarities of the energized winding and the stator magnet(s) are
misaligned, and the rotor will rotate until it is almost aligned with the stator's field magnets. As
the rotor reaches alignment, the brushes move to the next commutator contacts, and energize the
next winding. Given our example two-pole motor, the rotation reverses the direction of current
through the rotor winding, leading to a "flip" of the rotor's magnetic field, driving it to continue
rotating.

Fig(16)DC Motor
33
In real life, though, DC motors will always have more than two poles (three is a very
common number). In particular, this avoids "dead spots" in the commutator. You can imagine
how with our example two-pole motor, if the rotor is exactly at the middle of its rotation
(perfectly aligned with the field magnets), it will get "stuck" there. Meanwhile, with a two-pole
motor, there is a moment where the commutator shorts out the power supply (i.e., both brushes
touch both commutator contacts simultaneously). This would be bad for the power supply, waste
energy, and damage motor components as well. Yet another disadvantage of such a simple motor
is that it would exhibit a high amount of torque "ripple".
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):

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.

34
CHAPTER 7

Software Tools

35
SOFTWARE
Arduino software
SOFTWARE DESCRIPTION
6.0. Arduino IDE compiler:
Arduino is an open-deliver electronics platform based mostly on smooth-to-use hardware
and software utility. Arduino boards can observe inputs - slight on a sensor, a finger on a
button, or a Twitter message - and flip it into an output - activating a motor, turning on an
LED, publishing a few components online. You could tell your board what to do by
sending a hard and fast of commands to the microcontroller at the board. To do so that
you use the Arduino programming language (based totally mostly on Wiring), and the
Arduino software (IDE), based on Processing.
Over the years Arduino has been the brain of lots of obligations, from regular gadgets to
complex medical gadgets. A worldwide community of makers - college students,
hobbyists, artists, programmers, and specialists - has collected spherical this open-deliver
platform, their contributions have brought as much as a terrific amount of available
know-how that can be of terrific assist to novices and experts alike.
Arduino has become born on the Ivrea interaction format Institute as a clean tool for
instant prototyping, geared towards university college students without a historic past in
electronics and programming. As quickly as it reached a miles wider community, the
Arduino board started converting to conform to new dreams and traumatic situations,
differentiating its provide from smooth eight-bit boards to merchandise for IoT
Programs, wearable, three-d printing, and embedded environments. All Arduino boards
are without a doubt open-deliver, empowering clients to assemble them independently
and ultimately adapt them to their unique dreams. The software program, too, is open-
supply, and its miles growing thru the contributions of customers globally.
The advantages of the Arduino IDE utility are
1. much less steeply-priced
2. The clean smooth programming surroundings
3. Extensible software program application utility and hardware

36
Arduino IDE

Fig Using Arduino IDE app

37
The Arduino venture gives the Arduino blanketed development surroundings (IDE), it
really is a go-platform software program software developed in the programming
language Java. It is developed to introduce programming application with software
improvement.
It includes a code editor with features in conjunction with syntax highlighting, brace
matching, and automatic indentation, and offers a simple one-click mechanism to collect
and load packages to an Arduino board. A software program written with the IDE for
Arduino is known as a "cool lively film".
Arduino IDE permits the languages C and C++ the use of special hints to set up code.
The Arduino IDE materials a software program software library called Wiring from the
Wiring task, which offers many, not unusual enter and output techniques. a massive
Arduino C/C++ cool animated film embodies abilities that might be compiled and related
with a utility stub vital() into an executable cyclic government software:
• Setup (): a feature that runs as fast as on the start of software and which can
initialize settings.
• loop (): a characteristic called time and again until the board powers off.
• Writing Sketches
• Report
• Edit
• Caricature
• Equipment
• help
• Sketchbook
• Tabs, more than one documents, and Compilation
• importing
• Libraries
• Hardware
• Serial screen
• Possibilities
• Language assist
• Forums

38
The Arduino Software (IDE) - carries a text editor for writing code, a message location, a
text console, a toolbar with buttons for all functions, and a group of menus. It joins to the
Arduino and Genuino hardware to add packages and talk with them.

6.1. WRITING SKETCHES:

Packages written utilizing Arduino software application program (IDE) are called
sketches. Those sketches are written inside the textual content editor and saved with the
document extension .ino. The editor has capabilities for slicing/pasting and for
searching/changing textual content. The message area gives comments while saving and
exporting and presentation errors. The console shows text output thru the use of the
Arduino software program (IDE), together with complete error messages and distinctive
records. The lowest right-hand nook of the window suggests the configured board and
serial port. The toolbar buttons permit you to verify and upload packages, create, open,
and keep sketches, and open the serial show.
• verify
Assessments your code for compiling it.
• upload
Compiles your code and uploads it to the board. See importing below for facts.
• Notice: if you are using an of doors programmer together with your board, you
may hold down the "shift" key for your pc while the usage of this icon. The textual
content will trade to "add the use of Programmer"
• New
Creates an ultra-modern caricature.
• Open
In case you need to open a caricature overdue under the listing, use the document | Sketch
book menu as an alternative.
• hold
Saves your cool animated film.
• Serial display
Opens the serial screen.

39
Additional instructions are decided inside the five menus: record, Edit, caricature, gear,
and help.
File:
• New
Creates today's instance of the editor, with the naked minimum form of a sketch already
in the area.
.

Figure no:6.1. Create a new sketch

• Open
Allows loading a caricature file surfing via the pc drives and folders.
• Open current-day
Provides a brief listing of the maximum ultra-modern sketches, equipped to be opened.
• Sketchbook
Suggests the contemporary-day sketches in the sketchbook folder shape; clicking on any
call opens the corresponding cool animated film in a modern-day editor instance.

• Examples

40
Any instance supplied with the useful aid of the Arduino software program application
(IDE) or library suggests up on this menu item. All of the examples are based on a tree
that lets in clean get proper of entry to by way of the usage of subject matter or library.
• keep
Saves the caricature earlier then, a call might be supplied in a "shop as.” window.
• save as...
Let’s in to maintain the cutting-edge cool animated film with a wonderful name.
• Internet page Setup
It suggests the net page Setup window for printing.
• Print
Sends the cutting-edge cartoon to the printer in step with the settings defined in net web
page Setup.
• Options
Opens the possibilities window wherein a few IDE settings may be customized, because
of the fact that language of the IDE interface.
• give up
Closes all IDE windows. The identical sketches open whilst give up turned into chosen
can be robotically reopened the subsequent time you begin the IDE.
• Edit
Write the program.
• Undo/Redo
is going decrease once more of 1 or extra steps you did at the equal time as editing; while
you skip decrease returned, you can move in advance with Redo.
• duplicate
Duplicates the selected text inside the editor
• Reproduction for discussion board
• Reproduction as HTML
• Paste
Places the contents of the clipboard on the cursor feature, in the editor.
• select all
Selects and highlights the complete content material of the editor.

41
• Statement/Uncomment
Places or gets rid of the // observation marker at the start of every decision online.
• increase/lower Indent
Adds or subtracts an area at the beginning of each decided online, transferring the textual
content one area at the proper or disposing of an area on the start.
• locate
Opens the discover and update window in which you could specify the text to search
inside the cutting-edge-day comedian strip in keeping with numerous alternatives.
• locate next
Highlights the fact that is trying to find the item within the known window, relative to the
cursor role.
• discover preceding
Highlights the seek item within the discover window relative to the cursor position.
Caricature:
• verify/acquire
Assessments your comic strip for errors compiling it; it's going to document reminiscence
utilization for code and variables in the console vicinity

42
Fig 6.2. verify/compile

• upload
This may overwrite the bootloader at the board; you could want to use device > Burn
Bootloader to restore it and be capable of add to the USB serial port another time.
However, it permits you to apply the overall functionality. To acquire this a system ->
Burn Bootloader command needs to be accomplished.

43
Fig 6.3.load the binary file

• Export Compiled Binary


Saves a .hex record that can be saved as an archive or sent to the board using various
equipment.
• encompass Library
Gives a library on your caricature with the aid of placing #encompass statements at the
beginning of your code. For more facts, see libraries under. Moreover, from this menu
item, you could get proper access to the Library
• add report...
Adds a supply file to the comedian strip (it will be copied from its present-day area). the
present-day day document seems in an ultra-present day tab in the cool animated film
window. Documents may be eliminated from the strip the normal use of the tab menu
available clicking on the lower triangle icon below.
Device:
44
• Automobile layout
This formats your code properly: i.e. indents it simply so beginning and remaining curly
braces
• Archive comedian strip
Documents a replica of the current-day cool lively movie in .zip format. The archive is
placed in the equal listing because of the comedian strip.
• Recovery Encoding & Reload
Fixes viable discrepancies in most of the editor char map encoding and exceptional on-
foot structures char maps.
• Board
Pick out the board which you're the use of. See underneath for descriptions of the
numerous boards.
• Port
This menu consists of all the serial devices (real or digital) for your device. It wants to
routinely refresh each time you open the top-stage equipment menu.
• Programmer
For choosing a hardware programmer whilst programming a board or chip and not the
usage of the onboard USB-serial connection. Normally you may not need this, however,
if you're burning a bootloader to a new microcontroller, you could use this.

• Burn Bootloader
The gadgets on this menu will allow you to burn a bootloader on to the mcu on an
Arduino board. This isn't always required for use of an Arduino uno or Genuino board
but is beneficial if you purchase an extremely-cutting-edge ATmega microcontroller
(which usually comes without a bootloader). Ensure which you've decided on the right
board from the boards' menu in advance than burning the bootloader on the reason board.
This command additionally sets the proper fuses.
Help:
Right here you find out easy access to several files that encompass the Arduino software
program utility (IDE). You’ve got have been given get proper of entry to Getting started,
Reference, this manual to the IDE and distinct files regionally, without an internet

45
connection. The documents are a neighborhood reproduction of the internet ones and can
hyperlink once more to our online net internet web page.
• DISCOVER IN REFERENCE

This is the pleasant interactive characteristic of the assist menu: it straight away selects
the applicable net page in the close by a duplicate of the Reference for the characteristic
or command beneath the cursor.

LANGUAGE SUPPORT

SERIAL MONITOR:

46
Indicates serial facts being despatched from the Arduino UNO or Genuino board (USB or
serial board). To ship data to the board, enter textual content and click on on on at the
"supply" button 36 2336 or press enter. Choose out the baud price from the drop-down
that fits to Serial. 12 Begin in your comic strip. Be conscious that on domestic home
windows, Mac or Linux, the Arduino UNO or Genuino board will reset whilst you join
with the serial display.
You could also interface to the board from Processing, Flash, MaxMSP, and so on (see
the 12 interfacing net page for information). Possibilities: A few picks can be set inside
the options dialog (determined under the Arduino menu on the 36 Mac, or document on
home windows and Linux). The relaxation can get in the options file, 12 whose region is
confirmed in the choice conversation.
Arduino software (IDE) consists of the built-in to beefit for the forums in the following
listing, all primarily based on the AVR mcu. The Boards manager included inner the
fashionable set up allows to feature assist for the growing variety of new boards based
totally on special cores like Arduino UNO, Arduino 0, Edison, Galileo and so on.
• Arduino Yùn
An ATmega32u4 frequency at 16 MHz with auto-reset, 12 Analog Input pins, 20 virtual
I/O, and 7 PWM.
• Arduino/Genuino Uno
An ATmega328 frequency at 16 MHz with automobile-reset, 6 Analog Input, 14 virtual
I/O, and 6 PWM.
An ATmega168 strolling at 16 MHz with car-reset.
• Arduino Nano w/ ATmega328
An ATmega328 has a frequency of 16 MHz with automobile-reset. Has eight analog
inputs.
• Arduino/Genuino Mega 2560
An ATmega2560 has a frequency of at sixteen MHz with automobile-reset, 16 Analog In,
54 virtual I/O, and 15 PWM.
• Arduino Mega
An ATmega1280 has a frequency of 16 MHz with vehicle-reset, 16 Analog In, fifty 4
virtual I/O, and 15 PWM.

47
• Arduino Mega ADK
An ATmega2560 on foot at sixteen MHz with vehicle-reset, sixteen Analog In, fifty-four
digital I/O, and 15 PWM.
• Arduino Leonardo
An ATmega32u4 running at 16 MHz with auto-reset, 12 Analog Input, 20 virtual I/O,
and seven PWM.
• Arduino/Genuino Micro
An ATmega32u4 has a frequency of 16 MHz with car-reset, 12 Analog Input, 20 virtual
I/O, and seven PWM.
• Arduino Esplora
ATmega32u4 jogging at sixteen MHz with car-reset.
• Arduino Mini w/ ATmega328
An ATmega328 has a frequency of 16 MHz with vehicle-reset, eight Analog In, 14
virtual I/O, and six PWM.
• Arduino Ethernet
Equal to Arduino UNO with an Ethernet defend An ATmega328 jogging at 16 MHz with
car-reset, 6 Analog In, 14 digital I/O, and six PWM.
• Arduino Fio
ATmega328 jogging at eight MHz with automobile-reset. equal to Arduino seasoned or
Pro Mini (3.3V, 8 MHz) w/ATmega328, 6 Analog In, 14 virtual I/O, and 6 PWM.
• Arduino BT w/ ATmega328
ATmega328 has a frequency of sixteen MHz. The bootloader burned (four KB) consists
of codes to initialize the on-board Bluetooth module, 6 Analog In, 14 digital I/O, and 6
PWM.
• LilyPad Arduino USB
An ATmega32u4 frequency at 8 MHz with vehicle-reset, four Analog In, nine digital I/O,
and four PWM.
• LilyPad Arduino
An ATmega168 or ATmega132 walking at 8 MHz with vehicle-reset, 6 Analog Input, 14
virtual I/O, and 6 PWM.
• Arduino seasoned or Pro Mini (5V, sixteen MHz) w/ ATmega328

48
An ATmega328 taking walks at sixteen MHz with vehicle-reset. Identical to Arduino
Duemilanove or Nano w/ ATmega328; 6 Analog Input, 14 virtual I/O and six PWM.
• Arduino NG or older w/ ATmega168
An ATmega168 frequency at 16 MHz without car-reset. Compilation and add is identical
to Arduino Diecimila ATmega168, however, the bootloader burned has a slower timeout
(and blinks the pin thirteen LED three times on reset); 6 Analog Input, 14 virtual I/O, and
six PWM.
• Arduino robotic manage
An ATmega328 frequency at 16 MHz with vehicle-reset.
• Arduino robotic Motor
An ATmega328 on foot at sixteen MHz with automobile-reset.
• Arduino Gemma
An ATtiny85 frequency at eight MHz with automobile-reset, 1 Analog In, three digital
I/O, and more than one PWM.

CHAPTER 8
CONCLUSION
49
The project “Automatic movable railway platform with train
arrival detection” been successfully designed and tested. It has been
developed by integrating features of all the hardware components used.
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.

50
Chapter 09
Future scope & Aspects
 For the further development of this project we can add GPS module to the trains
to monitor the movements of the trains in the same track.

51
CHAPTER 10
BIBILOGRAPHY

1. www.howstuffworks.com
2. EMBEDDED SYSTEM BY RAJ KAMAL
3. 8052 MICROCONTROLLER AND EMBEDDED SYSTEMS
BY MAZZIDI
4. Magazines
5. Electronics for you
6. Electrikindia
7. www.google.com
8. www.electronicprojects.com

52

You might also like