Automated Ambulance Final

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 49

AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

CHAPTER 1

1. Introduction:
The Automated Ambulance Detection & Gate Control‟ System can be explained by taking the
hospital model as follows:
The Ambulance Detector stage is having a Microcontroller device with MONITOR/LCD screen,
which is connected with the receiver and the software to run Automated Ambulance Detection &
Gate Control System. To implement this System every vehicle like hospitals ambulance must be fitted
with remote transmitter. The job of this transmitter is to transmit signal on which it is mounted, in
coded form. When any vehicle enters the zone of Ambulance Office, the sensors buried side of the
road / hospital gate sends “a vehicle has entered‟ signal to Ambulance Detector & Receiver Unit.
This in turn activates the Receiver fitted end of Ambulance Detector / Gate Office and hence gets the
Vehicle ID of the entering vehicle.
The main aim of this project is to implement an automated system for clearing the traffic for
ambulances to help the people who met with accidents or the people who are in emergency
conditions without any disturbance or delay.

The main objectives of this project are:

1. Develop an automated ambulance which will reach the destination without any problems in
heavy traffics.
2. Detect the approaching Ambulance towards the hospital and trigger gate motor to open.
3. Stop the active sequence of traffic light to only GREEN on the path of the ambulance.
4. Interrupt the normal sequence of traffic lights to GREEN when RFID detects the ambulance
on its lane.
5. Turns the remaining signals to RED.

DEPT. OF ECE, LIET Page | 1


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

CHAPTER 2
BLOCK DIAGRAM
2.1 Circuit Block Diagram:

Fig 2.1: Block Diagram

2.2: Description of Block Diagram:


The above figure shows the block diagram of the project entitled “Automation Ambulance Gates at
Ambulance & Traffic Signals”.
Power Supply:
A power supply provides components with electric power. The term usually pertains to devices
integrated within the component being powered. For example, computer power supplies convert AC
current to DC current and are generally located at the rear of the computer case, along with at least
one fan. A power supply is also known as a power supply unit, power brick or power adapter

DEPT. OF ECE, LIET Page | 2


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

RF TX:
An RF transmitter module is a small PCB sub-assembly capable of transmitting a radio wave and
modulating that wave to carry data.
Encoder IC with switches:
An encoder is a device, integrated circuit that converts information from one format or code
to another.
In simple words an IC which converts parallel inputs into serial output is termed as encoder
IC.
RF RX:
An RF receiver module receives the modulated RF signal, and demodulates it. There are basically two
types of RF receiver modules they are, super heterodyne receiver and super-regenerative receiver.

Decoder IC:
The decoder IC exact opposite of that of an encoder IC.
It converts serial input into parallel output.
Micro Controller:
A microcontroller is a compact integrated circuit designed to govern a specific operationin an
embedded system. A typical microcontroller includes a processor, memory and input/output (I/O)
peripherals on a single chip.
LCD:
LCD (liquid crystal display) is the technology used for displays in notebook and other smaller
computers. Like light-emitting diode (LED) and gas-plasma technologies, LCDs allow displays to be
much thinner than cathode ray tube (CRT) technology. LCDs consume much less power than LED
and gas-display displays because they work on the principle of blocking light rather than emitting it.
Driver IC:
An IC which acts as an interface between the micro controller and some special devices to drive them
is termed as Driver IC.
Motor Driver IC:
A motor driver IC is an integrated circuit chip which is usually used to control motors in autonomous
robots. Motor driver ICs act as an interface between microprocessors and the motors in the gate.

Traffic Lights: Signaling devices positioned at rode Intersection, Pedestrians crossing, and
other locations to control flows of traffic are termed as Traffic lights or traffic signals.

DEPT. OF ECE, LIET Page | 3


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

CHAPTER 3
SCHEMATIC DIAGRAM
3.1 Schematic diagram:

Fig 3.1: schematic diagram

3.2 Schematic Description:


This project consists of a Arduino UNO, LCD, DC motor, Encoder & Decoder. It is an 8-bit
microcontroller and it requires supply voltage of 5V. 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.
The analog pins of Arduino Uno D2-D5 are connected to the decoder which is connected to the
D11-D8 of the decoder, Din is the data input from the receiver (out) pin.

DEPT. OF ECE, LIET Page | 4


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

Driver IC L293D is connected to the DC motor where the out1 and out2 (output pins) are
connected to the dc motor. Arduino pins 13,12,9 and 8 are connected to in1, in2, in3 and in4 to
the driver motor IC while enable pin EN is connected to the +5V power supply.
Pin 7 is given to the encoder IC. Pins D11-D8 are given to the buttons that are used to trigger the
lane traffic lights for the transport of the ambulance. The encoder is connected to the transmitter
through the data pin
The LCD is connected to the I2C interface. D4-D7 of the LCD are connected to the P4-P7 pins
of the I2C. RS, RW, E are connected to the I2C pins. A0-A2 are grounded while the SCL SDA
pins of the I2C are connected to the A4 (SDA), A5(SCL) of the Arduino Uno.

3.3: SCHEMATIC TABLE:


 Interfacing of arduino uno to PCF8574T, L293D, HT12D and HT12E:
