You are on page 1of 48
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 traffies 1.1 INTRODUCTION ‘This particular project is designed for the cties with heavy traffic Eg: In Bangalore the roads are fill jammed every time. Most of the time the traffic will at kast for 100meters In this distance the traffcs police can’t hear the siren form the ambulance so he ignores this .Then the ambulance has to wait til the traffic is lefi. Some times to leave the traffic 4 takes at kast 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 ambulnce at emergency comes to any traffic post the traffic signals automatically stop the signal, the road accidents in modern areas are increased to uncertain level. The Joss of human life due to accident is to be avoided. Traffic congestion and tidal fow are major facts that cause delay to ambulance. To bar lossof human fife 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 taffic Fights in the path of the ambukince, The ambulance is controled by the control unit which furnishes adequate route to the ambulunce and ako controls the traffic fight according to the ambuknce 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 i mds the accident spot, controk the traffic Fights, helping to reach the hospital in time 1.2 WORKING PRINCIPAL : ‘The ambulance camries 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 tum on green through the RFand every traffic post will have an RF receiver. So whenever the ambulance comes near the traffic, the ambulance will wansmi a code say Semergency 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 particukr direction signal green, 1.3 BLOCK DIAGRAM: ‘TRAFFIC POST: AMIBULANC! ‘Anbulanes with fe Siren LCD (Display) = tcp LcD EPROM = le—o| Drier | | Glass Mero Controller Power Supply Trane Regulator — former aaumae rectiter | | rtter eee Fig no 1.1: Block diagram of intelligence ambulance CHAPTER NO:2 LITRATURE SURVEY 2.1 INTRODUCTION Nowadays Wireless Sensor Networks (WSN) has been applied in various domains like Weather monitoring miliary, home automation, health care monitoring, security and safety ete. rin a nut shell one can say wireless sensor network can be applied in most of the domains [1]. [7]. Traffi: Signal System or taffic monitoring is a vast domain where WSN can be applied to gather information about the i ming 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 trallic 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 talfic 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) i) Nom-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 inchides 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 2.2 PROPOSED SYSTEM In proposed system if a vehicle has met accidents, immediately an alert message with the location coordinates & 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 ambulince and traffic section, The vehicle accident observed using vibration sensor and in the control section i is received by the microcontroller and then the nearby ambulance is received fom the PC and controller sends the message to the ambulance. The signal to Traffic signal section is transmitted through RF communication. Alo if any fre 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 Diagram Of Vehicle Unit Power Supply [wae | GSMModem = _f_ — PIC Micro [ors] controller = (¢—» = MAXI32. [#—— FireSensor /_—> lock diagram of vehicle unit If a vehicle has met accklent, vibration sensor or fire sensor gives the electric signal to microcontroler through signal conditioner. Then GPS provides latitude and longitude information about vehick location to contro! section through GSM. 2.3.2 Block Diagram Of Ambulance/Control Unit = = ae ae | aay 7 wm |__| joy oe PICMiero ] controller cs Modem 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 identifes the nearest ambulance and ambulance is instructed to pick up the patient. Control section transmits the control signal to all the signak in between ambulance and vehicle by RF transmission. 2.3.3 Block Diagram of Traffic Unit Whenever the ambulince reaches near to the traffic signal(approximately 100m), the traflic signal wil be made to green through RF communication, Thereby the ambulance is recommenced to reach the hospital in time. Powe Seppty ati Decode —>} = I PIC Micro Lit controller RF Raceirer 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, O The Vehick Unit (0 The Ambulance/control Unit 0 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 vehick unit cor ‘sof a vibration sensor, controller, siren, a user interface, GPS system and a GSM module. ‘The vibration sensor used in the vehick will continuously sense for any large scale vibration in the vehick [I]. The sensed data is given to the controler GPS GPS SYSTEM finds out the current position of the yehick (latitude and the longitudle) 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 SYSTEM inside the vehicle. The as an emergency number 2. Ambulance unit The controller finds the nearest ambulance to the accident spot and abo the shortest path between the ambukince, 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 i ready to provide free path to ambulance, which ensures that the ambulance reaches the hospital without delay. At the same time, the ambulance unit tums ON the RF transmitter. This will ead 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 tured ON to search for ambulance nearing the traffic signal Whenever the ambulance reaches near to the traffic signal(approximulely 100m), the tallic signal will be made to green through RF communication. Thereby the ambukince is recommended to reach the hospital in time CHAPTER NO :3 SYSTEM SPECIFICATION 3.1 COMPONENT SPECIFICATION . Microcontroller 8051 Led 16x2 Monocolur IR Sensors LM358 Temperature Sensor LM 35 LEDs Power Supply SV DC 3.2 SOFTWARE USED . Keil Proteus Flash Magic Embedded C Hyper Terminal ‘HAPTER NO: 4 IMPLE! ‘ATION 4.1 SOFTWARE REQUIREMENTS 4.1,1Keil Keil is a compiier that offers evaluation package that will allow the assembly & debugging of fies 2K or kss. 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 displyed. 5. Select the part you will be using to test with, 6. Double Click on the that part, 7. Scroll down and select the Part 8. Click OK. Creating Source File: 1. Click File Menu and select New. 2. A new window wil open up in the Keil IDE. 3. Copy the exampk to the Right into the new window. 4, Click on File menu and select Save As 5. Name the file Toggl.a51 6. Click the Save Button, Fig no 4.3: Creating source file Fig no 4.4: Save as file BER 4.1.2 Flash Magic ‘The Flash Magic utility connects the PC's COM port to the serial port of the MCB2300 and proviles In-System Flash Programming (ISP) support for Titel HEX files. Flash Magic 8 a PC tool for programming flash based microcomollers fiom NXP using a serial or Ethernet protocol while in the target hardware. Following are the steps to access flash magic LSeket 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. 3Seket the Hex File, = for exampke:-— CAKEIL\CS1\EXAMPLES\PHILIPS LPC95x\BLINK Y\BLINKY.HEX. In the Options — Advanced Options dialog, enable Use DTR and RTS to enter ISP mode, and sekct Keil MCB 900 from the Hardware drop-down box Wi egN i Ha i Filed ee bias) Fig no 4.5: Advance option 5. Click Start to download the Hex File into the Flash ROM of the P89LPC952. ‘COM Ponfcomt =] ‘Gecitater Fea (Mrz: [T6000 fo Etaes black smmd by Hex Fie ecfie[USAND GOI SAEIniriOfeedaCOuewRELEKTOR AIG ewe 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 inchide other computers, bulletin board systems, servers, Telnet sites, and online services. However, you woukl need a modem, an Ethernet comection, or a nil modem cable before you can use HyperTerminal. Within HyperTerminal’s user interface, you will find memis, 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 comectly or if your modem is connected properly, you can send a set of commands through HyperTerminal and view the B results given. Other functions of HyperTerminal woul include the recording of data being sent to and from the service of the computer you are connected to. Through thé: information, you will be abk to determine the stability of your connections. De es O85 @ TI a ea eS e Fig no 4.8: Hyperterminal bar 14 This is the wire used to connect PC with citeuitry. 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 bw-cost tem that will focus mainly on affordability and simplicty 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 Controller Selection ‘The P89V51RD2EN 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. controlkr should be so chosen that the system could make the most of its rugged and weather-proof design. P89VSIRD2: 8-bit 80C51 5 V low power 16/32/64 kB Flish microcontroller with 1 kB RAM 4.2.1.1 General description The P89V5IRB2/RC2/RD2 are 80C51 microcontrollers with 16/3264 KB Flash and 1024 bytes of data RAM. A key feature of the P89VSIRD2 is ts X2 mode option, The design engineer can choose to rin 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 MH. to 40 MHz. ©) 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. ©) SPI (Serial Peripheral Interface) and enhanced UART. 1) Four 8-bit YO pons with three high-current Port 1 pins (16 mA each). g) Three 16-bit timers/counters. 4.2.1.3 Block Diagram of P89VS1RD2: Fig no 4.10: Block diagram of P89V51RD2 16 4.2.1.4 DIP4O pin configuration: cexiBona| peavsincann POS RON Fig no 4.11: pin diagram of P89VS1RD2 4.2.2 Main Modules of the System 4.2.2.1 Communication Kit: UART (Universal Asynchronous Receiver Transmitter) or USART (Universal Synchronous Asynchronous Receiver Transmitter) are one of the basic interfice which you will find in almost all the controlers availabe in the market till date. This interface provide a cost effective simpk and reliable communication between one controller to another controller or between a controler and PC. RS-232 Basics RS-232 (Recommended Standard 232) a standard for serial binary data signals connecting 7 between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating Equipmend. 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. Vald signals are plus or minus 3 to 25 volts, ‘The minge near zero volts is not a valid RS- 232 vel; logic one is defined as a negative voltage, the signal condition is called marking, and has the fimctional 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 Logi: One represented as -3V to -25V. Veitage ea Space Space Look ot SS 1 Transtion Region = Time 2 Fig no 4.13: Voltage level 4.2.2.3 RS-232 Level Converters Usually all the digi ICs works on TTL or CMOS voltage levels which cannot be used to commumicate over RS-232 protocol. So a voltage or vel 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. wane ize: | SE | | oat | ae po =<} err aPht FF 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 ako includes two receiver and two transmitters and is capable of filll- duplex UARTUSART communication. 4.2.2.4 MAX232 Interfacing with Microcontrollers To communicate over UART or USART, we just need three basic signals which are namely, nerface MAX232 with any RXD (receive), TXD (transmit), GND (common ground). So to 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. To uC Serial Fig no 4.15: Interfacing max 232 with controller 4.2.3 Power Supply: The 45 vob supply is usefil for both analog and digital circuits, DTL, TTL, and CMOS ICs will all operate nicely fiom a +5 vok supply. In addition, the +5 vok supply is useful for circuits that use both analog and digital signals in various ways, 4.2.3.1 Schematic Diagram les" fou a Fig no 4.16: Schematic diagram of power supply The +5 volt power supply is based on the commercial 7805 vokage regulator IC, This IC contains all the circuityy needed to accept any input voltage from 8 to 18 volts and produce a steady +5 volt output, accurate to within 5% (0.25 vok). It abo contains curent-limiting circuitry and thermal overload protection, so that the IC won't be damaged in case of excessive load curent; it will reduce its output voltage instead, ‘The 1000pf capacitor serves as a "reservoir" which maintains a reasonable input vokage to the 7805 throughout the entire cycle of the ac line voltage. The two rectifier diodes keep recharging the reservoir capacitor on akemate half-cycles of the Tine voltage, and the capacitor is quite capable of sustaining any reasonable load in between charging pukes. ‘The 10pf and Olnf capacitors serve to help keep the power supply output voltage constant when load conditions change. The ekectrolytic capacitor smooth out any long-term or low frequency variations. However, at high frequencies this capacitor is not very efficient. ‘Therefore, the .Olpf is included to bypass high-frequency changes, such as digital IC. switching effects, to grounl.The LED and its series resistor serve as a pilot light to indicate when the power supply & on. I like to use a miniature LED here, so it will serve that finction 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 tumed off. 21 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 controler has 16 Pins (two pins are extia in both for back-light LED connections). Pin description is shown in the tabk: below. Fig no 4.17: LCD ‘The function of each of the connections is shown in the table belbw:- Pins | & 2 are the power supply lines, VSS & VDD. The VDD pin shoukl be connected to the positive supply & VSS to the OV supply or ground. Aithough the LCD module data sheets specify 5V D.C. supply (at only a few miliamps), 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 shoull be connected to a variable voltage supply. A preset potentiometer connected between the power supply Ines, with its wiper connected to the contrast pin is suitable in many cases, but be aware that some modules may require a negative potentiak as low as 7V in some cases. For absolute simplicity, connecting this pin to OV will often suffice Pin 4 is register select (RS) line. PIN NO NAME FUNCTION H VSS Ground 2 VbD Positive supply 3 VEE Contrast 4 RS Register select 5 RW Read/Write 6 E Enable 7 DO Data Bit 0 8 DI Data Bit 1 9 [D2 C~*«*@*«C ta BLD 10 D3 Data Bit 3 1 Dt Data Bit 4 2 DS Data Bit 5 B D6 Data Bit 6 ry D7 Data Bit 7 ‘Table 4.1: LCD pin descruption Three commanxl 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 2B the module, or pulled high to read character data orstatus information from its registers Pin 6 is Enable (E) fine. This input is used to initiate the actual transfer of commands or character data between the moduk 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 ftom the display, data will become available shortly after the Jow to high transition and remain available until the signal falls low again. Pins 7 to 14 are the eight data bus lines (DO 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 Jed. Simple steps to initialize the LED, Fig no 4.18: Led initialization 1. Specify function set: Send 38H for 8-bit, double line and 5x7 dot character format Pr 2. Display On-Off control: Sen OFHL for display and blink cursor on, 3. Entry mode set: Send 06H for cursor in increment position and shift is invisible. 4. Clear disphy: Send 01H to clear display and retum cursor to home position, Liquid Crystal Disphy alo called as LCD is very helpful in providing user interface as well as for debugging purpose. These LCD's are very simp to interface with the controller as well as are cost effective. Fig no 4.19: LCD display ‘The most commonly used ALPHANUMERIC displays are 1/6 (Singk 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 ines. The number on data lines depends on the mode of operation. If operated in 8-bit mode then 8 data lines + 3 control lines ie. total 11 lines are required. And if operated in 4-bit mode then 4 data fines + 3 control lines ic. 7 lines are required. How do we decile which mode to use? It’s simple if you have sufficient data ines you can go for 8 bit mode & if there is a time constrain ie. 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. ‘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 RAV is low (0), the information on the data bus is being writen 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 fiom 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. 2 Line X 16 Charecter LED Display Fig no 4.20: Interfacing of kd with microcontroller 26 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 ambukince sends signal to the scanner in onder to get the database for finding the shortest path kading 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 Bhetooth’. 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 Step algorithum Step 1: START Step 2: Login window opens Enter user name: name Enter password: pass Step 3: If usemame exist in table: If password: Mogin successful WAnother window opens ‘To enter new node GOTO Step 4 ‘To insert distance between two nodes GOTO Step 7 Eb: Mogin unsuccessful GOTO Step 2 a HENTER A NEW NODE. Step 4: click” ENTER NEW NODE” button in new window Hanother window opens GOTO Step 5 Step S: Enter new node: node Enter X co-ordinate: x Enier ¥ co-ordinate: y Enter Zco-ondinate: 2 “Submit” button is pressed Step 6! ENTER ANOTHER NODE” button is pressed ‘ho insext another node Hanother window opens GOTO Step 5 /ANSERT DISTANCE BETWEEN NODES Step 7:"enter distance between paths” button is pressed Hanother window opens GOTO Step 8 Step 8: Enter source: source Enter destination: destination Enter distance: distance “Submit” bution & pressed Step 9:ENTER ANOTHER DISTANCE” is pressed Tho insert distance of other two nodes GOTO Step & 28 5.1.2 Flow Diagram: Fig no 5.1: Flow diagram of adrmistration 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 ambukince is foun! in search: GOTO Step 5 Else: 29 GOTO Step 13 Step $: Count the number of ambulince present in current node Step 6: find umber of ambulance present in every other nodes Step 7: if maximum number of ambulance js present in current node: GOTO Step & Else: GOTO Step 9 Step 8: Turn all node-signal RED except current node, which is tuned GREEN GOTO Step 12 Step9: if number of ambuknce present in current node is same as any other node and that is maximum value of ambulance in any node: GOTO Step 10 Ehe GOTO Step 2 Step 10: check priority of each node Step 11: if priority of current node 8 maximum: GOTO Step 8 Else: GOTO Step 2 Step 12: write updated vais 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 Ebe GOTO Step 16 Step 15: tum 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 30 5.2.2 Flow Diagram aS "eM, PRIORITY, CARCOUNT ‘Max. No. OF AnmuaNce ‘counrataax a ‘woot? eset i! — tee xcH#r COMMENT NODE 48s FANG, THR, PRHORTY, eancount =e “cancounr jcunnent TveRse Tw SCHALARTEN Jo NoocvorvestTe “Two aLUETOOTH SEARCH ooe>tHREsi047 a Fig no $.2: Flow diagram of ambulance unit 31 5.3 PROCEDURE PATH 5.3.1 Flow Diagram Zs al destination and pat oa. o ‘Scan naarert node and connect witht ] ‘Recave the node and distance table from the canner node ‘Calculate Path (initially path = destination node) ee For Every neighboring node to destination node, follow: ‘Destination node = "Neighboring node i} Remove the node just being aaed tothe path Fetch all possible paths from source to destination ee Calculate distance of all paths from database and store the sum Calculate the minimum ofall the distances and store Rs postion + Display all paths with distances and plot thers Fig no 5.3: Flow diagram of procedure path 32 5.3.2 Step Algorithm Step 1: Step 2: Read the destimition and the port number through which you want to communicate. Step Step chosen port number, and send it a message. art ‘can the nearest node/traffic signal scanner. Connect to the node scanner with the Step 5: Receive the node and distance tabks (database) in encrypted form from the scamer node, along with the name of the scanner Step 6: Decrypt the tables to get the actual values. Step 7: Cakulate 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 curent 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 Ebe 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 replied by the neighbouring node Step 16: Remove the node just being added to the path. Step 17: Return fiom the procedure CALCULATE PATH, fetching all the paths possible to go from the source to the destination, 33 Step 18: For all paths obtained between the source and the destination through the above procedure, cakulate their respective distances with the help of the database, Step 19: Store these distances in a list for later usage. Step 20: Cakulate the minimum distance of all the distance of the paths and store its positon. Step 21: Display all the paths, along wih is distances in the window, where the paths are searched. Step 22: Using the modules meuplotliy (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: Eni. Fig no 5.4: Every paths abng with shortest path in 2D plot 5.4 PROGRAMING IN EMBEDDED C +#include “teg5 1h” +#include “define. h” main() { Initialise(); while(1) “Traffic_Light(): 1 ‘Traflic_ ACO 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 :D=1; iffcount<50) { if{Input—0) { while(Inp ut==0); if{A==1 I C==1) /Ambulance from A or C side { ‘Traflic_Light(); } iffb==1 ll D==1) /Ambulance from B or D side { ‘Traffic_Light!(; J ) goto here; } count=0: d Yellow BDO) { herel: 35 YA=0;YC=0:YB=1:YD=1 iffcount<20) { if(Input==0) { while(Inp ut==0); i{A==1 I C==1) /Ambulance fiom A or C side { ‘Traftic_Light(); =1 | D==1) /Ambubnce from B or D side ‘Traflic_Light10; 1 J goto here]: } count=0; } ‘Traffic BDO { here2: YA=0;YC=0;YB=0;YD=0; GA=0 RA=1;RC=1;RB=0;1D=0; iffcout<50) { iffInput==0) { while(Inp ut=0); ifA==1 || C==1) /Ambulance from A or C side ;GC=0;GB=I;GD=1; //A and C side Green; B and D side Red 36 { Traffic_Ligit); J if(b==1 1 D==1) //Ambulance from B or D side { ‘Traflic_Light!(); } } goto here2; 1 count=0; } Yellow_ACQ, { hore’: YA=1;YC=1:YB=0:YD=0; iffcount<20) { if{Input==0) { while(Inp ut=0); =1) /Ambulance from A or C side ‘Traflic_Light(); } ifb==1 I D==1) /Ambukance from B or D side { ‘Traflic_Lightl(); } } 7 goto here’ 1 J ‘Traffic_Light() { ‘Traic_ ACO; Yellow_BD(), Traflic_BDO; Yellow_ACO: 1 ‘Traffic_Light!() { ‘Traflic_ BDO; Yellow_ACO; ‘Traflic_ACO: Yellow_BDQ; 38 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 trafic Even campaigns like “Give Way to Ambulance”, doesn't bring much change. So i thought of making an ambulance model that can control traflic 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 trafic lights according to the requirement and thus can control the flow of traffic in its way. ‘Fig no 6.2: Inteligent Ambuknce Model 39 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 iniiafzed. 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 fight. 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 instalked in ambulance. Corresponding to it traffic light of opposite road will also become green to abide with watic rules. Similar to it the status of traffic lights of rest two kines 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 waffic ight of road A is made green from red, then that of C will automatically becom: 40 green, Along with that status of traffic lights for rad 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 Afier functioning of the project, is time to have a ghnce at hardware. Following are the insiges of the project circuitry. Fig no 6.5: PCB-Inteligent Ambulance a1 Following is the ambuknce 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 Ambukinee aa Driver of inteligent ambulance can check the status of traffic light on that particular rowd and if there is a red signal, the driver can change them to green via RF communication, Detail have akeady been discussed above. Fig no 6.8: Red tumed to green via RF Communication 43, CHAPTER, SYSTEM TESTING 7.1 SIMULATION RESULTS Inteligent 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 comnected to measure output result 7.1. Before Amulance Reaching Traffic Signal Before ambuknce reaching the traffic signal junction, the signal will he red. Control section transmits the control signal to all the signals in between ambulnce and whicle by RF transmission. Fig no 7.1: Before Anulance Reaching Traffic Signal 7.1.2 After Amulance Reaching Traffic Signal Afier ambulance reaching the traffic signal junction the signal will tum into green with the help of the RF signal Fig no 7.2: Affer ambulance reaching the traffic signal 45 CHAPTER, 8 RESULT & DISCUSSIO! From a proper analysis of posiive points and constraints of the system it & inferred that the system is working as per the objectives of the project. Installation and maintenance of the system is cost effective and takes kss time, The system-user interfice is wer friendly and does not require specialized training or skills to operate it. ‘The project has een designed to substantially enhance the performance by ensuring smooth mobility of emergency services (lie ambulance, fire engines, etc.)The impkmentation of the akorithm is done in such a way that it not only paves way to emergency vehickes but it's auto reinstatement of the oller 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 whok prospect of tratlic signalling which ako greatly reduces the domain of error. We have ako equipped t with an aborithm which provides the user with the shortest possible path between destination and source which is the biggest asset in this era where peopk consider time as money Being an antomated signalling system it eliminates the chances of human error which offen results in road accidents and mishaps. As discussed earlier, this project transforms the shortcomings (in terms of range ark scanning time) of Bluetooth Technology into its strength thereby consolidating ts 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 tim: for reinstating of older status of traffic fights Thus this project is practically feasible, economically visble, and reliable in mture, 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 fiture, 46 CONCLUSION _& FUTURE SCOPE In this paper, a novel idea is proposed for controling 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 Inot only ambulance but also authoritative vehicks. Thus ITLS if implemented in countries with large population like INDIA can produce better results. The TLS 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 controler APPLICATIONS 1) Defence vehicles in emergency cases. 2) Fite extinguishing. vehicles 3) Police vans in emergency cases a7 REFERENCES [1]. Wang wei, fan hanbo, traffic accident Automatic detection and remote alum Device [2]. Zhaosheng yang. Study on the schemes of Traffic signal timing for priority vehicks Based on navigation system, 2000. [3]. Xiaolin iu, develop web gis based Inteligent transportation application Systems with web service technology, Proceedings of intemational conierence on its telecommunications, 2006. [4]. Katsunori tawara, naoto mukai, waffic Signal control by using traflie Congestion prediction based on Pheromone model, proceedings of 22nd Intemational conférence on tools with Artificial intelligence, 2010. [5]. Malik Tubaishat, Qi Qi Yi Shang, Hongchi Shi “Wireless Sensor-Based Traffic Light Controf” IEEE CCNC 2008 proceedings 1-4244- 1457-1108 [6]. Qinsieng Huang and Ying Zhang. “Dynamic balancing of push and pull in a distributed traffic information system.” In IEEE Consumer ‘Communications and Networking Conférence (CCNC 2007), 2007. [7]. Jianhou Gan, Lingyun Yuan, Zhongyi Sheng and Tiamwei Xu, “Construction and Implementation of an Integrated WSID Traffic Monitoring Network System’, Proc. 21st anmmual international conference on Chinese control and decision conference, 2009, pp. 4726- 4731. [8]. Xu Li, Wei Shu Mingu Li, Hong-Yu Huang, Pei-En Luo, Min-You Wu, “Performance Evakution of Vehick-Based Mobik Sensor Networks for Traffic Monitoring” IEEE transactions on vehicular technology, May 2009, vol. 58, no. 4, pp. 1647-1653. 48

You might also like