Emergency automatic signalling system using time scheduling

It is difficult to handle traffic congestion and maintain roads during traffic mainly in India. As the people migrate from rural to urban and sub-urban areas, it becomes still more critical. Presently Roadways is a standout amongst the most vital transportation. At the point when a car crash happens, crisis vehicles, for example, ambulances and fire trucks must rush to the mischance scene. There emerges a situation where a portion of the crisis vehicles may cause another car crash. Therefore it becomes still more difficult for emergency vehicle to reach the destination within a predicted time. To avoid that kind of problem we have come out with an effective idea which can reduce the potential in the traffic system. The traffic system is been modified using a wireless technology and high speed micro controller to provide smooth and clear flow of traffic for ambulance to reach the destination on time. This is achieved by using RFID Tag at the ambulance and RFID Reader at the traffic system i.e., traffic signal. This mainly deals with identifying the emergency vehicle and providing a green signal to traffic signal at time of traffic jam. — By assigning priorities to various traffic movements, we can control the traffic jam. In some moments like ambulance emergency, high delegates arrive people facing lot of trouble. To overcome this problem in this paper we propose a time priority based traffic system achieved by using RFID transmitter at the emergency vehicle and RFID receiver at the traffic system i.e., traffic signal. The signal from the emergency vehicle is sent to traffic system which after detecting it sends it to microcontroller which controls the traffic signal. If any emergency vehicle is detected the system goes to emergency system mode where signal switch to green and if it is not detected normal system mode.


Introduction
It is difficult to handle traffic congestion and maintain roads during traffic mainly in India. As the people migrate from rural to urban and sub-urban areas, it becomes still more critical. Now Roadways is one of the most important transportation. When a traffic accident occurs, emergency vehicles such as ambulances and fire trucks must hurry to the accident scene. There arises a case where some of the emergency vehicles may cause another traffic accident. Therefore it becomes still more difficult for emergency vehicle to reach the destination within a predicted time. To avoid that kind of problem we have come out with an effective idea which can reduce the potential in the traffic system. The traffic system is been modified using a wireless technology and high speed micro controller to provide smooth and clear flow of traffic for ambulance to reach the destination on time. This is achieved by using RFID Tag[7] at the ambulance and RFID Reader at the traffic system i.e., traffic signal. This mainly deals with identifying the emergency vehicle and providing a green signal to traffic signal at time of traffic jam.

Related works
In a four way traffic signal system working under normal conditions, if any emergency vehicle equipped with RFID tag comes to an halt due to traffic signalling.[8] The RFID transmitter placed at an arbitrary distance away from the traffic signal captures the presence of an RFID receiver and signals an interrupt to PIC microcontroller which monitors the overall signalling. When this interrupt is received by the microcontroller, the microcontroller suspends the normal cycle of the signalling and gives priority to the way in which ambulance needs emergency service. [4] When the emergency vehicle crosses the 4-way junction, it is indicated by the RFID tag at the incoming of the junction and an interrupt is sent to the PIC microcontroller which acknowledges the exit of the emergency vehicle and thereby resumes the signalling operation which was pushed to the stack on detection of emergency vehicle. Multiple emergency vehicle is handled using First In First Out(FIFO)algorithm [1] and this vehicle is paired with the RFID transmitter is given first priority. RFID tags used here are closed source, emitting frequencies and it cannot be accessed by any unauthorized users.

Existing System
Proposal on 2-way implementations using RF Transmitter and RF Receiver.PIC16F877A Microcontroller/ HT12E Encoder / HT12D Decoder/7-segment display(timer)/LEDs .Best suited for 2-way implementation This system uses human for pressing the button to indicate the ambulance arrival in a signal. Security can be compromised if the frequency is known.This work is not suited in 4 roads or 3 roads junction. [1] If more than one ambulance arrives at the junction from different sides then first priority can be given to the ambulance which is present in the road with lesser congestion and so on. Input/output ports PIC16F877 has 5 basic input/output ports. They are usually denoted by PORT A (R A), PORT B (RB), PORT C (RC), PORT D (RD), and PORT E (RE). These ports are used for input/ output interfacing. In this controller, "PORT A" is only 6 bits wide (RA-0 to RA-7), "PORT B" , "PORT C","PORT D" are only 8 bits wide (RB-0 to RB-7,RC-0 to RC-7,RD-0 to RD-7), "PORT E" has only 3 bit wide (RE-0 to RE-7) shown in Table No   All these ports are bi-directional. The direction of the port is controlled by using TRIS(X) registers (TRIS A used to set the direction of PORT-A, TRIS B used to set the direction for PORT-B, etc.). Setting a TRIS(X) bit '1' will set the corresponding PORT(X) bit as input. Clearing a TRIS(X) bit '0' will set the corresponding PORT(X) bit as output.

Proposed System
To give way for ambulance by automating things at the earliest possible time Can handle multiple ambulances arriving at the same time in different direction and can evade congestion problems MPLAB/ PIC16F877A Microcontroller/RFID tags/7-segment display. It doesn't require human intervention. Provides security as the RFID tags have unique id.Use of automation in real time traffic system.