ARDUINO UNO SIGNAL I/O DEVICE SIGNAL DESCRIPTION
SDA PCF8574T(SDA) I2C Data Signal of Arduino is
given as the input to I/O
expander (PCF8574T)
SCL PCF8574T(SCL) I2C Clock Signal of Arduino is
given as the input to I/O
expander (PCF8574T)
D13 L293D(IN1) L293D (IN1) is given as input
from the (D13)Arduino pin
D12 L293D(IN2) L293D (IN2) is given as input
from the (D12)Arduino pin
D5 HT12D(D11) HT12D (D11) sends the data to
Arduino pin D5 as the data sent
from the receiver.
D4 HT12D(D10) HT12D (D10) sends the data to
Arduino pin D4 as the data sent
from the receiver.
D3 HT12D(D9) HT12D (D9) sends the data to
Arduino pin D3 as the data sent
from the receiver.
D2 HT12D(D8) HT12D(D8) sends the data to
Arduino pin D2 as the data sent
from the receiver.

DEPT. OF ECE, LIET Page | 5


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

D7 HT12E(DOUT) HT12E(DOUT) is the I/O pin


which sends the output to the
D7 pin of Arduino

 Interfacing of I/O expander (PCF8574T) and LCD:


LCD SIGNAL I/O EXPANDER SIGNAL DESCRIPTION

RS P0 P0 is connected to RS of the
LCD
E P2 P2 is connected to E of the
LCD
RW P1 P1 is connected to RW of the
LCD
D4 P4 P4 is connected to D4 of the
LCD
D5 P5 P5 is connected to D5 of the
LCD
D6 P6 P6 is connected to D6 of the
LCD
D7 P7 P7 is connected to D7 of the
LCD

 Interfacing of HT12E, buttons and transmitter:


HT12E(Encoder IC) RF transmitter signal Description
D11 RF1 The RF1 button sends the D11
data to encoder on pin.
D10 RF2 The RF2 button sends the D10
data to encoder on pin.
D9 RF3 The RF3 button sends the D9
data to encoder on pin.
D8 RF4 The RF4 button sends the D8
data to encoder on pin.

DEPT. OF ECE, LIET Page | 6


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

A0 Data HT12E sends the data from A0


pin to Data pin on RF
Transmitter.

 Interfacing HT12D with reciever:


HT12D (DECODER IC) RF RECEIVER DESCRIPTION
SIGNAL
DIN Data Out RF Receiver send the data to
DIN on HT12D.

 Interfacing of L293D with DC motor and power supply:


L293D(DRIVER IC) Signal Description

OUT1 Terminal 1(DC Motor) Driver IC sends the signal to


DC motor through OUT1 pin
through Terminal 1.
OUT2 Terminal 2(DC Motor) Driver IC sends the signal to
DC motor through OUT2 pin
through Terminal 2.
VSS +5V VSS is provided +5V power
supply.
VS +12V VS is provided +12V power
supply.

Table 3.1: Schematic diagram interfacing tables.

DEPT. OF ECE, LIET Page | 7


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

CHAPTER 4
HARDWARE DESCRIPTION
The Required components of this project are:
1. Microcontroller (Arduino UNO)
2. Power supply
3. RF transmitter & receiver
4. Decoder IC
5. Encoder IC with switches
6. LCD
7. Driver IC
8. Motor driver (DC Motor)

A Microcontroller is a VLSI (Very Large-Scale Integration) Integrated Circuit (IC) that contains
electronic computing unit and logic unit (combinedly known as CPU), Memory (Program Memory
and Data Memory), I/O Ports (Input / Output Ports) and few other components integrated on a single
chip.

Sometimes, a Microcontroller is also called as a Computer-on-a-Chip or a Single-Chip-Computer.


Since the Microcontroller and its supporting circuitry are often embedded in the device it controls, a
Microcontroller is also called as an Embedded Controller.

Fig 4.1: Microcontroller

DEPT. OF ECE, LIET Page | 8


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

4.1.1 Arduino Uno

The Arduino UNO is an open-source microcontroller board based on


the Microchip ATmega328P microcontroller and developed by Arduino.cc.The board is

equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to
various expansion boards (shields) and other circuits. The board has 14 Digital pins, 6 Analog pins,
and programmable with the Arduino IDE (Integrated Development Environment) via a type B USB
cable. It can be powered by the USB cable or by an external 9-volt battery, though it accepts voltages
between 7 and 20 volts. It is also similar to the Arduino Nano and Leonardo. The hardware reference
design is distributed under a Creative Commons Attribution Share-Alike 2.5 license and is available
on the Arduino website. Layout and production files for some versions of the hardware are also
available.

Fig 4.2: Arduino Uno Board

DEPT. OF ECE, LIET Page | 9


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

The word "Uno" means "one" in Italian and was chosen to mark the initial release of the Arduino
Software. The Uno board is the first in a series of USB-based Arduino boards, and it and version 1.0
of the Arduino IDE were the reference versions of Arduino, now evolved to newer releases. The
ATmega328 on the board comes preprogrammed with a boot loader that allows uploading new code
to it without the use of an external hardware programmer.

4.1.2 ATmega328p
The ATmega328 is a single-chip microcontroller created by Atmel in the mega AVR family
(later Microchip Technology acquired Atmel in 2016). It has a modified The ATmega328 is a single-
chip microcontroller created by Atmel in the mega AVR Harvard architecture 8-bit RISC processor
core.

Fig4.3: ATMega328p Microcontroller.

The Atmel 8-bit AVR RISC-based microcontroller combines 32 kB ISP flash memory with read-
while-write capabilities, 1 kB EEPROM, 2 kB SRAM, 23 general purpose I/O lines, 32 general
purpose working registers, three flexible timer/counters with compare modes, internal and
external interrupts, serial programmable USART, a byte-oriented 2-wire serial interface, SPI serial
port, 6-channel 10-bitA/D converter (8-channels in TQFP and QFN/MLF packages),
programmable watchdog timer with internal oscillator, and five software selectable power saving
modes. The device operates between 1.8-5.5 volts. The device achieves throughput approaching
1 MIPS per MHZ

