Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
1
CHAPTER NO:1 INTRODUCTION
The main aim of this project is develop an intelligent ambulance which will reach the hospital...
2
1.3 BLOCK DIAGRAM:
Fig no 1.1: Block diagram of intelligence ambulance
Siren
TRAFFIC POST:
Ambulance w ith
RF
Transmitte...
3
CHAPTER NO:2 LITRATURE SURVEY
2.1 INTRODUCTION
Nowadays Wireless Sensor Networks (WSN) has been applied in various domai...
4
2.2 PROPOSED SYSTEM
In proposed system if a vehicle has met accidents, immediately an alert message with the
location co...
5
If a vehicle has met accident, vibration sensor or fire sensor gives the electric signal to
microcontroller through sign...
6
Fig no 2.3: Block Diagram Of traffic unit
2.4 SYSTEM IMPLEMENTATION
Our system consists of three main units, which coord...
7
2. Ambulance unit
The controller finds the nearest ambulance to the accident spot and also the shortest path
between the...
8
CHAPTER NO :3 SYSTEM SPECIFICATION
3.1 COMPONENT SPECIFICATION
 Microcontroller 8051
 Lcd 16x2 Monocolur
 IR Sensors ...
9
CHAPTER NO: 4 IMPLEMENTATION
4.1 SOFTWARE REQUIREMENTS
4.1.1Keil
Keil is a compiler that offers evaluation package that ...
10
6. Double Click on the that part.
7. Scroll down and select the Part
8. Click OK.
Fig no 4.2: Slecting target
Creating ...
11
Fig no 4.3: Creating source file
Fig no 4.4: Save as file
12
4.1.2 FlashMagic
The Flash Magic utility connects the PC's COM port to the serial port of the MCB2300 and
provides In-S...
13
5. Click Start to download the Hex File into the Flash ROM of the P89LPC952.
Fig no 4.6: Flash magic bar
4.1.3 HyperTer...
14
results given. Other functions of HyperTerminal would include the recording of data being sent
to and from the service ...
15
This is the wire used to connect PC with circuitry. The wire is known as port wire.
Fig no 4.9: wire
4.2 DESIGN STRATEG...
16
The design engineer can choose to run the application with the conventional 80C51 clock rate
(12 clocks per machine cyc...
17
4.2.1.4 DIP40 pin configuration:
Fig no 4.11: pin diagram of P89V51RD2
4.2.2 Main Modules of the System
4.2.2.1Communic...
18
between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating Equipment).
Fig no 4.12: Communication port...
19
4.2.2.3 RS-232 Level Converters
Usually all the digial ICs works on TTL or CMOS voltage
levels which cannot be used to ...
20
Fig no 4.15: Interfacing max 232 with controller
4.2.3 Power Supply:
The +5 volt supply is useful for both analog and d...
21
4.2.3.1 Schematic Diagram
Fig no 4.16: Schematic diagram of power supply
The +5 volt power supply is based on the comme...
22
4.2.4 LCD Interfacing:
The most commonly used Character based LCDs are based on Hitachi's HD44780 controller or
other w...
23
but be aware that some modules may require a negative potential; as low as 7V in some cases. For
absolute simplicity, c...
24
the module, or pulled high to read character data or status information from its registers.
Pin 6 is Enable (E) line. T...
25
2. Display On-Off control:
Send 0FH for display and blink cursor on.
3. Entry mode set:
Send 06H for cursor in incremen...
26
When RS is low (0), the data is to be treated as a command. When RS is high (1), the data being
sent is considered as t...
27
CHAPTER NO. 5 DESIGN OF SOLUTION
In our project we have three components-ambulance which acts as the client, scanners w...
28
//ENTER A NEW NODE
Step 4: click” ENTER NEW NODE” button in new window
//another window opens
GOTO Step 5
Step 5: Enter...
29
5.1.2 Flow Diagram:
Fig no 5.1: Flow diagram of admnistration
5.2 AMBULANCE
5.2.1 Step Algorithm
Step 1: START
Step 2: ...
30
GOTO Step 13
Step 5: Count the number of ambulance present in current node
Step 6: find number of ambulance present in ...
31
5.2.2 Flow Diagram
Fig no 5.2: Flow diagram of ambulance unit
32
5.3 PROCEDURE PATH
5.3.1 Flow Diagram
Fig no 5.3: Flow diagram of procedure path
33
5.3.2 StepAlgorithm
Step 1: Start.
Step 2: Read the destination and the port number through which you want to communica...
34
Step 18: For all paths obtained between the source and the destination through the above
procedure, calculate their res...
35
Traffic_Light();
}
Traffic_AC()
{
here:
YA=0;YC=0;YB=0;YD=0;
GA=1;GC=1;GB=0;GD=0; //A and C side Green; B and D side Re...
36
YA=0;YC=0;YB=1;YD=1;
if(count<20)
{
if(Input==0)
{
while(Input==0);
if(A==1 || C==1) //Ambulance from A or C side
{
Tra...
37
{
Traffic_Light();
}
if(b==1 || D==1) //Ambulance from B or D side
{
Traffic_Light1();
}
}
goto here2;
}
count=0;
}
Yel...
38
goto here3;
}
}
Traffic_Light()
{
Traffic_AC();
Yellow_BD();
Traffic_BD();
Yellow_AC();
}
Traffic_Light1()
{
Traffic_BD...
39
CHAPTER NO:6 FORMATION OF PROBLEM
Hello Friends There is saying “Necessity is Mother of Invention.” This project is res...
40
Now let us discuss its functionality in more detail:
6.1 SIMULATION
1. As soon as power supply is provided to the set u...
41
green. Along with that status of traffic lights for road B and D will automatically become red and
vice versa. This ens...
42
Following is the ambulance detector circuit which is to be installed at the traffic signals.
Fig no 6.6: PCB of Ambulan...
43
Driver of intelligent ambulance can check the status of traffic light on that particular road and if
there is a red sig...
44
CHAPTER NO:7 SYSTEM TESTING
7.1 SIMULATION RESULTS
Intelligent Traffic Light System is simulated using PROTEUS SOFTWARE...
45
7.1.2 After Amulance Reaching Traffic Signal
After ambulance reaching the traffic signal junction the signal will turn ...
46
CHAPTER NO: 8 RESULT & DISCUSSION
From a proper analysis of positive points and constraints of the system it is inferre...
47
CONCLUSION & FUTURE SCOPE
In this paper, a novel idea is proposed for controlling the traffic signals in favor of ambul...
48
REFERENCES
[1]. Wang wei, fan hanbo, traffic accident Automatic detection and remote alarm Device
[2]. Zhaosheng yang. ...
Upcoming SlideShare
Loading in …5
×

intelligence Ambulance project report

33,270 views

Published on

i am b.tech in ece final year student.....i share the project report made on intelligence ambulance

intelligence Ambulance project report

  1. 1. 1 CHAPTER NO:1 INTRODUCTION The main aim of this project is develop an intelligent ambulance which will reach the hospitals without any problem in heavy traffics. 1.1 INTRODUCTION This particular project is designed for the cities with heavy traffic .Eg: In Bangalore the roads are full jammed every time. Most of the time the traffic will at least for 100meters .In this distance the traffics police can’t hear the siren form the ambulance .so he ignores this .Then the ambulance has to wait till the traffic is left. Some times to leave the traffic it takes at least 30 minutes .So by this time any thing can happen to the patient .So this project avoid these disadvantages. According to this project if any ambulance comes near when the ambulance at emergency comes to any traffic post the traffic signals automatically stop the signals and give green signal for this ambulance. When the ambulance at emergency comes to any traffic post the traffic signals automatically stop the signal. the road accidents in modern urban areas are increased to uncertain level. The loss of human life due to accident is to be avoided. Traffic congestion and tidal flow are major facts that cause delay to ambulance. To bar lossof human life due to accidents we introduce a scheme called ITLS (Intelligent Traffic Light system). The main theme behind this scheme is to provide a smooth flow for the emergency vehicles like ambulance to reach the hospitals in time and thus minimizing the delay caused by traffic congestion. The idea behind this scheme is to implement ITLS which would control mechanically the traffic lights in the path of the ambulance. The ambulance is controlled by the control unit which furnishes adequate route to the ambulance and also controls the traffic light according to the ambulance location and thus reaching the hospital safely. The controller identifies the location of the accident spot through the sensor systems in the vehicle which determined the accident and thus the controller walks through the ambulance to the spot. This scheme is fully automated, thus it finds the accident spot, controls the traffic lights, helping to reach the hospital in time 1.2 WORKING PRINCIPAL : The ambulance carries an IR transmitter and IR receiver will be there some few meter before the signal.The receiver will receive the signal and the module will send the command turn on green through the RFand every traffic post will have an RF receiver. So whenever the ambulance comes near the traffic, the ambulance will transmit a code say ³emergency´ the receiver will receive this signal .Then it immediately switch off the other signals that is it make all the signals red and later make this particular direction signal green.
  2. 2. 2 1.3 BLOCK DIAGRAM: Fig no 1.1: Block diagram of intelligence ambulance Siren TRAFFIC POST: Ambulance w ith RF Transmitter AMBULANCE: Micro Controller (AT89S52) RTC RTC OSC Battery Backup Power Supply Trans former Rectifier Filter Regulator (7805) LCD (Display) LCD Glass LCD Driver RFReceiver EPROM
  3. 3. 3 CHAPTER NO:2 LITRATURE SURVEY 2.1 INTRODUCTION Nowadays Wireless Sensor Networks (WSN) has been applied in various domains like weather monitoring military, home automation, health care monitoring, security and safety etc. or in a nut shell one can say wireless sensor network can be applied in most of the domains [1], [7]. Traffic Signal System or traffic monitoring is a vast domain where WSN can be applied to gather information about the incoming flow of traffic, traffic load on a particular road, traffic load at particular period of time (peak hours) and in vehicle prioritization. WSN installed along a road can be utilized to control the traffic load on roads and at traffic intersections [5], [9]. The sensor nodes that are to be deployed along the road are small in size and have low energy consumption [2], [3]. These sensors run on both battery power as well as solar energy. They have the capability to draw solar energy so that they can use sunlight for functioning in bright and sunny condition and the battery power for functioning at night or in cloudy or foggy condition. Sensors used in the Wireless Sensor Network for traffic signal systems are mainly of two types: i) Intrusive type ii) Non-Intrusive type i) Intrusive types of sensor are kept under the road and sense the traffic waiting at the signal. This type of sensor has the same working principle as that of a metal detector. ii) ii) Non-Intrusive types of sensor is fitted on the road. The installation of this type of sensor is easy as no cutting of road is needed to be done. Non-intrusive sensor includes acoustic sensors or video image processors to detect the presence of vehicles waiting at the traffic intersection. Although Intrusive sensors are very effective still Nonintrusive sensors are preferred over Intrusive sensors as they are cost-effective, easy to install, immune to natural corrosion and degradation
  4. 4. 4 2.2 PROPOSED SYSTEM In proposed system if a vehicle has met accidents, immediately an alert message with the location coordinates is sent to the Control center. From the control center, a message is sent to the nearby ambulance. Also signal is transmitted to all the signals in between ambulance and vehicle location to provide RF communication between ambulance and traffic section. The vehicle accident observed using vibration sensor and in the control section it is received by the microcontroller and then the nearby ambulance is received from the PC and controller sends the message to the ambulance. The signal to Traffic signal section is transmitted through RF communication. Also if any fire occurs, it is detected using fire sensor and an alarm message is directly sent to the fire stationary 2.3BLOCK DIAGRAMS 2.3.1 Block DiagramOf Vehicle Unit Fig no 2.1: Block diagram of vehicle unit
  5. 5. 5 If a vehicle has met accident, vibration sensor or fire sensor gives the electric signal to microcontroller through signal conditioner. Then GPS provides latitude and longitude information about vehicle location to control section through GSM. 2.3.2 Block DiagramOf Ambulance/Control Unit Fig no 2.2: Block Diagram of Ambulance/Control Unit In control section GSM modem receives message about accident and send it to PC. PC identifies the nearest ambulance and ambulance is instructed to pick up the patient. Control section transmits the control signal to all the signals in between ambulance and vehicle by RF transmission. 2.3.3 Block Diagramof Traffic Unit Whenever the ambulance reaches near to the traffic signal(approximately 100m), the traffic signal will be made to green through RF communication. Thereby the ambulance is recommended to reach the hospital in time.
  6. 6. 6 Fig no 2.3: Block Diagram Of traffic unit 2.4 SYSTEM IMPLEMENTATION Our system consists of three main units, which coordinates with each other and makes sure that ambulance reaches the hospital without any time lag. Thus our system is divided into following three units, The Vehicle Unit The Ambulance/control Unit Traffic unit 1 Vehicle unit The vehicle unit installed in the vehicle senses the accident and sends the location of the accident to the controller. According to our system, every vehicle should have a vehicle unit. The vehicle unit consists of a vibration sensor, controller, siren, a user interface, GPS system and a GSM module. The vibration sensor used in the vehicle will continuously sense for any large scale vibration in the vehicle [1]. The sensed data is given to the controller GPS SYSTEM inside the vehicle. The GPS SYSTEM finds out the current position of the vehicle (latitude and the longitude) which is the location of the accident spot and gives that data to the GSM MODULE. The GSM MODULE sends this data to the control unit whose GSM number is already there in the module as an emergency number
  7. 7. 7 2. Ambulance unit The controller finds the nearest ambulance to the accident spot and also the shortest path between the ambulance, accident spot and the nearest hospital. The controller then sends this path to the ambulance. Also using this information the controller controls all the traffic signals in the path of ambulance and makes it ready to provide free path to ambulance, which ensures that the ambulance reaches the hospital without delay. At the same time, the ambulance unit turns ON the RF transmitter. This will lead to communicate with the traffic section. 3. Traffic unit Whenever traffic signal section receives the information about accident, the RF receiver in this section is turned ON to search for ambulance nearing the traffic signal. Whenever the ambulance reaches near to the traffic signal(approximately 100m), the traffic signal will be made to green through RF communication. Thereby the ambulance is recommended to reach the hospital in time
  8. 8. 8 CHAPTER NO :3 SYSTEM SPECIFICATION 3.1 COMPONENT SPECIFICATION  Microcontroller 8051  Lcd 16x2 Monocolur  IR Sensors LM358  Temperature Sensor LM 35  LEDs  Power Supply 5V DC 3.2 SOFTWARE USED  Keil  Proteus  Flash Magic  Embedded C  Hyper Terminal
  9. 9. 9 CHAPTER NO: 4 IMPLEMENTATION 4.1 SOFTWARE REQUIREMENTS 4.1.1Keil Keil is a compiler that offers evaluation package that will allow the assembly & debugging of files 2K or less. Following shows the basic structure of keil window. Fig no 4.1: Keil software menu bar Starting a new Assembler Project: 1. Select New Project from the Project Menu. 2. Name the project ‘hello.a51’ 3. Click on the Save Button. 4. The device window will be displayed. 5. Select the part you will be using to test with.
  10. 10. 10 6. Double Click on the that part. 7. Scroll down and select the Part 8. Click OK. Fig no 4.2: Slecting target Creating Source File: 1. Click File Menu and select New. 2. A new window will open up in the Keil IDE. 3. Copy the example to the Right into the new window. 4. Click on File menu and select Save As… 5. Name the file Toggle.a51 6. Click the Save Button.
  11. 11. 11 Fig no 4.3: Creating source file Fig no 4.4: Save as file
  12. 12. 12 4.1.2 FlashMagic The Flash Magic utility connects the PC's COM port to the serial port of the MCB2300 and provides In-System Flash Programming (ISP) support for Intel HEX files. Flash Magic is a PC tool for programming flash based microcontrollers from NXP using a serial or Ethernet protocol while in the target hardware. Following are the steps to access flash magic 1.Select COM 3 for the COM Port, specify 7200 as the Baud Rate, and select the 89LPC952 as the Device. 2.Enable Erase blocks used by Hex File. 3.Select the Hex File, for example: C:KEILC51EXAMPLESPHILIPS LPC95xBLINKYBLINKY.HEX. 4.In the Options — Advanced Options dialog, enable Use DTR and RTS to enter ISP mode, and select Keil MCB 900 from the Hardware drop-down box Fig no 4.5: Advance option
  13. 13. 13 5. Click Start to download the Hex File into the Flash ROM of the P89LPC952. Fig no 4.6: Flash magic bar 4.1.3 HyperTerminal HyperTerminal is an application you can use in order to connect your computer to other remote systems. These systems include other computers, bulletin board systems, servers, Telnet sites, and online services. However, you would need a modem, an Ethernet connection, or a null modem cable before you can use HyperTerminal. Within HyperTerminal’s user interface, you will find menus, buttons, icons, and messages. All these elements and controls work together so as to provide convenience for the user, especially for accessing the necessary features and performing various tasks. This application is a useful tool, particularly for testing if your modem is working well and in verifying if you have a stable connection with other sites. In order to check if your modem’s settings are configured correctly or if your modem is connected properly, you can send a set of commands through HyperTerminal and view the
  14. 14. 14 results given. Other functions of HyperTerminal would include the recording of data being sent to and from the service of the computer you are connected to. Through this information, you will be able to determine the stability of your connections. Fig no 4.7: Establing connection Main window: Fig no 4.8: Hyperterminal bar
  15. 15. 15 This is the wire used to connect PC with circuitry. The wire is known as port wire. Fig no 4.9: wire 4.2 DESIGN STRATEGY This console project is intended to be a low-end and low-cost system that will focus mainly on affordability and simplicity rather than connectivity or even ease-of-use. Hence this will be a stand-alone system that will not need a special communications interface. These limits the design phase to four sub-systems: keypad, controller, and visual/mechanical interface. 4.2.1 ControllerSelection The P89V51RD2FN controller was selected from the beginning as the sole candidate device, however there was more decision-making to be made. Mainly, this centered around the choice between a commercial or industrial-grade controller. controller should be so chosen that the system could make the most of its rugged and weather-proof design. P89V51RD2: 8-bit 80C51 5 V low power 16/32/64 kB Flash microcontroller with 1 kB RAM 4.2.1.1 General description The P89V51RB2/RC2/RD2 are 80C51 microcontrollers with 16/32/64 KB Flash and 1024 bytes of data RAM. A key feature of the P89V51RD2 is its X2 mode option.
  16. 16. 16 The design engineer can choose to run the application with the conventional 80C51 clock rate (12 clocks per machine cycle) or select the X2 mode (6 clocks per machine cycle) to achieve twice the throughput at the same clock frequency. 4.2.1.2 Features a) 80C51 Central Processing Unit. b) 5 V Operating voltage from 0 MHz to 40 MHz. c) 16/32/64 kB of on-chip Flash user code memory with ISP d) Supports 12-clock (default) or 6-clock mode selection via software or ISP. e) SPI (Serial Peripheral Interface) and enhanced UART. f) Four 8-bit I/O ports with three high-current Port 1 pins (16 mA each). g) Three 16-bit timers/counters. 4.2.1.3 Block Diagram of P89V51RD2: Fig no 4.10: Block diagram of P89V51RD2
  17. 17. 17 4.2.1.4 DIP40 pin configuration: Fig no 4.11: pin diagram of P89V51RD2 4.2.2 Main Modules of the System 4.2.2.1CommunicationKit: UART (Universal Asynchronous Receiver Transmitter) or USART (Universal Synchronous Asynchronous Receiver Transmitter) are one of the basic interface which you will find in almost all the controllers available in the market till date. This interface provide a cost effective simple and reliable communication between one controller to another controller or between a controller and PC. RS-232 Basics RS-232 (Recommended Standard 232) is a standard for serial binary data signals connecting
  18. 18. 18 between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating Equipment). Fig no 4.12: Communication port 4.2.2.2 Voltage Levels: The RS-232 standard defines the voltage levels that correspond to logical one and logical zero levels. Valid signals are plus or minus 3 to 25 volts. The range near zero volts is not a valid RS- 232 level; logic one is defined as a negative voltage, the signal condition is called marking, and has the functional significance of OFF. Logic zero is positive, the signal condition is spacing, and has the function ON. So a Logic Zero represented as +3V to +25V and Logic One represented as -3V to -25V. Fig no 4.13:Voltage level
  19. 19. 19 4.2.2.3 RS-232 Level Converters Usually all the digial ICs works on TTL or CMOS voltage levels which cannot be used to communicate over RS-232 protocol. So a voltage or level converter is needed which can convert TTL to RS232 and RS232 to TTL voltage levels. The most commonly used RS-232 level converter is MAX232. Fig no 4.14: Max 232 This IC includes charge pump which can generate RS232 voltage levels (-10V and +10V) from 5V power supply. It also includes two receiver and two transmitters and is capable of full- duplex UART/USART communication. 4.2.2.4 MAX232 Interfacing with Microcontrollers To communicate over UART or USART, we just need three basic signals which are namely, RXD (receive), TXD (transmit), GND (common ground). So to interface MAX232 with any microcontroller (AVR, ARM, 8051, PIC etc..) we just need the basic signals. A simple schematic diagram of connections between a microcontroller and MAX232 is shown below.
  20. 20. 20 Fig no 4.15: Interfacing max 232 with controller 4.2.3 Power Supply: The +5 volt supply is useful for both analog and digital circuits. DTL, TTL, and CMOS ICs will all operate nicely from a +5 volt supply. In addition, the +5 volt supply is useful for circuits that use both analog and digital signals in various ways.
  21. 21. 21 4.2.3.1 Schematic Diagram Fig no 4.16: Schematic diagram of power supply The +5 volt power supply is based on the commercial 7805 voltage regulator IC. This IC contains all the circuitry needed to accept any input voltage from 8 to 18 volts and produce a steady +5 volt output, accurate to within 5% (0.25 volt). It also contains current-limiting circuitry and thermal overload protection, so that the IC won't be damaged in case of excessive load current; it will reduce its output voltage instead. The 1000µf capacitor serves as a "reservoir" which maintains a reasonable input voltage to the 7805 throughout the entire cycle of the ac line voltage. The two rectifier diodes keep recharging the reservoir capacitor on alternate half-cycles of the line voltage, and the capacitor is quite capable of sustaining any reasonable load in between charging pulses. The 10µf and .01µf capacitors serve to help keep the power supply output voltage constant when load conditions change. The electrolytic capacitor smooth out any long-term or low frequency variations. However, at high frequencies this capacitor is not very efficient. Therefore, the .01µf is included to bypass high-frequency changes, such as digital IC switching effects, to ground.The LED and its series resistor serve as a pilot light to indicate when the power supply is on. I like to use a miniature LED here, so it will serve that function without being obtrusive or distracting while I'm performing an experiment. I also use this LED to tell me when the reservoir capacitor is completely discharged after power is turned off.
  22. 22. 22 4.2.4 LCD Interfacing: The most commonly used Character based LCDs are based on Hitachi's HD44780 controller or other which are compatible with HD44580. 4.2.4.1 Pin Description 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. Fig no 4.17: LCD The function of each of the connections is shown in the table below:- Pins 1 & 2 are the power supply lines, VSS & VDD. The VDD pin should be connected to the positive supply & VSS to the 0V supply or ground. Although the LCD module data sheets specify 5V D.C. supply (at only a few milliamps), supplies of 6V & 4.5V both work well, and even 3V is sufficient for some modules. Consequently, these modules can be effectively and economically powered by batteries. Pin 3 is a control pin, VEE, which is used to alter the contrast of the display. Ideally, these pin should be connected to a variable voltage supply. A preset potentiometer connected between the power supply lines, with its wiper connected to the contrast pin is suitable in many cases,
  23. 23. 23 but be aware that some modules may require a negative potential; as low as 7V in some cases. For absolute simplicity, connecting this pin to 0V will often suffice. Pin 4 is register select (RS) line. PIN NO. NAME FUNCTION 1 VSS Ground 2 VDD Positive supply 3 VEE Contrast 4 RS Register select 5 R/W Read/Write 6 E Enable 7 D0 Data Bit 0 8 D1 Data Bit 1 9 D2 Data Bit 2 10 D3 Data Bit 3 11 D4 Data Bit 4 12 D5 Data Bit 5 13 D6 Data Bit 6 14 D7 Data Bit 7 Table 4.1: LCD pin descruption Three command control inputs. When this line is low, data bytes transferred to the display are treated as commands, and data bytes read from the display indicate its status. By setting the RS line high, character data can be transferred to and from the module. Pin 5 is (R/W) line. This line is pulled low in order to write commands or character data to
  24. 24. 24 the module, or pulled high to read character data or status information from its registers. Pin 6 is Enable (E) line. This input is used to initiate the actual transfer of commands or character data between the module and the data lines. When writing to the display, data is transferred only on the high to low transition of this signal. However, when reading from the display, data will become available shortly after the low to high transition and remain available until the signal falls low again. Pins 7 to 14 are the eight data bus lines (D0 to D7). Data can be transferred to and from the display, either as a single 8-bit byte or as two 4-bit “nibbles”. In the latter case, only the upper four data lines (D4 to D7) are used. This $-bit mode is beneficial when using a microcontroller, as fewer I/O lines are required. 4.2.4.2 LCD Initialization: This is the pit fall for beginners. Proper working of LCD depend on the how the LCD is initialized. We have to send few command bytes to initialize the lcd. Simple steps to initialize the LCD. Fig no 4.18: Lcd initialization 1. Specify function set: Send 38H for 8-bit, double line and 5x7 dot character format.
  25. 25. 25 2. Display On-Off control: Send 0FH for display and blink cursor on. 3. Entry mode set: Send 06H for cursor in increment position and shift is invisible. 4. Clear display: Send 01H to clear display and return cursor to home position. Liquid Crystal Display also called as LCD is very helpful in providing user interface as well as for debugging purpose.These LCD's are very simple to interface with the controller as well as are cost effective. Fig no 4.19: LCD display The most commonly used ALPHANUMERIC displays are 1x16 (Single Line & 16 characters), 2x16 (Double Line & 16 character per line) & 4x20(four lines & Twenty characters per line). The LCD requires 3 control lines (RS, R/W & EN) & 8 (or 4) data lines. The number on data lines depends on the mode of operation. If operated in 8-bit mode then 8 data lines + 3 control lines i.e. total 11 lines are required. And if operated in 4-bit mode then 4 data lines + 3 control lines i.e. 7 lines are required. How do we decide which mode to use? It’s simple if you have sufficient data lines you can go for 8 bit mode & if there is a time constrain i.e. display should be faster then we have to use 8-bit mode because basically 4-bit mode takes twice as more time as compared to 8-bit mode.
  26. 26. 26 When RS is low (0), the data is to be treated as a command. When RS is high (1), the data being sent is considered as text data which should be displayed on the screen. When R/W is low (0), the information on the data bus is being written to the LCD. When RW is high (1), the program is effectively reading from the LCD. Most of the times there is no need to read from the LCD so this line can directly be connected to Gnd thus saving one controller line. The ENABLE pin is used to latch the data present on the data pins. A HIGH - LOW signal is required to latch the data. The LCD interprets and executes our command at the instant the EN line is brought low. If you never bring EN low, your instruction will never be executed. Fig no 4.20: Interfacing of lcd with microcontroller
  27. 27. 27 CHAPTER NO. 5 DESIGN OF SOLUTION In our project we have three components-ambulance which acts as the client, scanners which act as Bluetooth access points and master servers. When the ambulance sends signal to the scanner in order to get the database for finding the shortest path leading to the hospital, the scanner sends the database to the ambulance in an encrypted format. This similar approach is observed in another work ‘In-Building Location using Bluetooth’. In this project the location of any mobile device can be detected using Bluetooth scanners. The received signal strength from each coordinate is sent to the server by the scanners. The server has a map of RSSI (Received Signal Strength Indication) at different coordinates. Thus it gives the deduced location of the mobile device by the use of the received RSSI and triangulation technique. 5.1 ADMINISTRATION 5.1.1 Stepalgorithum Step 1: START Step 2: Login window opens Enter user name: name Enter password: pass Step 3: If username exist in table: If password==pass: //login successful //Another window opens To enter new node GOTO Step 4 To insert distance between two nodes GOTO Step 7 Else: //login unsuccessful GOTO Step 2
  28. 28. 28 //ENTER A NEW NODE Step 4: click” ENTER NEW NODE” button in new window //another window opens GOTO Step 5 Step 5: Enter new node: node Enter X co-ordinate: x Enter Y co-ordinate: y Enter Z co-ordinate: z “Submit” button is pressed Step 6:”ENTER ANOTHER NODE” button is pressed //to insert another node //another window opens GOTO Step 5 //INSERT DISTANCE BETWEEN NODES Step 7:”enter distance between paths” button is pressed //another window opens GOTO Step 8 Step 8: Enter source: source Enter destination: destination Enter distance: distance “Submit” button is pressed Step 9:”ENTER ANOTHER DISTANCE” is pressed //to insert distance of other two nodes GOTO Step 8
  29. 29. 29 5.1.2 Flow Diagram: Fig no 5.1: Flow diagram of admnistration 5.2 AMBULANCE 5.2.1 Step Algorithm Step 1: START Step 2: read path, status, mac, flag, temp, priority, car count from file Step 3: search cars (Bluetooth devices) at a particular node Step 4: if mac address of ambulance is found in search: GOTO Step 5 Else:
  30. 30. 30 GOTO Step 13 Step 5: Count the number of ambulance present in current node Step 6: find number of ambulance present in every other nodes Step 7: if maximum number of ambulance is present in current node: GOTO Step 8 Else: GOTO Step 9 Step 8: Turn all node-signal RED except current node, which is turned GREEN GOTO Step 12 Step9: if number of ambulance present in current node is same as any other node and that is maximum value of ambulance in any node: GOTO Step 10 Else: GOTO Step 2 Step 10: check priority of each node Step 11: if priority of current node is maximum: GOTO Step 8 Else: GOTO Step 2 Step 12: write updated values of path, status, mac, flag, temp, carcount into file GOTO Step 2 Step 13: find opposite node of current node Step 14: check if sum of carcount of current node and opposite node is greater than threshold Value then: GOTO Step 15 Else: GOTO Step 16 Step 15: turn on current node and opposite node-signal to GREEN and others to RED GOTO Step 12 Step 16: reverse node-signal of each node after 2 bluetooth search time (1 bluetooth search time requires approximately 8 seconds) GOTO Step 12
  31. 31. 31 5.2.2 Flow Diagram Fig no 5.2: Flow diagram of ambulance unit
  32. 32. 32 5.3 PROCEDURE PATH 5.3.1 Flow Diagram Fig no 5.3: Flow diagram of procedure path
  33. 33. 33 5.3.2 StepAlgorithm Step 1: Start. Step 2: Read the destination and the port number through which you want to communicate. Step 3: Scan the nearest node/traffic signal scanner. Step 4: Connect to the node scanner with the chosen port number, and send it a message. Step 5: Receive the node and distance tables (database) in encrypted form from the scanner node, along with the name of the scanner. Step 6: Decrypt the tables to get the actual values. Step 7: Calculate the path using the procedure Calculate Path (source node name, destination node name and path). Initially variable path contains the destination node. //PROCEDURE CALCULATE PATH Step 8: For every neighbouring node to the current destination node, carry out the following steps. Step 9: If this node is already present in the path: Go to step 8 and continue execution with the next value. Else: Go to step 10. Step 10: Add the neighbouring node to the path. Step 11: If this neighbouring node is the source: Go to step 12. Else: Go to step 15. Step 12: Store the path. Step 13: From the path, remove the last node traversed. Step 14: Go to step 8. Step 15: Go to procedure CALCULATE PATH with only the destination node parameter being replaced by the neighbouring node. Step 16: Remove the node just being added to the path. Step 17: Return from the procedure CALCULATE PATH, fetching all the paths possible to go from the source to the destination.
  34. 34. 34 Step 18: For all paths obtained between the source and the destination through the above procedure, calculate their respective distances with the help of the database. Step 19: Store these distances in a list for later usage. Step 20: Calculate the minimum distance of all the distance of the paths and store its position. Step 21: Display all the paths, along with its distances in the window, where the paths are searched. Step 22: Using the modules matplotlib (pyplot) and visual, plot the two dimensional and three dimensional views of the paths with respect to the co-ordinates of the nodes obtained from the database. The minimum distance path is differentiated by colouring it red while the rest are blue. Step 23: End. Fig no 5.4: Every paths along with shortest path in 2D plot 5.4 PROGRAMING IN EMBEDDED C #include “reg51.h” #include “define.h” main() { Initialise(); while(1)
  35. 35. 35 Traffic_Light(); } Traffic_AC() { here: YA=0;YC=0;YB=0;YD=0; GA=1;GC=1;GB=0;GD=0; //A and C side Green; B and D side Red RA=0;RC=0;RB=1;rD=1; if(count<50) { if(Input==0) { while(Input==0); if(A==1 || C==1) //Ambulance from A or C side { Traffic_Light(); } if(b==1 || D==1) //Ambulance from B or D side { Traffic_Light1(); } } goto here; } count=0; } Yellow_BD() { here1:
  36. 36. 36 YA=0;YC=0;YB=1;YD=1; if(count<20) { if(Input==0) { while(Input==0); if(A==1 || C==1) //Ambulance from A or C side { Traffic_Light(); } if(b==1 || D==1) //Ambulance from B or D side { Traffic_Light1(); } } goto here1; } count=0; } Traffic_BD() { here2: YA=0;YC=0;YB=0;YD=0; GA=0;GC=0;GB=1;GD=1; //A and C side Green; B and D side Red RA=1;RC=1;RB=0;rD=0; if(count<50) { if(Input==0) { while(Input==0); if(A==1 || C==1) //Ambulance from A or C side
  37. 37. 37 { Traffic_Light(); } if(b==1 || D==1) //Ambulance from B or D side { Traffic_Light1(); } } goto here2; } count=0; } Yellow_AC() { here3: YA=1;YC=1;YB=0;YD=0; if(count<20) { if(Input==0) { while(Input==0); if(A==1 || C==1) //Ambulance from A or C side { Traffic_Light(); } if(b==1 || D==1) //Ambulance from B or D side { Traffic_Light1(); } }
  38. 38. 38 goto here3; } } Traffic_Light() { Traffic_AC(); Yellow_BD(); Traffic_BD(); Yellow_AC(); } Traffic_Light1() { Traffic_BD(); Yellow_AC(); Traffic_AC(); Yellow_BD(); }
  39. 39. 39 CHAPTER NO:6 FORMATION OF PROBLEM Hello Friends There is saying “Necessity is Mother of Invention.” This project is result of some real life scenes that most of us has witnessed. Such as : Fig no 6.1: Ambulance stuck in traffic Even campaigns like “Give Way to Ambulance” , doesn’t bring much change. So i thought of making an ambulance model that can control traffic lights on its own. The project “Intelligent Ambulance” is aimed at improvising ambulance services by ensuring a clear traffic free road. It is based on RF communication. The driver of ambulance has a transmitter and receiver is installed at the traffic light. The driver can thus control traffic lights according to the requirement and thus can control the flow of traffic in its way. Fig no 6.2 : Intelligent Ambulance Model
  40. 40. 40 Now let us discuss its functionality in more detail: 6.1 SIMULATION 1. As soon as power supply is provided to the set up it is initialized. The Intelligent Ambulance operates via RF communication. The driver of the ambulance has the transmitter module and the receiver is installed at traffic lights control unit. Sensors to detect Ambulance are installed on each Traffic light. So the initial setup is as shown in the figure below: Fig no 6.3: Initial Setup 2. Now the question arises how the ambulance controls the traffic light? Whenever ambulance enters a main road, the driver can check the status of traffic lights which will be faced on that road. The sensors installed at the traffic lights detect that ambulance and driver receives the status of that particular traffic light. Now if the traffic lights are red, and driver is in hurry and wants a clear road then he can change their status to green through the transmitter installed in ambulance. Corresponding to it traffic light of opposite road will also become green to abide with traffic rules. Similar to it the status of traffic lights of rest two lanes will become red, thereby avoiding any mess on road. As explained in figure below, A and C are opposite lanes and B and D are opposite lanes. If status of traffic light of road A is made green from red, then that of C will automatically become
  41. 41. 41 green. Along with that status of traffic lights for road B and D will automatically become red and vice versa. This ensures completely automated management. Fig no 6.4 : Operating Mode 6.2 SCHEMATIC SOLUTIONS After functioning of the project, its time to have a glance at hardware. Following are the images of the project circuitry. Fig no 6.5: PCB-Intelligent Ambulance
  42. 42. 42 Following is the ambulance detector circuit which is to be installed at the traffic signals. Fig no 6.6: PCB of Ambulance detector sensors Now suppose ambulance is passing through a road, as soon as it comes in range of traffic signal of that particular road, the sensors installed at the signal will detect the ambulance. Fig no 6.7 : Detection of Ambulance
  43. 43. 43 Driver of intelligent ambulance can check the status of traffic light on that particular road and if there is a red signal, the driver can change them to green via RF communication. Details have already been discussed above. Fig no 6.8: Red turned to green via RF Communication
  44. 44. 44 CHAPTER NO:7 SYSTEM TESTING 7.1 SIMULATION RESULTS Intelligent Traffic Light System is simulated using PROTEUS SOFTWARE and their results are presented here. The circuit model of the above system is shown and sensors are connected to measure output result. 7.1. Before Amulance Reaching Traffic Signal Before ambulance reaching the traffic signal junction, the signal will be red. Control section transmits the control signal to all the signals in between ambulance and vehicle by RF transmission. Fig no 7.1 : Before Amulance Reaching Traffic Signal
  45. 45. 45 7.1.2 After Amulance Reaching Traffic Signal After ambulance reaching the traffic signal junction the signal will turn into green with the help of the RF signal. Fig no 7.2: After ambulance reaching the traffic signal
  46. 46. 46 CHAPTER NO: 8 RESULT & DISCUSSION From a proper analysis of positive points and constraints of the system it is inferred that the system is working as per the objectives of the project. Installation and maintenance of the system is cost effective and takes less time. The system-user interface is user friendly and does not require specialized training or skills to operate it. The project has been designed to substantially enhance the performance by ensuring smooth mobility of emergency services (like ambulance, fire engines, etc.).The implementation of the algorithm is done in such a way that it not only paves way to emergency vehicles but it’s auto reinstatement of the older status of traffic light helps in smooth transition of traffic along the road. The system also reduces the workload of traffic personnel as it totally automates the whole prospect of traffic signalling which also greatly reduces the domain of error. We have also equipped it with an algorithm which provides the user with the shortest possible path between destination and source which is the biggest asset in this era where people consider time as money Being an automated signalling system it eliminates the chances of human error which often results in road accidents and mishaps. As discussed earlier, this project transforms the shortcomings (in terms of range and scanning time) of Bluetooth Technology into its strength thereby consolidating its applicability as the time lag between detection of two vehicles has to be wide enough to avoid any complications. A scan time of usually 8 seconds also provides us with adequate time for reinstating of older status of traffic lights. Thus this project is practically feasible, economically viable, and reliable in nature. It’s robust as well as easy to handle mechanism makes it easy and quite simple to be understood and brought in use by the masses. Summing up we can say that this project with its ready to apply technology and cheap installation charges invariably finds its application in our traffic signalling system. An improvisation of the project and subsequent modification of the system can serve our purpose as and when needed in near future.
  47. 47. 47 CONCLUSION & FUTURE SCOPE In this paper, a novel idea is proposed for controlling the traffic signals in favor of ambulances during the accidents. With this system the ambulance can be maneuvered from the ITLS can be proved to be effectual to contro lnot only ambulance but also authoritative vehicles. Thus ITLS if implemented in countries with large population like INDIA can produce better results. The ITLS is more accurate with no loss of time. But there may be a delay caused because of GSM messages since it is a queue based technique, which can be reduced by giving more priority to the messages communicated through the controller APPLICATIONS 1) Defence vehicles in emergency cases. 2) Fire extinguishing vehicles 3) Police vans in emergency cases
  48. 48. 48 REFERENCES [1]. Wang wei, fan hanbo, traffic accident Automatic detection and remote alarm Device [2]. Zhaosheng yang. Study on the schemes of Traffic signal timing for priority vehicles Based on navigation system, 2000. [3]. Xiaolin lu, develop web gis based Intelligent transportation application Systems with web service technology, Proceedings of international conference on its telecommunications, 2006. [4]. Katsunori tawara, naoto mukai, traffic Signal control by using traffic Congestion prediction based on Pheromone model, proceedings of 22nd International conference on tools with Artificial intelligence, 2010. [5]. Malik Tubaishat, Qi Qi, Yi Shang, Hongchi Shi “Wireless Sensor-Based Traffic Light Control” IEEE CCNC 2008 proceedings 1-4244- 1457-1/08 [6]. Qingfeng Huang and Ying Zhang. “Dynamic balancing of push and pull in a distributed traffic information system.” In IEEE Consumer Communications and Networking Conference (CCNC 2007), 2007. [7]. Jianhou Gan, Lingyun Yuan, Zhongqi Sheng and Tianwei Xu, “Construction and Implementation of an Integrated WSID Traffic Monitoring Network System”, Proc. 21st annual international conference on Chinese control and decision conference, 2009, pp. 4726- 4731. [8]. Xu Li, Wei Shu, Minglu Li, Hong-Yu Huang, Pei-En Luo, Min-You Wu, “Performance Evaluation of Vehicle-Based Mobile Sensor Networks for Traffic Monitoring” IEEE transactions on vehicular technology, May 2009, vol. 58, no. 4, pp. 1647-1653.

×