MPLAB X IDE
MPLAB:Microchip Technology developed this MPLAB which is a public domain software and it is mainly used for embedded applications which is carried out in a PIC and Ds PIC Microcontrollers and the Net Beans platform is used in this for implementations. [6]8, 16, 32bit PICMC is use for programming, debugging and code editing and is it supported by this MPLAB. MPLAB ICD3, REAL ICE devices are capable to this and this MPLAB is designed to work with such devices for coding and debugging PIC MC by using PC.MPLAB supports PIC Kit Programmers.

RFID READER
RFID uses electromagnetic fields that diagnose, track tags attached to objects and these tags contain electronically information that is reserved.Tages are of two types (1) active and (2) passive tags. The energy obtained from an n RFID reader's interrogating radio waves are said to be passive tags. These active tags have a power source (such as a battery) which is local and it will operate several meters from the RFID reader. Similar to barcode,[9] the tag does not to be within the line of sight and so it has to be embedded in the tracked object. RFID is an Automatic Identification and Data Capture(AIDC). These tags are attached to cloth,cash and other things. It results in standard privacy and security issues. These ISO/IEC 18000,ISO/IEC 29167 use on-chip cryptography methods for reader authentication and privacy. ISO/IEC 20248 provides and digital signature data structure to RFID incase ofauthentication and privacy. This method identifies objects, collect data about it and pass the data directly into computer systems without any human intervention. Radio waves are used by RFID. This RFID has following components: an RFID tag,[11] an RFID reader, and an antenna. Ithas an integrated antenna and it transmits data to reader and it changesthese radio waves to a best benefit data. Informations gathered from the tags are then transferred through an interface to system and it is a place where the data is stored in a cloud or database and analysed for further future. RFID uses electromagnetic fields that diagnose , track tags attached to objects and this tags contain electronic information that is reserved.
[12] Tags are of two types (1) active and (2)passive tags. The energy obtained from an n RFID reader's interrogating radio waves are said to be passive tags. These active tags have a power source (such as a battery) which is local and it will operate several meters from the RFID reader. Similar to barcode, the tag does not to be within the line of sight and so it has to be embedded in the tracked object. RFID is an Automatic Identification and Data Capture (AIDC). These tags are attached to cloth, cash and other things. It results in standard privacy and security issues .These ISO/IEC 18000, ISO/IEC 29167 use on-chip cryptography methods for reader authentication and privacy. ISO/IEC 20248 provides and digital signature data structure to RFID incase of authentication and privacy. This method identifies objects, collect data about it and pass the data directly into computer systems without any human intervention.
[13] Radio waves are used by RFID. This RFID has following components: an RFID tag, an RFID reader, and an antenna. It has an integrated antenna and it transmits data to reader and it changesthese radio waves to a best benefit data. Information gathered from the tags is then transferred through an interface to system and it is a place where the data is stored in a cloud or database and analysed for further future.

PIC16F877A microcontroller
PIC can also be said as -Pick‖, is one of the members in microcontroller built by Microchip Technology. The name PIC is pointed to Peripheral interface Controller and been widely used for embedded system. Premier model of the PIC had read-only memory (ROM) or EPROM for program storage and the latest model allow the PIC volatile memory for program storage and the upcoming model allow to reprogram itself. Memory of program and data are separated. Data memory is of different size 8, 16 and 32 bit wide. Program instruction turn in bit count by PIC family, [14] and it of different size 12, 14, 16 or 24 bit long. The instruction set also varies with each model and more powerful chips on by adding SMD, 8pin DIP to 144Pin SMD chips along with discrete I/O pins, Analog to Digital converter modules and vice versa, UART communications ports, I2C, CAN, and USB. They use MPLAB X to code the program for PIC microcontroller and the language used for the PIC microcontroller is embedded C/C++. PIC kit series and MPLAB been used for programming and debugging.PIC is widely used for many day to day purpose they vary for cost and they are robust.

5.Conclusion
This model addresses the issues faced by the current system and by introducing automation to promote traffic flow in emergency situations many deteriorating lives can saved. By implementing this cost effective model on the existing system with little alterations, precious time can be saved. This model has zero downtime and complies with existing technologies implemented worldwide. The hardware used in the model is emission free environment friendly and the frequencies emitted are in the permissible zones as prescribed by the standards. In recent years, a dozen of people had lost their lives especially those injured in road accidents while they are on the way to hospital. Due to traffic jam ambulance get stuck and major patient died on the way as they could not reach hospital. To overcome this, ' Sanjeevini 108' ambulance service started by the centre to provide immediate help to patients in emergency. World Health Organization (WHO) framed Golden Hour and this is followed overall the world. This theory states that when a heart patient is rushed to a hospital within an hour, chances of survival would increase by 70%-80%. In last six months, 1200 persons of the district have been brought to hospitals in 'Sanjeevini 108' ambulances and 12 people have died due to ambulance stucked in traffic. . However because of traffic jams and people not bothering to give way to Ambulances, many such patients also have lost their lives before reaching a hospital. The roads usually have traffic jams in Bilaspur, where ambulances get stuck include the stretch from Nehru square to Guru Nanak square, Tarbahar square to Satyam square, from Agrasen square to old bus stand square, from Shiv talkies square to Gandhi square and from Mangla square to Nehru square. In recent survey, driver of a ' Sanjeevini 108' ambulance stated that if an ambulance gets a free lane it could cover the distance of 25 km within 15 to 20 minutes but at same time due to traffic it generally takes more than a hour. Sanjeeevini has saved lives of 9594 patients . Therefore if the city traffic is streamlined and people become a little more aware about traffic and lane sense, it would reduce deaths due to delay in a patient reaching a hospital by as much as 95 per cent.