DEPT. OF ECE, LIET Page | 10


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

4.1.3 Pin Description of Arduino Uno:


Arduino Uno is based on the ATmega328 by Atmel. The Arduino Uno pinout consists of 14 digital
pins, 6 analog inputs, a power jack, USB connection and ICSP header. The versatility of the pinout
provides many different options such as driving motors, LEDs, reading sensors and more.

Fig4.4: Pin Diagram Of Arduino UNO

Signal Signal Name Details


Category

Power Vin, 3.3V, 5V, GND Vin: Input voltage to Arduino when using an external power
source.
5V: Regulated power supply used to power microcontroller
and other components on the board.
3.3V: 3.3V supply generated by on-board voltage regulator.
Maximum current draw is 50mA.
GND: ground pins.

Reset Reset Resets the microcontroller.

DEPT. OF ECE, LIET Page | 11


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

Analog Pins Analog pinsA0 – Used to provide analogue input in the range of 0-5V
A5

Input/output Digital Pins 0 – 13 Can be used as input or output pins.


Pins

Serial 0(Rx), 1(TX) Used to receive and transmit TTL serial data.

Signal Signal Name Details


Category

External Digital pin2,Digital To trigger an interrupt.


Interrupts pin 3

PWM Digital pin3, Digital Provides 8-bit PWM output.


pin5,Digitalpin6,
Digital pin9, Digital
pin11

SPI Digital pin10 (SS), Used for SPI communication.


Digital pin11
(MOSI), Digital
pin12 (MISO) and
Digital pin13 (SCK)

Inbuilt LED Digital pin13 To turn on the inbuilt LED.

TWI Analog pin A4 Used for TWI communication.


(SDA), Analog pin
A5 (SCA)

AREF AREF To provide reference voltage for input voltage.

Table No 4.1: Pin Description of Arduino Uno

4.2 Features Of Arduino UNO Board:


The features of Arduino Uno ATmega328 includes the following:
 The operating voltage is 5V
 The recommended input voltage will range from 7v to 12V
 The input voltage ranges from 6v to 20V
 Digital input/output pins are 14
 Analog i/p pins are 6
 DC Current for each input/output pin is 40 mA
 DC Current for 3.3V Pin is 50 mA
 Flash Memory is 32 KB
 SRAM is 2 KB

DEPT. OF ECE, LIET Page | 12


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

 EEPROM is 1 KB
 CLK Speed is 16 MHz

4.3 Power Supply:


A power supply is a component that supplies power to at least one electric load. Typically, it converts
one type of electrical power to another, but it may also convert a different form of energy – such as
solar, mechanical, or chemical - into electrical energy.
A power supply provides components with electric power. The term usually pertains to devices
integrated within the component being powered. For example, computer power supplies convert AC
current to DC current and are generally located at the rear of the computer case, along with at least
one fan. A power supply is also known as a power supply unit, power brick or power adapter

.
Fig 4.5: Power supply for 5v&12v for Arduino UNO

4.3.1 Transformer:

4.3.1 Step-down Transformer:


A transformer in which the output (secondary) voltage is less than its input (primary) voltage is called
a step-down transformer. The number of turns on the primary of the transformer is greater than the
turn on the secondary of the transformer, i.e., T2< T1. The step-down transformer is shown in the
figure below.

DEPT. OF ECE, LIET Page | 13


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

The voltage turn ratio of the step-down transformer is 2:1. The voltage turn ratio determines the
magnitude of voltage transforms from primary to secondary windings of the transformer.

Step-down transformer is made up of two or more coil wound on the iron core of the transformer. It
works on the principle of magnetic induction between the coils. The voltage applied to the primary of
the coil magnetize the iron core which induces the secondary windings of the transformer. Thus, the
voltage transforms from primary to the secondary winding of the transformer.

4.3.2 Rectifiers:

A rectifier is an electrical device that converts alternating current (AC), which periodically reverses
direction, to direct current (DC), which flows in only one direction.

The process is known as rectification, since it "straightens" the direction of current. Physically,
rectifiers take a number of forms, including tube diodes, mercury-arc valves, stacks of copper and
selenium oxide plates, semiconductor diodes, silicon-controlled rectifiers and other silicon-based
semiconductor switches. Historically, even synchronous electromechanical switches and motors have
been used. Early radio receivers, called crystal radios, used a "cat's whisker" of fine wire pressing on
a crystal of galena (lead sulfide) to serve as a point-contact rectifier or "crystal detector".
Rectifiers have many uses, but are often found serving as components of DC power supplies and
high-voltage direct current power transmission systems. Rectification may serve in roles other than to
generate direct current for use as a source of power. As noted, detectors of radio signals serve as
rectifiers. In gas heating systems flame rectification is used to detect presence of a flame.
Depending on the type of alternating current supply and the arrangement of the rectifier circuit, the
output voltage may require additional smoothing to produce a uniform steady voltage. Many
applications of rectifiers, such as power supplies for radio, television and computer equipment,
require a steady constant DC voltage (as would be produced by a battery). In these applications the
output of the rectifier is smoothed by an electronic filter, which may be a capacitor, choke, or set of
capacitors, chokes and resistors, possibly followed by a voltage regulator to produce a steady voltage.

DEPT. OF ECE, LIET Page | 14


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

Fig 4.6 :Bridge Rectifier

4.3.3 Filters:

In signal processing, a filter is a device or process that removes some unwanted components or
features from a signal. Filtering is a class of signal processing, the defining feature of filters being the
complete or partial suppression of some aspect of the signal. Most often, this means removing some
frequencies or frequency bands. However, filters do not exclusively act in the frequency domain;
especially in the field of image processing many other targets for filtering exist. Correlations can be
removed for certain frequency components and not for others without having to act in the frequency
domain. Filters are widely used in electronics and telecommunication, in radio, television, audio
recording, radar, control systems, music synthesis, image processing, and computer graphics

.
Fig4.7: LC filter

DEPT. OF ECE, LIET Page | 15


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

4.3.4 Voltage Regulator:

A voltage regulator is a system designed to automatically maintain a constant voltage level. A voltage
regulator may use a simple feed-forward design or may include negative feedback. It may use an
electromechanical mechanism, or electronic components. Depending on the design, it may be used to
regulate one or more AC or DC voltages.

Electronic voltage regulators are found in devices such as computer power supplies where they stabilize
the DC voltages used by the processor and other elements. In automobile alternators and central power
station generator plants, voltage regulators control the output of the plant. In an electric power distribution
system, voltage regulators may be installed at a substation or along distribution lines so that all customers
receive steady voltage independent of how much power is drawn from the line.

Fig 4.8: voltage regulator 7805

4.4 LCD:
The most commonly used Character based LCDs are based on Hitachi's HD44780 controller
or other which are compatible with HD44580. In this tutorial, we will discuss about character-based
LCDs, their interfacing with various microcontrollers, various interfaces (8-bit/4-bit), programming,
special stuff and tricks you can do with these simple looking LCDs which can give a new look to your
application.

4.4.1 LCD Pin Diagram:

Fig 4.9:16x2 LCD Pin Diagram.

DEPT. OF ECE, LIET Page | 16


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs
which have only 1 controller and support at most of 80 characters, whereas LCDs supporting more
than 80 characters make use of 2 HD44780 controllers.

Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two pins are extra
in both for back-light LED connections). Pin description is shown in the table below.

4.4.2 Pin Description:

Pin No. Name Description


Pin no. 1 D7 Data bus line 7 (MSB)
Pin no. 2 D6 Data bus line 6
Pin no. 3 D5 Data bus line 5
Pin no. 4 D4 Data bus line 4
Pin no. 5 D3 Data bus line 3
Pin no. 6 D2 Data bus line 2
Pin no. 7 D1 Data bus line 1
Pin no. 8 D0 Data bus line 0 (LSB)
Pin no. 9 EN1 Enable signal for row 0 and 1 (1stcontroller)
0 = Write to LCD module
Pin no. 10 R/W
1 = Read from LCD module
0 = Instruction input
Pin no. 11 RS
1 = Data input
Pin no. 12 VEE Contrast adjust
Pin no. 13 VSS Power supply (GND)
Pin no. 14 VCC Power supply (+5V)
Pin no. 15 EN2 Enable signal for row 2 and 3 (2ndcontroller)
Pin no. 16 NC Not Connected
Table No 4.2: Pin Description of LCD

4.4.3 LCD Working:


The principle behind the LCD’s is that when an electrical current is applied to the liquid crystal
molecule, the molecule tends to untwist. This causes the angle of light which is passing through the
molecule of the polarized glass and also cause a change in the angle of the top polarizing filter. As a
result, a little light is allowed to pass the polarized glass through a particular area of the LCD. Thus,
that particular area will become dark compared to other. The LCD works on the principle of blocking
light. While constructing the LCD’s, a reflected mirror is arranged at the back. An electrode plane is
made of indium-tin oxide which is kept on top and a polarized glass with a polarizing film is also

DEPT. OF ECE, LIET Page | 17


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

added on the bottom of the device. The complete region of the LCD has to be enclosed by a common
electrode and above it should be the liquid crystal matter.

Next comes to the second piece of glass with an electrode in the form of the rectangle on the bottom
and, on top, another polarizing film. It must be considered that both the pieces are kept at right angles.
When there is no current, the light passes through the front of the LCD it will be reflected by the
mirror and bounced back. As the electrode is connected to a battery the current from it will cause the
liquid crystals between the common-plane electrode and the electrode shaped like a rectangle to
untwist. Thus, the light is blocked from passing through. That particular rectangular area appears
blank.

Table No 4.3: LCD Command Line

DEPT. OF ECE, LIET Page | 18


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

Fig 4.10: Working of LCD

4.5 Motor Driver IC:


L293D Description:

L293D is a typical Motor driver or Motor Driver IC which allows DC motor to drive on either
direction. L293D is a 16-pin IC which can control a set of two DC motors simultaneously in any
direction. It means that you can control two DC motor with a single L293D IC. Dual H-bridge Motor
Driver integrated circuit (IC).

Concept:

It works on the concept of H-bridge. H-bridge is a circuit which allows the voltage to be flown in
either direction. As you know voltage need to change its direction for being able to rotate the motor in
clockwise or anticlockwise direction, Hence H-bridge IC are ideal for driving a DC motor.

In a single L293D chip there are two h-Bridge circuit inside the IC which can rotate two dc motor
independently. Due its size it is very much used in robotic application for controlling DC motors.
Given below is the pin diagram of a L293D motor controller.

There are two Enable pins on l293d. Pin 1 and pin 9, for being able to drive the motor, the pin 1 and 9
need to be high. For driving the motor with left H-bridge you need to enable pin 1 to high. And for