PICKIT 3 PROGRAMMER/DEBUGGER DEFINED
The PICkit 3 programmer/debugger (see Figure 1-1) is a simple, low-cost in-circuit debugger that is controlled by a PC running MPLAB IDE (v8.20 or greater) software on a Windows® platform. The PICkit 3 programmer/debugger is an integral part of the development engineer's toolsuite. The application usage can vary from software development to hardware integration. The PICkit 3 programmer/debugger is a debugger system used for hardware and software development of Microchip PIC® microcontrollers (MCUs) and dsPIC® Digital Signal Controllers (DSCs) that are based on In-Circuit Serial Programming™ (ICSP™) and Enhanced In-Circuit Serial Programming 2-wire serial interfaces. In addition to debugger functions, the PICkit 3 programmer/debugger system also may be used as a development programmer. The debugger system executes code like an actual device because it uses a device with built-in emulation circuitry, instead of a special debugger chip, for emulation. All available features of a given device are accessible interactively, and can be set and modified by the MPLAB IDE interface. The DEBUGGING There are two steps to using the PICkit 3 programmer/debugger system as a debugger. The first requires that an application be programmed into the target device (usually with the PICkit 3 itself). The second uses the internal in-circuit debug hardware of the target Flash device to run and test the application program. These two steps are directly related to the MPLAB IDE operations: 1. Program the code into the target and activate special debug functions (see the next section for details).
2. Use the debugger to set breakpoints and run. If the target device cannot be programmed correctly, the PICkit 3 programmer/debugger will not be able to debug.

PROGRAMMING
Use the PICkit 3 programmer/debugger as a programmer to program an actual (non -ICE/-ICD) device, i.e., a device not on a header board. Select "PICkit 3" from Programmer>Select Programmer and compile/assemble your application code with the "Build Configuration" list box on the MPLAB IDE toolbar set to "Release". Also, it may be set by selecting Project>Build Configuration>Release. All debug features are turned off or removed when the debugger is used as a programmer. When using the Programmer>Program selection to program a device, MPLAB IDE will disable the in-circuit debug registers so the PICkit 3 programmer/debugger will program only the target application code and the Configuration bits (and EEPROM data, if available and selected) into the target device. The debug executive will not be loaded. As a programmer, the debugger can only toggle the MCLR line to reset and start the target. A breakpoint cannot be set, and register contents cannot be seen or altered. The PICkit 3 programmer/debugger system programs the target using ICSP. VPP, PGC and PGD lines should be connected as described previously. No clock is required while programming, and all modes of the processor can be programmed, including code protection, Watchdog Timer and table read protection.

SETTING UP MPLAB IDE
Once the hardware is connected and powered, MPLAB IDE may be set up for use with the PICkit 3 programmer/debugger. On some devices, you must select the communications channel in the Configuration bits, e.g., PGC1/EMUC1 and PGD1/EMUD1. Make sure the pins selected here are the same ones physically connected to the device. For more on setting up a project and getting started with PICkit After the Project Wizard has created a project, the project and its associated files are visible in the Project window. Right click on any line in the project window tree to pop up a menu with additional options for adding and removing files. See MPLAB IDE documentation for more detail on using the Project window.

BUILDING THE PROJECT
After the project is created, the application needs to be built. This will create object (hex) code for the application that can be programmed into the target by the PICkit 3 programmer/debugger. To set build options, select Project>Build Options>Project. When done, choose Project>Build All to build the project. 4.6 SETTING CONFIGURATION BITS although device Configuration bits may be set in code, they also may be set in the MPLAB IDE Configuration window. Select Configure>Configuration Bits. By clicking on the text in the "Settings" column, these can be changed. Some Configuration bits of interest are: • Watchdog Timer Enable -On most devices, the Watchdog Timer is enabled initially. It is usually a good idea to disable this bit. • Comm Channel Select -For some devices, you will need to select the communications channel for the device, e.g., PGC1/EMUC1 and PGD1/EMUD1. Make sure the pins selected here are the same ones physically connected to the device. • Oscillator -Select the configuration setting that matches the target oscillator.