DEPT. OF ECE, LIET Page | 19


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

right H-Bridge you need to make the pin 9 to high. If anyone of the either pin1 or pin9 goes low then
the motor in the corresponding section will suspend working. It’s like a switch.

L293D Pin Diagram:

Working of L293D

There are 4 input pins for l293d, pin 2,7 on the left and pin 15 ,10 on the right as shown on the pin
diagram. Left input pins will regulate the rotation of motor connected across left side and right input
for motor on the right-hand side. The motors are rotated on the basis of the inputs provided across the
input pins as LOGIC 0 or LOGIC 1.

In simple you need to provide Logic 0 or 1 across the input pins for rotating the motor.

L293D Logic Table:

Let’s consider a Motor connected on left side output pins (pin 3,6). For rotating the motor in
clockwise direction, the input pins have to be provided with Logic 1 and Logic 0.

• Pin 2 = Logic 1 and Pin 7 = Logic 0 | Clockwise Direction


• Pin 2 = Logic 0 and Pin 7 = Logic 1 | Anticlockwise Direction
• Pin 2 = Logic 0 and Pin 7 = Logic 0 | Idle [No rotation] [Hi-Impedance state]
• Pin 2 = Logic 1 and Pin 7 = Logic 1 | Idle [No rotation]

In a very similar way, the motor can also operate across input pin 15, 10 for motor on the right-hand
side.

DEPT. OF ECE, LIET Page | 20


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

Circuit Diagram For l293d motor driver IC controller:

Fig 4.11 Circuit Diagram Of L239D Motor Driver IC

Voltage Specification:

VCC is the voltage that it needs for its own internal operation 5v; L293D will not use this voltage for
driving the motor. For driving the motors, it has a separate provision to provide motor supply VSS (V
supply). L293d will use this to drive the motor. It means if you want to operate a motor at 9V then
you need to provide a Supply of 9V across VSS Motor supply.

The maximum voltage for VSS motor supply is 36V. It can supply a max current of 600mA per
channel. Since it can drive motors Up to 36v hence you can drive pretty big motors with this l293d.

VCC pin 16 is the voltage for its own internal Operation. The maximum voltage ranges from 5v and
up to 36v.

DEPT. OF ECE, LIET Page | 21


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

4.6 DC MOTOR:

A DC motor is designed to run on DC electric power. Two examples of pure


DC designs are Michael Faraday's homopolar motor (which is uncommon), and the
ball bearing motor, which is (so far) a novelt y.

By far the most common DC mot or t ypes are the brushed and brushless t ypes, which
use internal and external commutation respectivel y to create an oscillating AC
current from the DC source —so they are not purel y DC machines in a strict sense.

We in our project are using brushed DC Motor , which will operate in the ratings of
12v DC 0.6A which will drive the fl ywheels in order to make the robot move.

Fig4.12: DC Motor

4.7 Traffic Lights:

 Instead of Traffic Lights (LED’S) we are using LCD’S for Indications.

DEPT. OF ECE, LIET Page | 22


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

4.8 RF TX:
An RF transmitter module is a small PCB sub-assembly capable of transmitting a radio wave and
modulating that wave to carry data. Transmitter modules are usually implemented alongside a micro
controller which will provide data to the module which can be transmitted. RF transmitters are
usually subject to regulatory requirement’s which dictate the maximum allowable transmitter power
output and band edge requirements.

Fig 4.13: Rf Transmitter

4.8.1 HT12E Encoder IC:

Fig 4.14: HT12E Encoder

DEPT. OF ECE, LIET Page | 23


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

HT12E is an encoder integrated circuit of 212 series of encoders. They are paired with 212 series of
decoders for use in remote control system applications. It is mainly used in interfacing RF and
infrared circuits. The chosen pair of encoder/decoder should have same number of addresses and data
format.

Simply put, HT12E converts the parallel inputs into serial output. It encodes the 12 bit parallel data
into serial for transmission through an RF transmitter. These 12 bits are divided into 8 address bits
and 4 data bits.

HT12E has a transmission enable pin which is active low. When a trigger signal is received on TE
pin, the programmed addresses/data are transmitted together with the header bits via an RF or an
infrared transmission medium. HT12E begins a 4-word transmission cycle upon receipt of a
transmission enable. This cycle is repeated as long as TE is kept low. As soon as TE return to high,
the encoder output completes its final cycle and then stops.

Fig 4.15: HT12E Encoder Pin Diagram

DEPT. OF ECE, LIET Page | 24


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

 Pin Description of HT12E:

Table No 4.4: Pin Description of HT12E Encoder

4.9 RF RX:

An RF receiver module receives the modulated RF signal, and demodulates it. There are two types of
RF receiver modules: super heterodyne receiver and super-regenerative receiver. Super-regenerative
modules are usually low cost and low power designs using a series of amplifiers to extract modulated
data from a carrier wave. Super-regenerative modules are generally imprecise as their frequency of
operation varies considerably with temperature and power supply voltage. Super heterodyne receivers
have a performance advantage over super-regenerative; they offer increased accuracy and stability
over a large voltage and temperature range. This stability comes from a fixed crystal design which in
the past tended to mean a comparatively more expensive product. However, advances in receiver chip
design now mean that currently there is little price difference between super heterodyne and super-
regenerative receiver modules.

DEPT. OF ECE, LIET Page | 25


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

Fig 4.16: Rf Receiver

4.9.1 HT12D Decoder IC:

Fig 4.17: HT12D Decoder

HT12D is a decoder integrated circuit that belongs to 212 series of decoders. This series of decoders
are mainly used for remote control system applications, like burglar alarm, car door controller,
security system etc. It is mainly provided to interface RF and infrared circuits. They are paired with
212 series of encoders. The chosen pair of encoder/decoder should have same number of addresses
and data format.

In simple terms, HT12D converts the serial input into parallel outputs. It decodes the serial addresses
and data received by, say, an RF receiver, into parallel data and sends them to output data pins. The
serial input data is compared with the local addresses three times continuously. The input data code is
decoded when no error or unmatched codes are found. A valid transmission in indicated by a high
signal at VT pin.

DEPT. OF ECE, LIET Page | 26


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

HT12D is capable of decoding 12 bits, of which 8 are address bits and 4 are data bits. The data on 4-
bit latch type output pins remain unchanged until new is received.

Fig 4.18: HT12D Decoder Pin Diagram

Pin Description Of HT12D:

Table No 4.5: Pin Description of HT12D Decoder

DEPT. OF ECE, LIET Page | 27


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

CHAPTER 5
SOFTWARE
To successfully complete the task of Hardware implementation, Software simulation is required
Greatly. What actually Software simulation means? Now we can come to the point. Software
simulation process of modeling a real phenomenon with a set of mathematical formulas.

It is essentially, a program that allows user to observe an operation through simulation without
actually performing that operation. If we think professionally that using software simulations, one can
show their customer how everything works in his program. Also, he can make it interactive clients
will be able to take a closer look at the features that interest them most.

In our project we have mainly used Proteus version 8 as Simulation Software. Other associated
required software along with it are stated below.

5.1 Circuit Software Requirements:

 PROTEUS
 ARDUINO IDE

5.1.1 Proteus version 8:


Proteus ISIS is the best stimulation software in the world for various designs with electronics &
microcontroller.

Proteus 8 Professional is software which can be used to draw schematics, PCB layout, code and even
simulate the schematic. You can simulate your work and be more efficient in completing the task at
hand.

Even though if u are not using for PCB designing u can view the PCB layout of the component
individually while selecting the component it helps during the soldering of components in PCB.

Proteus is ahead in simulating the circuits containing the micro controllers where we can simulate the
circuit by uploading the hex code to the Micro-controller whereas Multism can’t do this.

Example: We can observe a simple circuit of “LED Blinking” in Proteus Simulation software using
ARDUINO. A screenshot of such schematic simulation is shown here.

DEPT. OF ECE, LIET Page | 28


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

Fig 5.1: LED Brightness on Proteus

5.1.2 Arduino IDE:


The Arduino integrated development environment (IDE) is a cross-platform application
(for Windows, macOS, Linux) that is written in the programming language Java. It is used to write
and upload programs to Arduino compatible boards, but also, with the help of 3rd party cores, other
vendor development boards.
The source code for the IDE is released under the GNU General Public License, version 2.The
Arduino IDE supports the languages C and C++ using special rules of code structuring.The Arduino
IDE supplies a software library from the Wiring project, which provides many common input and
output procedures. User-written code only requires two basic functions, for starting the sketch and the
main program loop, that are compiled and linked with a program stub main() into an executable cyclic
executive program with the GNU toolchain, also included with the IDE distribution. The Arduino
IDE employs the program avrdude to convert the executable code into a text file in hexadecimal
encoding that is loaded into the Arduino board by a loader program in the board's firmware.

5.1.3 Arduino Software:


You’ll need to download the Arduino Software package for your operating system. When you’ve
downloaded and opened the application you should see something like this:

DEPT. OF ECE, LIET Page | 29


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

Fig 5.2: Screenshot of Arduino software


This is where you type the code you want to compile and send to the Arduino board.

DEPT. OF ECE, LIET Page | 30


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

The Initial Setup


We need to setup the environment to Tools menu and select Board.

Then select the type of Arduino you want to program, in our case it’s the Arduino Uno.

DEPT. OF ECE, LIET Page | 31


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

The Code
The code you write for your Arduino are known as sketches. They are written in C++.
Every sketch needs two void type functions, setup() and loop(). A void type function doesn’t return
any value.

The setup() method is ran once at the just after the Arduino is powered up and the loop() method is
ran continuously afterwards. The setup() is where you want to do any initialization steps, and in
loop() you want to run the code you want to run over and over again.

So, your basic sketch or program should look like this:

void setup()
{

void loop()
{

}
Now we have the basic skeleton in place we can now do the Hello, World program of
microcontrollers, a blinking an LED.
Headers and Pins

If you notice on the top edge of the board there’s two black rectangles with several squares in. These
are called headers. Headers make it easy to connect components to the theArduino. Where they
connect to the board is called pins. Knowing what pin something is connected to is essential for
programming an Arduino.
The pin numbers are listed next to the headers on the board in white.
The onboard LED we want to control is on pin 13.

DEPT. OF ECE, LIET Page | 32


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

In our code above the setup() method let’s create a variable called ledPin. In C++ we need to state
why type our variable is beforehand, in this case it’s an integer, so it’s of type int.
intledPin = 13;
void setup()
{

void loop()
{

}
Each line is ended with a semicolon (;).
In the setup() method we want to set the ledPin to the output mode. We do this by calling a special
function called pinMode() which takes two variables, the first the pin number, and second, whether
it’s an input or output pin. Since we’re dealing with an output we need to set it to a constant called
OUTPUT. If you were working with a sensor or input it would be INPUT.
intledPin = 13;

void setup()
{
pinMode(ledPin, OUTPUT);
}

void loop()
{

}
In our loop we are going to first switch off the LED to make sure our program is being transferred to
the chip and overriding the default.

DEPT. OF ECE, LIET Page | 33


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

We do this by calling another special method called digitalWrite (). This also takes two values, the
pin number and the level, HIGH or the on state or LOW the off state.
IntledPin = 13;

void setup()
{
pinMode(ledPin, OUTPUT);
}

void loop()
{
digitalWrite(ledPin, LOW);
}
Next we want to compile to machine code and deploy or upload it to the Arduino.
Compiling the Code
If this is your first time you’ve ever compiled code to your Arduino before plugging it in to the
computer go to the Tools menu, then Serial Port and take note of what appears there.
Here’s what mine looks like before plugging in the Arduino UNO:

Plug your Arduino UNO board in to the USB cable and into your computer. Now go back to the
Tools > Serial Port menu and you should see at least 1 new option. On my Mac 2 new serial ports
appear.

DEPT. OF ECE, LIET Page | 34


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

They tty and cu are two ways that computers can talk over a serial port. Both seem to work with the
Arduino software so I selected the tty.* one. On Windows you should see COM followed by a
number. Select the new one that appears.
Once you have selected your serial or COM port you can then press the button with the arrow
pointing to the right.

Once that happens you should see the TX and RX LEDs below the L LED flash. This is the
communication going on between the computer and the Arduino. The L may flicker too. Once this
dance is complete your program should be running. And your LED should be off.
Now let’s try and switch it on using the HIGH constant.

DEPT. OF ECE, LIET Page | 35


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

intledPin = 13;

void setup()
{
pinMode(ledPin, OUTPUT);
}

void loop()
{
digitalWrite(ledPin, HIGH);
}
Press Upload again and you should see your LED is now on!
Let’s make this a little more interesting now. We’re going to use another method called delay() which
takes an integer of a time interval in milliseconds, meaning the integer of 1000 is 1 second.
So after where we switch the LED on let’s add delay(2000) which is two seconds, then
digitalWrite(ledPin, LOW) to switch it off and delay(2000) again.
intledPin = 13;

void setup()
{
pinMode(ledPin, OUTPUT);
}

void loop()
{
digitalWrite(ledPin, HIGH);
delay(2000);
digitalWrite(ledPin, LOW);
delay(2000);
}

DEPT. OF ECE, LIET Page | 36


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

CHAPTER 6
ALGORITHM
6.1 Algorithm:
1. On supplying power to the circuit the LCD, RF modules and L293D motor IC are initialized.
2. On initializing the LCD the 3 lane traffic sequence is also initialized.
3. The motor value is 0 initially.
4. On pressing the RF-1 if the condition is HIGH the LCD displays lane-1 as Green for 10 seconds
and if LOW it does not execute any command.
5. On pressing the RF-2 if the condition is HIGH the LCD displays lane-2 as Green for 10 seconds
and if LOW it does not execute any command.
6. On pressing the RF-3 if the condition is HIGH the LCD displays lane-3as Green for 10 seconds
and if LOW it does not execute any command.
7. On pressing the RF-4 if the condition is HIGH the DC MOTOR is rotated 180 Degree
Clockwise and then 180 Degree Anti clockwise. If the signal is LOW then no command is
executed.
8. When none of the commands are executed then these conditions constantly check for inputs
from the user.
9.
10. Finally the operation stops.

DEPT. OF ECE, LIET Page | 37


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

6.2 FLOW CHART:

Fig 6.1:Flow chart

DEPT. OF ECE, LIET Page | 38


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

CHAPTER 7
PROGRAM
7.1 Program Mode:
#include <Wire.h>

#include < LiquidCrystal_I2C.h>

//I2C pins declaration

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

const int m0 = 2; // the number of the pushbutton pin

const int m1 = 3; // the number of the pushbutton pin

const int rf0 = 4; // the number of the pushbutton pin

const int rf1 = 5; // the number of the pushbutton pin

const int rf2 = 6; // the number of the pushbutton pin

const int rf3 = 7; // the number of the pushbutton pin

const int button = 9; // the number of the pushbutton pin

const int gate = 13; // the number of the pushbutton pin

int rfState0 = 0; // variable for reading the pushbutton status

int rfState1 = 0; // variable for reading the pushbutton status

int rfState2 = 0; // variable for reading the pushbutton status

int rfState3 = 0; // variable for reading the pushbutton status

DEPT. OF ECE, LIET Page | 39


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

//int gateState = 0; // variable for reading the pushbutton status

int buttonState = 0; // variable for reading the pushbutton status

void setup()

lcd.begin(16,2); //Defining 16 columns and 2 rows of lcd display

pinMode(rf0, INPUT);

pinMode(rf1, INPUT);

pinMode(rf2, INPUT);

pinMode(rf3, INPUT);

pinMode(button, INPUT_PULLUP);

pinMode(gate, OUTPUT);

lcd.backlight(); //To Power ON the back light

lcd.setCursor(0,0); //Defining positon to write from first row,first column .

lcd.print("AUTO TRAFFIC"); //You can write 16 Characters per line .

delay(1000); //Delay used to give a dynamic effect

lcd.setCursor(0,1)5; //Defining positon to write from second row,first column .

lcd.print("GATES4AMBULANCE");

delay(4000);

lcd.clear(); //Clean the screen

void loop()

//Write your code

DEPT. OF ECE, LIET Page | 40


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

buttonState=digitalRead(button);

rfState0 = digitalRead(rf0);

rfState1 = digitalRead(rf1);

rfState2 = digitalRead(rf2);

rfState3 = digitalRead(rf3);

// lcd.setCursor(0,0); //Defining positon to write from first row,first column .

// lcd.print(" AUTOMATED AMBULANCE "); //You can write 16 Characters per line .

delay(1000); //Delay used to give a dynamic effect

lcd.setCursor(0,0);

lcd.print("LANE1:G ");

lcd.print("LANE2:R ");

lcd.setCursor(0,1);

lcd.print("LANE3: R");

delay(2000);

lcd.setCursor(0,0);

lcd.print("LANE1:R ");

lcd.print("LANE2:G ");

lcd.setCursor(0,1);

lcd.print("LANE3: R");

delay(2000);

lcd.setCursor(0,0);

lcd.print("LANE1:R ");

lcd.print("LANE2:R ");

lcd.setCursor(0,1);

DEPT. OF ECE, LIET Page | 41


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

lcd.print("LANE3: G");

delay(2000);

if (rfState0 == LOW) {

lcd.setCursor(0,0);

lcd.print("LANE1:G ");

lcd.print("LANE2:R ");

lcd.setCursor(0,1);

lcd.print("LANE3: R");

delay(7000);

//else {lcd.print(" ");

digitalWrite(m0, LOW);

digitalWrite(m1, LOW);

if (rfState1 == LOW) {

lcd.clear();

lcd.setCursor(0,0);

lcd.print("LANE1:R ");

lcd.print("LANE2:G ");

lcd.setCursor(0,1);

lcd.print("LANE3: R");

delay(7000);

//else {lcd.print(" ");

digitalWrite(m0, LOW);

DEPT. OF ECE, LIET Page | 42


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

digitalWrite(m1, LOW);

if (rfState2 == LOW) {

lcd.clear();

lcd.setCursor(0,0);

lcd.print("LANE1:R ");

lcd.print("LANE2:R ");

lcd.setCursor(0,1);

lcd.print("LANE3: G");

delay(7000);

// else {lcd.print(" ");

digitalWrite(m0, LOW);

digitalWrite(m1, LOW);

if (rfState3 == LOW) {

lcd.setCursor(10,1);

lcd.print("GATE ON");

digitalWrite(m0, HIGH);

digitalWrite(m1, LOW);

delay(2000);

lcd.setCursor(10,1);

lcd.print("GATE OFF");

digitalWrite(m0`, LOW);

digitalWrite(m1, HIGH);

DEPT. OF ECE, LIET Page | 43


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

delay(2000);

digitalWrite(m0, HIGH);

digitalWrite(m1, HIGH);

// else {

lcd.print(" ");

digitalWrite(m0, LOW);

digitalWrite(m1, LOW);

// if (buttonState == HIGH) {

digitalWrite(gate, LOW);

else {

digitalWrite(gate, HIGH);

DEPT. OF ECE, LIET Page | 44


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

CHAPTER 8
RESULTS ANALYSIS
8.1 Procedure:
1. Write the program on the ARDUINO software to create a .HEX file

2. Dump the .HEX file to the controller with help of USB connector cable.

3. Now give the connection as per the circuit diagram.

4. While making the connections, ensure that there is no any common connection between DCand AC
supplies.

5. Use 7805 power supply circuit to provide regulated 5v DC to the microcontroller.

6. Switch on the both AC and DC supplies.

7. Transmit using the one of button on the transmitter.

8. The receiver receives the data and send to ARDUNIO UNO board.

9. The ARDUINO UNO board provides relevant data to the LCD display and D.C MOTOR.

STEP 1: CIRCUIT CONNECTION:

Fig 8.1: Circuit Connection.

DEPT. OF ECE, LIET Page | 45


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

CONNECTION ESTABLISHED:

Fig 8.2:Gate is trigger open

Fig 8.3 : Gate is trigger closed

DEPT. OF ECE, LIET Page | 46


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

Fig 8.4: Selecting one of the lanes

8.2 Limitations:
 In this project the traffic when cleared from the lane clears at its own pace we cannot make it
clear fast.
 The gates at the hospital may malfunction when there is no electricity/power supply.
 There is no failsafe mechanism present in this project.

We have already observed the experiments and discussed about the results of the project
circuit. Limitation of the circuit has also explained too. Nevertheless this circuit has also some
advantages, future scope of improvement and now we are going to focus on it.

8.3Application and Advantages:

Applications:
1. Ease of ambulance transport through traffic.
2. Unmanned operation of Gates.
3. Wireless communication to the traffic signal.
4. Due to its portability it can be carried anywhere with ease.

ADVANTAGES:

1. Faster transport of ambulance than the conventional ways.


2. Unmanned gate function.
3. High Priority transport of the ambulance to the hospital.

DEPT. OF ECE, LIET Page | 47


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

CHAPTER 9
CONCLUSION
The project “AUTOMATED TRAFFIC SIGNALS AND GATES FOR AMBULANCE” has been
successfully designed and tested. It has been developed by integrating features of all 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 and with the help of
growing technology the project has been implemented successfully.

DEPT. OF ECE, LIET Page | 48


AUTOMATED TRAFFIC SIGNALS & GATES FOR AMBULANCE 2019

REFERENCES
1. https://www.researchgate.net/publication/274951817
2. https://www.arduino.cc/
3. EMBEDDED SYSTEM BY MAZZIDI
4. Magazines
5. https://www.google.com
6. Electronics for you
7. https://www.howstuffworks.com/
8. https://www.researchgate.net.

DEPT. OF ECE, LIET Page | 49

You might also like