Project report for railway security monotorin system

44,002 views

Published on

Published in: Education, Business
2 Comments
41 Likes
Statistics
Notes
No Downloads
Views
Total views
44,002
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
2,432
Comments
2
Likes
41
Embeds 0
No embeds

No notes for slide

Project report for railway security monotorin system

  1. 1. 1 CHAPTER 1 INTRODUCTION Railway is lifeline of India and it is being the cheapest modes of transportation are preferred over all other means of transportation. When we go through the daily newspapers we come across many accidents in railroad railings. Railroad-related accidents are more dangerous than other transportation accidents in terms of severity and death rate etc. Therefore more efforts are necessary for improving safety. Collisions with train are generally catastrophic, in that the destructive forces of a train usually no match for any other type of vehicle. Train collisions form a major catastrophe, as they cause severe damage to life and property. Train collisions occur frequently eluding all the latest technology. 1.1 PROJECT BACKGROUND Railway safety is a crucial aspect of rail operation the world over. Malfunctions resulting in accidents usually get wide media coverage even when the railway is not at fault and give to rail transport, among the uninformed public, an undeserved image of inefficiency often fueling calls for immediate Fig1.1: Causalities in Train Accidents during 1995-96 to 2006-07
  2. 2. 2 reforms. This paper is aimed at helping the railway administrations concerned to strengthen their safety culture and develop the monitoring tools required by modern safety management. Railroad intersections are very unique, special, potentially dangerous and yet unavoidable in the World. Here two different entities with entirely different responsibilities, domains, performances come together and converge for a single cause of providing a facility to the road user. During the normal operation also, there is every possibility of accidents occurring even with very little negligence in procedure and the result is of very high risk. The potential for accidents is made higher as the railways control only half the problem. The other half, meanwhile, cannot really be said to be controlled by one entity, as even though traffic rules and road design standards supposedly exist, the movements of road users are not organized and monitored by one specific entity as rigidly as rail movements. The railway systems of Asia and the Pacific are no exception to this. Each year, accidents at level crossings not only cause fatalities or serious injuries to many thousands of road users and railway passengers, but also impose a heavy financial burden in terms of disruptions of railway and road services and damages to railway and road vehicles and property. A very high number of these collisions are caused by the negligence, incompetence or incapacity of road vehicle drivers, who by and large operate their vehicles in environments in which safety consciousness is practically non-existent. Since it is the railway which must bear the responsibility for ensuring that it is protected from the transgressions by road users (despite the fact that in many countries the law gives it priority of passage over road users), it is the railway which also has to shoulder most of the financial burden of providing this protection. Similarly, it is the railway, which has most of the responsibility for educating road users on the safe use of its level crossings. Notwithstanding this, it appears that in many regions, railways
  3. 3. 3 are ill-equipped to be in a position to monitor level crossing safety effectively and to take both corrective and pro-active measures to improve the safety of their level crossing installations. In the rapidly flourishing country like ours, even though all the latest technologies are there train collisions are occurring frequently. The railway accidents are happening due to the carelessness in manual operations or lack of workers. The other main reasons for the collisions of Train are: 1.Train Derailment in curves and bends,2.Running Train collisions with the Standing Train,3.Train Accidents in Slopes,4.Mis- signaling due to fog or Mist. There is no fruitful steps have been taken so far in these areas. This paper deals about one of the efficient methods to avoid train Collision and derailment. Also by using simple electronic components we tried to automate the control of railway gate in an embedded platform. The system has been implemented and demonstrated by using vibration sensor and ZigBee with the help of microcontroller. 1.2 SCOPE: To • Review the present status of level-crossing accidents and train collisions. • Present statistics, indicators, technology and problems relating to the systems adopted for railway protection; in practice • Analyze various alternative systems for train collision avoidance; and • Make recommendations pertaining to the selection of cost-effective protection systems. 1.3 METHODOLOGY: The following analyses are considered:
  4. 4. 4 • Evaluation of the requirements of a Safety Management Information System which adequately addresses the needs of railway management for information on train collision avoidance performance; • Review of the essential and effective safety, enhancements, measures and priorities for railway security. • Assessment of level crossing safety performance and safety measures • Examination of Cost Benefit Analysis of investments on level crossing safety enhancement; • Review of the technical attributes and suitability of Networked Anti Collision System (ACD) for level crossing protection system; • 6. Recommendations and guidelines for adoption of networked ACD Systems by railways. 1.4 ORGANISATION OF THE REPORT In the following chapter we are going to discuss more about the literature review in chapter 2, the proposed system in chapter 3, results, discussion and conclusion of the system in chapter 4. At the end of the report the list of references and related appendices are attached. We start with the literature review about the railway security monitoring system and the existing system. Then we discuss about the flow of the project and the important components of the project development in chapter 3.Finally we made the conclusion and future recommendations in chapter 4, follwed by the references and appendices.
  5. 5. 5 CHAPTER 2 LITERATURE REVIEW 2.1 EXISTING SYSTEM The existing conventional signaling system most of the times relay on the oral communication through telephonic and telegraphic conversations as input for the decision making in track allocation for trains. There is large scope for miscommunication of the information or communication gap due to the higher human interference in the system. This miscommunication may lead to wrong allocation of the track for trains, which ultimately leads to the train collision. The statistics in the developing countries showing that 80% of worst collisions occurred so far is due to either human error or incorrect decision making through miscommunication in signaling and its implementation. IR sensors are also used to identify the cracks in the railway. IR sensors have limitations due to the geographic nature of the tracks. The Anti collision device system also is found to be ineffective as it is not considering any active inputs from existing Railway signaling system, and also lacks two ways communication capability between the trains and the control centers or stations. Later geographical sensors have also been used which makes use of satellites for communication. But the system is costly and complicated to implement. At present laser proximity detector is used for collision avoidance, IR sensors identifies the cracks in the railway track and gate control is done by manual switch controlled gate. But there is no combined solution for collision between trains, train derailment in curves and bends and the automatic control of railway gate.
  6. 6. 6 2.2 PROPOSED SYSTEM RAILWAY SECURITY MONITORING SYSTEM USING VIBRATION SENSOR AND ZIGBEE The proposed Train Anti Collision and Level Crossing Protection System consists of a self-acting microcontroller and two way ZigBee based data communication system which works round-the-clock to avert train collisions and accidents at the level crosses. Thus enhances safety in train operations by providing a NON-SIGNAL additional safety overlay over the existing signaling system. The system operates without replacing any of the existing signaling and nowhere affects the vital functioning of the present safety systems deployed for train operations. The proposed system gets data from the vibration sensor. The efficiency of the system is expected to be considerably increased as the proposed system takes inputs from the sensor and also from the level crossing gates. As more relevant data are included, it is expected that the present system may assist loco drivers in averting accidents efficiently. As no change is necessary to be made to the infrastructure of the existing system, the cost of implementation of this system is also less. The system has been designed and simulated using proteus real time simulation software. 2.3 GENERAL FEATURES • Railway security and monitoring system mainly focus (i) Train collision avoidance (ii) Derailment in curves and bends (iii) Railway gate control • This system uses PIC 16F877A microcontroller, PIC 16F73 microcontroller, mini sense 100(v) vibration sensor, zig-bee transceiver, and servo motor. • PIC 16F877A is an 8 bit microcontroller with 10 channel ADC.
  7. 7. 7 • The vibration sensor is used to sense the vibration of the train. • Servo motor is used for the gate control. • Zig-Bee transceiver provides the communication between the base station and the train side. • Lithium ion battery is used for giving power to the components. • Regulator IC (LM 7805) used for providing constant 5v supply • Transistor Tip 122 is used for switching applications. 2.4 BLOCK DIAGRAM In our project the entire system can be classified into two systems. The first system can be placed in the base station side and the second system can be placed in the train side. • The system in the base station consists, Micro controller (PIC 16f877a), Vibration sensor, Servo motor, zig-bee transceiver and necessary power supply conditions. • The system in the train side consists, Micro controller (PIC 16f73), zig-bee transceiver, Brake control system and necessary power supply conditions. The fundamental block diagram of base station side and train side are shown below
  8. 8. 8 FUNDAMENTAL BLOCK DIAGRAM OF BASE STATION SIDE Figure 2.1: Block diagram of base station side FUNDAMENTAL BLOCK DIAGRAM OF TRAIN SIDE Figure 2.2: Block diagram of train side PIC MICRO CONTROLLER (PIC 16F877A) ZIGBEE TRANSCEIVER POWER SUPPLY (+5V) VIBRATION SENSOR SERVO MOTOR PIC MICRO CONTROLLER (PIC 16F73) BRAKE CONTROL ZIGBEE TRANSCEIVER POWER SUPPLY (+5V)
  9. 9. 9 2.4.1 Block diagram description The sensors sense the input and sends to the microcontroller, where it responds and gives command to the particular component with predefined algorithm. The time parameters are crucial which can be easily changed and modified using Micro-controllers. Thus, this device would work in coherence would help to reduce the train collisions 2.4.2 Block diagram components PIC microcontroller • The microcontroller employed in our project is PIC 16F877A and PIC 16f73. • The microcontroller is used for entire control. Vibration sensor • Sense the vibration of the train. According to the vibration it determines the train is arriving or departure. • It works based on piezoelectric effect. That means it converts mechanical vibration of train into electric pulses. • The vibration sensor used in our project is mini sense 100 vertical. Zig-Bee transceiver • Zig-Bee devices are often used in mesh network form to transmit data over longer distances, passing data through intermediate devices to reach more distant ones. • Zig-Bee is a specification for a suite of high level communication protocols • The IEEE specification of Zig-Bee is IEEE 802.15.4.
  10. 10. 10 Servo motor • It is the modified form of DC motor • It consist DC motor, potentiometer, gearing system. • The servo motor works based on PWM switching • The main advantage of servo motor is precise control of angular position.
  11. 11. 11 CHAPTER 3 RAILWAY SECURITY SYSTEM 3.1 HARDWARE DESCRIPTION 3.1.1VIBRATION SENSOR It uses piezoelectric effect to detect the vibrations in the rails due to the arrival or departure of train and the direction of vibration indicate the arrival or departure. This could sense the train’s position at roughly at 800 to 900 m away. This input is fed to the microcontroller. This could help in avoiding accidents between trains in slopes because the arrival of one train found out using vibration sensor can be immediately sent to the Control Room and the power supply can be switched off within 3 minutes so trains could be stopped without colliding each other. Vibration or shock sensors are commonly used in alarm systems to activate an alarm whenever the devices to which they are attached are touched, moved, or otherwise vibrated. Commercial vibration sensors use a piezoelectric ceramic strain transducer attached to a metallic proof mass in order to respond to an externally imposed acceleration. Piezoelectric vibration sensors used for detecting vibration from various vibration sources are generally classified into two large types, resonant type and no resonant type. Vibration sensors are several types. Before selecting the vibration sensor must consider five factors. 1)It’s measuring range, 2)frequency range, 3)accuracy,4) transverse sensitivity and 5)ambient conditions. The most commonly used vibration sensor is minisense 100
  12. 12. 12 MINISENSE 100 The Minisense 100 is a low-cost cantilever-type vibration sensor loaded by a mass to offer high sensitivity at low frequencies. The pins are designed for easy installation and are solderable. Horizontal and vertical mounting options are offered as well as a reduced height version. The active sensor area is shielded for improved RFI/EMI rejection. Rugged, flexible PVDF sensing element withstands high shock overload. Sensor has excellent linearity and dynamic range, and may be used for detecting either continuous vibration or impacts. The mass may be modified to obtain alternative frequency response and sensitivity selection. It can be classified into two 1)minisense 100 vertical,2)minisense 100 horizontal .The vibration sensor used here is minisense 100 vertical Circuit diagram Figure 3.1:a)circuit diagram of vibration sensor b)minisense 100 vertical MINISENSE 100 VERTICAL Functional description The MiniSense 100 acts as a cantilever-beam accelerometer. When the beam is mounted horizontally, acceleration in the vertical plane creates bending 10MPIEZO GNDa) b)
  13. 13. 13 in the beam, due to the inertia of the mass at the tip of the beam. Strain in the beam creates a piezoelectric response, which may be detected as a charge or voltage output across the electrodes of the sensor. The sensor may be used to detect either continuous or impulsive vibration or impacts. For excitation frequencies below the resonant frequency of the sensor, the device produces a linear output governed by the "baseline" sensitivity. The sensitivity at resonance is significantly higher. Impacts containing high-frequency components will excite the resonance frequency, as shown in the plot above (response of MiniSense 100 to a single half-sine impulse at 100 Hz, of amplitude 0.9 g). The ability of the sensor to detect low frequency motion is strongly influenced by the external electrical circuit. Electrical description The MiniSense 100 behaves electrically as an “active” capacitor: it may be modeled as a perfect voltage source (voltage proportional to applied acceleration) in series with the quoted device capacitance. Any external input or load resistance will form a high-pass filter, with a roll-off frequency as tabulated above, or calculated from the formula f(c) = 1/(2_RC). The impedance of the sensor is approximately 650 M ohm at 1 Hz. The active sensor element is electrically shielded, although care should be taken in the PCB design to keep unshielded traces as short as possible. External R ( ) LLF (Hz) Desired LLF (Hz) Required R ( ) 10M 65 10 65M 100M 6.5 1 650M 1G 0.65 0.1 6.5G Table 3.1: Lower limiting frequency (-3 dB roll-off)
  14. 14. 14 Off-axis sensitivity The sensitivity of the Minisense 100 follows a cosine law, when rotated horizontally around its axis, or vertically around its mid-point. At 90 degrees rotation in either plane, both baseline sensitivity and sensitivity at resonance are at a minimum. In theory, sensitivity should be zero in this condition. It is likely that some sensitivity around the resonance frequency will still be observed – but this may be unpredictable and is likely to be at least -16 dB with reference to the on-axis response. Note that the sensitivity at 30 degrees rotation is -1.25 dB (87% of on-axis response), at 60 degrees, it falls to -6 dB (50%). The plots below show the change in sensitivity observed for either: 1) Rotation about major axis of sensing element, or 2) Rotation about mid-point of sensing element. 3.1.2 ZIGBEE The name ZigBee refers to the waggle dance of honey bees after their return to the beehive. It symbolizes the communication between nodes in a mesh network. So it is called as networking protocol. The network components are analogous to queen bee, drones and worker bees. It is also the technological Standard Created for Control and Sensor Networks based on the IEEE 802.15.4 Standard created by the ZigBee Alliance. Off axis response Rotation angle Figure 3.2: off axis response of vibration sensor
  15. 15. 15 ZigBee is a specification for a suite of high level communication protocols using small, low-power digital radios based on an IEEE 802 standard for personal area networks. In the IEEE 802.15.4 standard the 802 refers to the network operations and technologies,15 refers to wireless networking and 4 refers to the low data rate or low power consumption. Overview It is used in embedded application for low data rates, low power consumption and long battery life. ZigBee lets battery powered devices can sleep for hours or even days, reducing battery use. The duty cycle of battery powered nodes within a ZigBee network is designed to be very low, offering even more energy efficiency and greater battery life. Once associated with a network, a ZigBee node can wake up and communicate with other ZigBee devices and return to sleep. It is the inexpensive small packet networks used for Home Entertainment and for Controlling Wireless sensor networks. It is having the physical range of about 10-100 meters and data rate of 250kbits/sec. So it is best suited for periodic or intermittent data or a single signal transmission from a sensor or input device. Applications include wireless light switches, electrical meters with in-home-displays, traffic management systems, and other consumer and industrial equipment that requires short-range wireless transfer of data at relatively low rates. The technology defined by the ZigBee specification is intended to be simpler and less expensive than other WPANs, such as Bluetooth or Wi-Fi. ZigBee devices are often used in mesh network form to transmit data over longer distances, passing data through intermediate devices to reach more distant ones. This allows ZigBee networks to be formed ad-hoc, with no
  16. 16. 16 centralized control or high-power transmitter/receiver able to reach all of the devices. Any ZigBee device can be tasked with running the network. The ZigBee network layer natively supports both star and tree typical networks, and generic mesh networks. Every network must have one coordinator device, tasked with its creation, the control of its parameters and basic maintenance. Within star networks, the coordinator must be the central node. Both trees and meshes allow the use of ZigBee routers to extend communication at the network level. The mesh network is having high reliability and extensive range. ZigBee Operates in the Unlicensed ISM bands.ISM 2.4 GHz is Global Band at 250kbps, 868 MHz is European Band at 20kbps and 915 MHz is North American Band at 40kbps. It mainly operates in Personal Area Networks and device-to-device networks. Here the connectivity is in between small packet devices. It is used for the control of lights, switches, thermostats, appliances etc. The Low duty cycle of ZigBee provide long battery life and Support for multiple network topologies like star and mesh up to 65000 nodes on a network. The 128-bit encryption standard provides secure connection. Collision can also be avoided by using ZigBee. History ZigBee-style networks began to be conceived around 1998, when many installers realized that both Wi-Fi and Bluetooth were going to be unsuitable for many applications. In particular, many engineers saw a need for self- organizing ad-hoc digital radio networks.
  17. 17. 17 The IEEE 802.15.4-2003 standard was completed in May 2003 and has been superseded by the publication of IEEE 802.15.4-2006. In the summer of 2003, Philips Semiconductors, a major mesh network supporter, ceased the investment. The ZigBee specifications were ratified on 14 December 2004. The ZigBee Alliance announced availability of Specification 1.0 on 13 June 2005, known as ZigBee 2004 Specification. In September 2006, ZigBee 2006 Specification is announced. In 2007, ZigBee PRO, the enhanced ZigBee specification was finalized. The first stack release is now called ZigBee 2004. The second stack release is called ZigBee 2006, and mainly replaces the structure used in 2004 with a "cluster library". The 2004 stack is now more or less obsolete. ZigBee 2007, now the current stack release, contains two stack profiles, stack profile 1 (simply called ZigBee), for home and light commercial use, and stack profile 2 (called ZigBee PRO). ZigBee PRO offers more features, such as multi-casting, many-to-one routing and high security with Symmetric-Key Key Exchange (SKKE), while ZigBee (stack profile 1) offers a smaller footprint in RAM and flash. Both offer full mesh networking and work with all ZigBee application profiles. ZigBee 2007 is fully backward compatible with ZigBee 2006 devices: A ZigBee 2007 device may join and operate on a ZigBee 2006 network and vice versa. Due to differences in routing options, ZigBee PRO devices must become non-routing ZigBee End-Devices (ZEDs) on a ZigBee 2006 network, the same as for ZigBee 2006 devices on a ZigBee 2007 network must become ZEDs on a ZigBee PRO network. The applications running on those devices work the same, regardless of the stack profile beneath them. The ZigBee 1.0 specification was ratified on 14 December 2004 and is available to members of the ZigBee
  18. 18. 18 Alliance. Most recently, the ZigBee 2007 specification was posted on 30 October 2007. The first ZigBee Application Profile, Home Automation, was announced 2 November 2007. ZIGBEE DEVICE TYPES ZigBee Co-coordinator (ZC): The most capable device, the Co-coordinator forms the root of the network tree and might bridge to other networks. There is exactly one ZigBee Co-coordinator in each network since it is the device that started the network originally (the ZigBee Light Link specification also allows operation without a ZigBee Co-coordinator, making it more usable for over-the- shelf home products). It stores information about the network, including acting as the Trust Center & repository for security keys. ZigBee Router (ZR): As well as running an application function, a Router can act as an intermediate router, passing on data from other devices ZigBee End Device (ZED): Contains just enough functionality to talk to the parent node (either the coordinator or a Router); it cannot relay data from other devices. This relationship allows the node to be asleep a significant amount of the time thereby giving long battery life. A ZED requires the least amount of memory, and therefore can be less expensive to manufacture than a ZR or ZC ZIGBEE ARCHITECHTURE The architecture of Zigbee is closely related with OSI model. ZigBee builds upon the physical layer and medium access control defined in IEEE standard 802.15.4 (2003 version) for low-rate WPANs.
  19. 19. 19 Figure 3.4: zigbee architecture The specification goes on to complete the standard by adding four main components: network layer, application layer, ZigBee device objects (ZDOs) and manufacturer-defined application objects which allow for customization and favor total integration Security services Application Objects ZigBee service object Application support sub layer NETWORK LAYER PHYSICAL LAYERS MEDIUM ACCESS CONTROL
  20. 20. 20 Besides adding two high-level network layers to the underlying structure, the most significant improvement is the introduction of ZDOs. These are responsible for a number of tasks, which include keeping of device roles, management of requests to join a network, device discovery and security. ZigBee is not intended to support power line networking but to interface with it at least for smart metering and smart appliance purposes. Because ZigBee nodes can go from sleep to active mode in 30 ms or less, the latency can be low and devices can be responsive, particularly compared to Bluetooth wake-up delays, which are typically around three seconds. Because ZigBee nodes can sleep most of the time, average power consumption can be low, resulting in long battery. Physical layer: It contains electrical and physical specifications. MAC layer: The channel access is primarily through CSMA/CA. It takes care of transmitting data, scanning channels and encryption of data. Network layer: Take care of network setup, device configuration, routing and providing security. Application layer: It is mainly used for end user software applications. Advantages • Power saving: As a result of the short working period, low power consumption of communication, and standby mode • Reliability: Collision avoidance is adopted, with a special time slot allocated for those communications that need fixed bandwidth so that competition and conflict are avoided when transmitting data. The MAC
  21. 21. 21 layer adopts completely confirmed data transmission, that is, every data packet sent must wait for the confirmation from the receiver • Low cost of the modules: The ZigBee protocol is patent fee free • Short time delay: Typically 30 ms for device searching, 15 ms for standby to activation, and 15 ms for channel access of active devices • Large network capacity: One ZigBee network contains one master device and maximum 254 slave devices. There can be as many as 100 ZigBee networks within one area • Safety: ZigBee provides a data integrity check and authentication function. AES-128 is adopted and at the same time each application can flexibly determine its safety property. • Long battery life: The battery life is high compared to any other devices. • Security: The data can be protected from any external interferences. Disadvantages • Short range • Low complexity • Low data speed. Applications • Home automation • Wireless sensor networks • Industrial control • Embedded sensing • Medical data collection
  22. 22. 22 • Smoke and intruder warning • Building automation • Smart Energy 1.0 • Telecommunication Services • Health Care • Remote Control • Light link 3.1.3 MICROCONTROLLER: Circumstances that we find ourselves in today in the field of microcontrollers had their beginnings in the development of technology of integrated circuits. This development has made it possible to store hundreds of thousands of transistors into one chip. That was a prerequisite for production of microcontrollers, and the first computers were made by adding external peripherals such as memory, input-output lines, timers and other. Further increasing of the volume of the package resulted in creation integrated circuits. These integrated circuits contained both processor and peripheral. That is how the first chip containing a microcomputer, or what would later be known as a microcontroller came about A computer-on-a-chip is a variation of a microprocessor, which combines the processor core (CPU), some memory, and I/O (input/output) lines, all on one chip. The computer-on-a-chip is called the microcomputer whose proper meaning is a computer using a (number of) microprocessor as its CPUs, while the concept of the microcomputer is known to be a microcontroller. A microcontroller can be viewed as a set of digital logic circuits integrated on a single silicon chip. This chip is used for only specific applications.
  23. 23. 23 Advantages of micro controller A designer will use a Microcontroller to 1. Gather input from various sensors 2. Process this input into a set of actions 3. Use the output mechanisms on the Microcontroller to do something useful 4. RAM and ROM are inbuilt in the MC. 5. Multi machine control is possible simultaneously. 6. ROM, EPROM, [EEPROM] or Flash memory for program and operating parameter storage. Examples: 8051, 89C51 (ATMAL), PIC (Microchip), Motorola (Motorola), ARM Processor, PIC MICROCONTROLLER Features A PIC microcontroller is an amazingly powerful fully featured processor with internal RAM, EEROM FLASH memory and peripherals. One of the smallest ones occupies the space of a 555 timer but has a 10bit ADC, 1k of memory, 2 timers; high current I/O ports a comparator a watch dog timer. PIC 16F877A The microcontroller unit used here is a PIC16f877A .The core controller is a mid-range family having a built-in SPI master. 16F877A have enough I/O lines for current need. It is capable of initiating all intersystem communications. The master controller controls each functions of the system with a supporting device. Also responsible for reception of commands from the host and taking necessary actions. PIC16F877A is an 8-bit, fully static,
  24. 24. 24 EPROM/EPROM/ROM-based CMOS microcontroller. It employs RISC architecture with only 35 word/single cycle instructions. All these instructions are single cycle (1ms) expect for program branches which takes two cycles. The PIC16f877A products are supported by a full featured macro assembler, a software simulator, „C‟ compiler etc. The PIC16F887 features 256 bytes of EEPROM data memory, self programming, an ICD, 2 Comparators, 14 channels of 10-bit Analog-to-Digital (A/D) converter, 1 capture/compare/PWM and 1 Enhanced capture/compare/PWM functions, a synchronous serial port that can be configured as either 3-wire Serial Peripheral Interface (SPI™) or the 2-wire Inter-Integrated Circuit (I²C™) bus and an Enhanced Universal Asynchronous Receiver Transmitter (EUSART). All of these features make it ideal for more advanced level A/D applications in automotive, industrial, appliances or consumer applications. Features: • High performance RISC CPU • Only 35 single word instructions to learn • All single cycle instructions except for program branches which are two cycle • Operating speed: DC - 20 MHz clock input DC - 200 ns instruction cycle • Up to 8K x 14 words of FLASH Program Memory, Up to 368 x 8 bytes of Data up to Memory (RAM) 256 x 8 bytes of EEPROM Data Memory • Pin out compatible to the PIC16C73B/74B/76/77 • Interrupt capability (up to 14 sources) • Eight level deep hardware stack • Programmable code protection
  25. 25. 25 • Power saving SLEEP mode • Selectable oscillator options • Low power, high speed CMOS FLASH/EEPROM technology • Fully static design • In-Circuit Serial Programming (ICSP) via two pins • Single 5V In-Circuit Serial Programming capability • In-Circuit Debugging via two pins • Processor read/write access to program memory • Wide operating voltage range: 2.0V to 5.5V • High Sink/Source Current: 25 mA • Commercial, Industrial and Extended temperature ranges • Low-power consumption: - < 0.6 mA typical @ 3V, 4 MHz - 20 µA typical @ 3V, 32 kHz - < 1 µA typical standby current Peripheral features: • Timer0: 8-bit timer/counter with 8-bit prescaler • Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via external crystal/clock • Timer2: 8-bit timer/counter with 8-bit period register, prescaler and post scalar
  26. 26. 26 • Two Capture, Compare, PWM modules - Capture is 16-bit, max. Resolution is 12.5 ns - Compare is 16-bit, max. Resolution is 200 ns - PWM max. Resolution is 10-bit • 10-bit multi-channel Analog-to-Digital converter • Synchronous Serial Port (SSP) with SPI (Master mode) and I2C(Master/Slave) • Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address detection. Analog features: • 10-bit, up to 8-channel Analog-to-Digital Converter (A/D) • Brown-out Reset (BOR) • Analog Comparator module with: -Two analog comparators - Programmable on-chip voltage reference (VREF) module -Programmable input multiplexing from device inputs and internal voltage reference - Comparator outputs are externally accessible Special microcontroller features: • 100,000 erase/write cycle Enhanced Flash program memory typical • 1,000,000 erase/write cycle Data EEPROM memory typical • Data EEPROM Retention > 40 years • Self-reprogrammable under software control • In-Circuit Serial Programming™ (ICSP™) via two pins • Single-supply 5V In-Circuit Serial Programming • Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation Programmable code protection • Power saving Sleep mode
  27. 27. • Selectable oscillator options • In-Circuit Debug (ICD) via two pins Figure 3.5: Block diagram of PIC 16F877A 27 Selectable oscillator options Circuit Debug (ICD) via two pins Figure 3.5: Block diagram of PIC 16F877A
  28. 28. 28 Hardware features There are three memory blocks in each of the PIC16F87XA devices. The program memory and data memory have separate buses so that concurrent access can occur. The Special Function Registers are registers used by the CPU and peripheral modules for controlling the desired operation of the device. These registers are implemented as static RAM. Some pins for these I/O ports are multiplexed with an alternate function for the peripheral features on the device. In general, when a peripheral is enabled, that pin may not be used as a general purpose I/O pin. The Master Synchronous Serial Port (MSSP) module is a serial interface, useful for communicating with other peripheral or microcontroller devices. These peripheral devices may be serial EEPROMs, shift registers, display drivers, A/D converters, etc. The MSSP module can operate in one of two modes. The Universal Synchronous Asynchronous Receiver Transmitter (USART) module is one of the two serial I/O modules. (USART is also known as a Serial Communications Interface or SCI.) The USART can be configured as a full-duplex asynchronous system that can communicate with peripheral devices, such as CRT terminals and personal computers, or it can be configured as a half-duplex synchronous system that can communicate with peripheral devices, such as A/D or D/A integrated circuits, serial EEPROMs, etc. The Analog-to-Digital (A/D) Converter module has five inputs for the 28-pin devices and eight for the 40/44-pin devices. The conversion of an analog input signal results in a corresponding 10-bit digital number. The A/D module has high and low-voltage reference input that is software selectable to some combination of VDD, VSS, RA2 or RA3. The A/D converter has a unique feature of being able to operate while the device is in Sleep mode. To operate in Sleep, the A/D clock must be derived from the A/D’s internal RC oscillator. The comparator module contains two analog
  29. 29. 29 comparators. The inputs to the comparators are multiplexed with I/O port pins RA0 through RA3, while the outputs are multiplexed to pins RA4 and RA5. All PIC16F87XA devices have a host of features intended to maximize system reliability, minimize cost through elimination of external components, provide power saving operating modes and offer code protection. Memory organization There are three memory blocks in each of the PIC16F87X MCUs. The Program Memory and Data Memory have separate buses so that concurrent access can occur. Program memory organization The PIC16F87X devices have a 13-bit program counter capable of addressing an 8K x 14 program memory space. The PIC16F877/876 devices have 8K x 14 words of FLASH program memory, and the PIC16F873/874 devices have 4K x 14. Accessing a location above the physically implemented address will cause a wraparound. The RESET vector is at 0000h and the interrupt vector is at 0004h. Data memory organization The data memory is partitioned into multiple banks which contain the General Purpose Registers and the Special Function Registers. Bits RP1 (STATUS<6>) and RP0 (STATUS<5>) are the bank select bits. Each bank extends up to 7Fh (128 bytes). The lower locations of each bank are reserved for the Special Function Registers. Above the Special Function Registers are General Purpose Registers, implemented as static RAM. All implemented banks contain Special Function Registers. Some frequently used Special Function
  30. 30. 30 Registers from one bank may be mirrored in another bank for code reduction and quicker access. I/O ports Some pins for these I/O ports are multiplexed with analternate function for the peripheral features on the device. In general, when a peripheral is enabled, that pin may not be used as a general purpose I/O pin. Additional information on I/O ports may be found in the PICmicro™ Mid-Range Reference Manual (DS33023). PORTA is a 6-bit wide, bidirectional port. The corresponding data direction register is TRISA. Setting a TRISA bit (= 1) will make the corresponding PORTA pin an input (i.e., put the corresponding output driver in a High-Impedance mode). Clearing a TRISA bit (= 0) will make the corresponding PORTA pin an output (i.e., put the contents of the output latch on the selected pin). All write operations are read-modify-write operations. Therefore, a write to a port implies that the port pins are read; the value is modified and then written to the port data latch. Pin RA4 is multiplexed with the Timer0 module clock input to become the RA4/T0CKI pin. The RA4/T0CKI pin is a Schmitt Trigger input and an open-drain output. PORTB is an 8-bit wide, bidirectional port. The corresponding data direction register is TRISB. Setting a TRISB bit (= 1) will make the corresponding PORTB pin an input (i.e., put the corresponding output driver in a High-Impedance mode). Clearing a TRISB bit (= 0) will make the corresponding PORTB pin an output (i.e., put the contents of the output latch on the selected pin). Three pins of PORTB are multiplexed with the In-Circuit Debugger and Low-Voltage Programming function: RB3/PGM, RB6/PGC and
  31. 31. 31 RB7/PGD. The alternate functions of these pins are described in “Special Features of the CPU”. Each of the PORTB pins has a weak internal pull-up. A single control bit can turn on all the pull-ups. This is performed by clearing bit RBPU (OPTION_REG<7>). The weak pull-up is automatically turned off when the port pin is configured as an output. The pull-ups are disabled on a Power-on Reset. PORTC is an 8-bit wide, bidirectional port. The corresponding data direction register is TRISC. Setting a TRISC bit (= 1) will make the corresponding PORTC pin an input (i.e., put the corresponding output driver in a High-Impedance mode). Clearing a TRISC bit (= 0) will make the corresponding PORTC pin an output (i.e., put the contents of the output latch on the selected pin). PORTC is multiplexed with several peripheral functions. Figure 3.6: Pin details of PIC 16F877A
  32. 32. 32 PORTC pins have Schmitt Trigger input buffers. When the I2C module is enabled, the PORTC<4:3> pins can be configured with normal I2C levels, or with SMBus levels, by using the CKE bit (SSPSTAT<6>). When enabling peripheral functions, care should be taken in defining TRIS bits for each PORTC pin. Some peripherals override the TRIS bit to make a pin an output, while other peripherals override the TRIS bit to make a pin an input. Since the TRIS bit override is in effect while the peripheral is enabled, read-modify-write instructions (BSF, BCF, XORWF) with TRISC as the destination, should be avoided. The user should refer to the corresponding peripheral section for the correct TRIS bit settings. PORTD is an 8-bit port with Schmitt Trigger input buffers. Each pin is individually configurable as an input or output. PORTD can be configured as an 8-bit wide microprocessor port (Parallel Slave Port) by setting control bit, PSPMODE (TRISE<4>). In this mode, the input buffers are TTL. PORTE has three pins (RE0/RD/AN5, RE1/WR/AN6 and RE2/CS/AN7) which are individually configurable as inputs or outputs. These pins have Schmitt Trigger input buffers. The PORTE pins become the I/O control inputs for the microprocessor port when bit PSPMODE (TRISE<4>) is set. In this mode, the user must make certain that the TRISE<2:0> bits are set and that the pins are configured as digital inputs. Also, ensure that ADCON1 is configured for digital I/O. In this mode, the input buffers are TTL. Register 4-1 shows the TRISE register which also controls the Parallel Slave Port operation. PORTE pins are multiplexed with analog inputs. When selected for analog input, these pins will read as „0‟s. TRISE controls the direction of the RE pins, even when they are being used as analog inputs. The user must make sure to keep the pins
  33. 33. 33 configured as inputs when using them as analog inputs. The system has two interconnected modules as its working elements. PIC16F73 This powerful yet easy-to-program (only 35 single word instructions) CMOS FLASH-based 8-bit microcontroller packs Microchip's powerful PIC® architecture into a 28 pin package. The PIC16F73 features operating frequency of 20MHz , 8-bit Analog-to-Digital Module, 2 capture/compare/PWM module Serial Communications using SSP, USART,11 interrupts, Synchronous Serial Port (SSP) with SPI, Master mode) and I2C (Slave), Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI), Parallel Slave Port (PSP), Programmable code protection , Selectable oscillator options, In-Circuit Serial Programming (ICSP) General Features • High performance RISC CPU • Up to 8K x 14 words of FLASH Program Memory • Up to 368 x 8 bytes of Data Memory (RAM) • Timer0: 8-bit timer/counter with 8-bit prescaler • Timer1: 16-bit timer/counter with prescaler can be incremented during SLEEP via external crystal/clock
  34. 34. 34 Figure 3.7: Block diagram of PIC16F73
  35. 35. 35 • Timer2: 8-bit timer/counter with 8-bit register, prescaler and postscaler • Two Capture, Compare, PWM modules - Capture is 16-bit, max. Resolution is 12.5 ns - Compare is 16-bit, max. Resolution is 200 ns - PWM max. Resolution is 10-bit Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation. Peripheral Features: • Timer0: 8-bit timer/counter with 8-bit prescaler • Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via external crystal/clock • Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler • Two Capture, Compare, PWM modules - Capture is 16-bit, max. Resolution is 12.5 ns - Compare is 16-bit, max. Resolution is 200 ns - PWM max. Resolution is 10-bit • 8-bit, up to 8-channel Analog-to-Digital converter • Synchronous Serial Port (SSP) with SPI (Master mode) and I2C (Slave) • Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) • Parallel Slave Port (PSP), 8-bits wide with external RD, WR and CS controls (40/44-pin only) • Brown-out detection circuitry for Brown-out Reset (BOR)
  36. 36. 36 CMOS Technology: • Low power, high speed CMOS FLASH technology • Fully static design • Wide operating voltage range: 2.0V to 5.5V • High Sink/Source Current: 25 mA • Low power consumption: - < 2 mA typical @ 5V, 4 MHz - 20 µA typical @ 3V, 32 kHz - < 1 µA typical standby current PINDETAILS The pins that are used in this system, MCLR/VPP: Master Clear (input) or programming voltage (output • MCLR: Master Clear (Reset) input. This pin is an active low RESET to the device. Figure 3.8: Block diagram of PIC16F73
  37. 37. 37 • VPP: Programming voltage input. VSS: Ground reference for logic and I/O pins. Osc1: Oscillator crystal input or external clock source input. ST buffer when configured in RC mode. Otherwise CMOS. OSC2: Oscillator crystal output. Connects to crystal or resonator in Crystal Oscillator mode RC4: Digital I/O. RC5: Digital I/O. RC6: Digital I/O. RC7: Digital I/O. VDD: Positive supply for logic and I/O pins. RB0: Digital I/O. 3.1.4 SERVOMOTOR A servomotor is a rotary actuator that allows for precise control of angular position. It consists of a motor coupled to a sensor for position feedback, through a reduction gearbox. It also requires a relatively sophisticated controller, often a dedicated module designed specifically for use with servomotors. Servomotors are used in applications such as robotics, CNC machinery or automated manufacturing. It is the modified form of DC motor. As the name suggests, a servomotor is a servomechanism. More specifically, it is a closed-loop servomechanism that uses position feedback to control its motion and final position. The input to its control is some signal, either analogue or digital, representing the position commanded for the output shaft.
  38. 38. 38 The motor is paired with some type of encoder to provide position and speed feedback. In the simplest case, only the position is measured. The measured position of the output is compared to the command position, the external input to the controller. If the output position differs from that required, an error signal is generated which then causes the motor to rotate in either direction, as needed to bring the output shaft to the appropriate position. As the positions approach, the error signal reduces to zero and the motor stops. The very simplest servomotors use position-only sensing via a potentiometer and bang-bang control of their motor; the motor always rotates at full speed (or is stopped). This type of servomotor is not widely used in industrial motion control, but they form the basis of the simple and cheap servos used for radio-controlled models. Radio Control (RC) hobby servos are small actuators designed for remotely operating model vehicles such as cars, airplanes, and boats. Nowadays, RC servos are become more popular in robotics. This is because its’ ability to rotate and maintain and certain location, position or angle according to control pulses from a single wire. Inside a typical RC servo contains a small motor and gearbox to do the work, a potentiometer to measure the position of the output gear, and an electronic circuit that controls the motor to make the output gear move to the desired position. Because all of these components are packaged into a compact, low-cost unit, RC servos are great actuators for robots. More sophisticated servomotors measure both the position and also the speed of the output shaft. They may also control the speed of their motor, rather than always running at full speed. Both of these enhancements, usually in
  39. 39. 39 combination with a PID control algorithm, allow the servomotor to be brought to its commanded position more quickly and more precisely, with less overshooting. Over view A Servo is a small device that incorporates a three wire DC motor, a gear train, a potentiometer, an integrated circuit, and an output shaft bearing. Of the three wires that stick out from the motor casing, one is for power, one is for ground, and one is a control input line. The shaft of the servo can be positioned to specific angular positions by sending a coded signal. As long as the coded signal exists on the input line, the servo will maintain the angular position of the shaft. If the coded signal changes, then the angular position of the shaft changes. Servos come in different sizes but use similar control schemes and are extremely useful in robotics. The motors are small and are extremely powerful for their size. It also draws power proportional to the mechanical load. A lightly loaded servo, therefore, doesnt consume much energy. A very common use of servos is in Radio Controlled models like cars, airplanes, robots, and puppets. They are also used in powerful heavy-duty sail boats. Servos are rated for Speed and Torque. Normally there are two servos of the same kind, one geared towards speed (sacrificing torque), and the other towards torque (sacrificing speed) Servos are constructed from three basic pieces; a motor, a potentiometer (variable resister) that is connected to the output shaft, and a control board. The potentiometer allows the control circuitry to monitor the current angle of the
  40. 40. 40 servo motor. The motor, through a series of gears, turns the output shaft and the potentiometer simultaneously. The potentiometer is fed into the servo control circuit and when the control circuit detects that the position is correct, it stops the motor. If the control circuit detects that the angle is not correct, it will turn the motor the correct direction until the angle is correct. Normally a servo is used to control an angular motion of between 0 and 180 degrees. It is not mechanically capable (unless modified) of turning any farther due to the mechanical stop build on to the main output gear. The amount of power applied to the motor is proportional to the distance it needs to travel. So, if the shaft needs to turn a large distance, the motor will run at full speed. If it needs to turn only a small amount, the motor will run at a slower speed. This is called proportional control. SERVOMOTOR VS STEPPERMOTOR Servomotors are generally used as a high performance alternative to the stepper motor. Stepper motors have some inherent ability to control position, as they have inbuilt output steps. This often allows them to be used as an open- loop position control, without any feedback encoder, as their drive signal specifies the number of steps of movement to rotate. This lack of feedback though limits their performance, as the stepper motor can only drive a load that is well within its capacity, otherwise missed steps under load may lead to positioning errors. The encoder and controller of a servomotor are an additional cost, but they optimize the performance of the overall system (for all of speed, power and accuracy) relative to the capacity of the basic motor. With larger systems,
  41. 41. 41 where a powerful motor represents an increasing proportion of the system cost, servomotors have the advantage. Many applications, such as laser cutting machines, may be offered in two ranges, the low-priced range using stepper motors and the high-performance range using servomotors. vcc Gnd Figure 3.9: servo motor Working servomechanism is used for controlling the servomotor.The servos are controlled by sending them a pulse of variable width. The control wire is used to send this pulse. The parameters for this pulse are that it has a minimum pulse, a maximum pulse, and a repetition rate. Given the rotation constraints of the servo, neutral is defined to be the position where the servo has exactly the same amount of potential rotation in the clockwise direction as it does in the counter clockwise direction. It is important to note that different servos will have different constraints on their rotation but they all have a neutral position, and that position is always around 1.5 milliseconds (ms). The angle is determined by the duration of a pulse that is applied to the control wire. This is called Pulse width Modulation. The servo expects to see a pulse every 20 ms. The length of Control signal
  42. 42. 42 the pulse will determine how far the motor turns. For example, a 1.5 ms pulse will make the motor turn to the 90 degree position (neutral position). When these servos are commanded to move they will move to the position and hold that position. If an external force pushes against the servo while the servo is holding a position, the servo will resist from moving out of that position. The maximum amount of force the servo can exert is the torque rating of the servo. Servos will not hold their position forever though; the position pulse must be repeated to instruct the servo to stay in position. When a pulse is sent to a servo that is less than about 0.6 ms the servo does not rotates to any position and holds its output shaft at zero degree. If the pulse is wider than 0.6 ms the servo rotates. For example, if pulse width is equal to 1,5 ms servo will rotate 90 degrees and for pulse width is equal or greater than 2 ms, servo will make rotation of 180 degrees. The minimal width and the maximum width of pulse that will command the servo to turn to a valid position are functions of each servo. Different brands, and even different servos of the Minimum pulse: Neutral position pulse: Maximum pulse: Pulse width 0.6 msec Pulse width 1.5 msec Pulse width 2 msec Figure 3.10: PWM switching of servo motor
  43. 43. 43 same brand, will have different maximum and minimums. Generally the minimum pulse will be about 1 ms wide and the maximum pulse will be 2 ms wide.This is PWM switching. Description: This Light Weight Servo (1.5 Kg) can be used for our project development. This comes with a standard 3 pin power, control cable. Can be used in Electric aircraft, glider etc. 3.2 TRAIN COLLISION AVOIDANCE Now a day’s people prefer to travel in Train instead of Bus, according a lot of changes the way of using our transport systems. More and more trains are aiding for the transportation systems. At the same time the probable of train to train collision increasing day by day. Train Collisions are of different types depending upon the circumstance. There so many technology updates in this connection to avoid collisions and save the people. In the present railway signalling system, train location is detected by the track circuit, and according to train location, train control signals are indicated to prevent collisions between trains. But these present technologies cannot avoid collision completely. This paper introduces a new approach addressing the problem of colliding trains. The system uses the latest communication and sensor technologies. If the system detects an imminent collision, the power supply of the train will cutoff and the train will be stop within next few seconds. And the collision can be avoided. The collision avoidance system mainly consist three components. The first main component is a short range communication system. The short range communication system used here is Zigbee. The second important component is its vibration identifying system. Accurate sensing is very important for collision avoidance system. The vibration of each train is essential information for the situation analysis. Here the vibration sensor is used
  44. 44. 44 to identify the train vibration. The PIC microcontroller 16f877a and 16f73 is used as hardware platform to monitor and control the train operation like, communication between train and station. When we are standing at the railway crossing, we can easily know the arrival of the train only by sensing the intensity of the vibrations created on the metal tracks on which train runs. Thus, the intensity of the vibrations created during passage of a train at the railroads or railways tracks can be identified by vibration sensor. Vibration Sensor that works according to the high and low intensity of the vibrations created on railway tracks whenever trains run on it. The vibration sensors are attached on the railway track. It is an intelligent system that can sense the increasing and decreasing amount of vibrations being created on railway tracks and it converts mechanical vibration into electrical signal. Then it sends the relevant signal to the attached PIC microcontroller through the analog pin and work accordingly without any other intervention. If the train comes in both the direction more than one sensor shows higher value. So the microcontroller identifies the trains come in opposite direction. Output of the microcontroller goes to the other PIC microcontroller 16f73 in the train side through the transmitter and receiver section of the zigbee. The engines of trains are equipped with microcontroller containing all the data and information about all the trains. Then the power supply of the train will cutoff and the train will be stopped within few seconds. Based on immediate response against the vibrations created, the proposed mechanism will be cost-effective, flawless and quite secure for the general public. It avoiding frequently occurring collisions. If this technology is implemented in all rail road railings, the overall collision rate can be reduced significantly and travel will become safe for everyone.
  45. 45. 45 3.3 TRAIN DERAILMENT Train derailment is mainly occurred due to the presence of crack in the railway track. The major problems that railroads have faced since the earliest days are the prevention of service failures in track. As is the case with all modes of high-speed travel, Rail is manufactured in different weights; there are different rail conditions wear, corrosion etc. present there are a significant number of potential defects possible and the task has to be performed with some speed to reliably inspect the thousands of miles of track stretching across the land failures of an essential component can have serious consequences. The main problem about a railway analysis is detection of cracks in the structure. If these deficiencies are not controlled at early stages they might cause huge economical problems affecting the rail network unexpected requisition of spare parts, handling of incident and/or accidents. Figure 3.11: General schematic of a track RAIL FISH PLATE BOLT SPIKE TIE EXPANSION SPACE NUT TIE PLATE
  46. 46. 46 If there is any crack in the railway track, the vibration of train will not get continuously by the vibration sensor. This means that the crack is present. So we have to stop the train before passing the crack. The vibration sensor values are given to the analog channels of microcontroller. The microcontroller PIC16F877A is used at the base station .The vibration sensor and ZigBee is interfaced with the microcontroller. The ZigBee transceiver transfers the information to the transceiver present at the train side. The train side a brake control system is present. When the false signal (presence of crack) reaches the train will automatically stops by releasing the brake of train. Thus the train can be stopped before the crack. There by we can avoid the derailment of trains in bends and curves. 3.4 AUTOMATIC GATE CONTROL One of the main objectives of this project is to control the unmanned rail gate automatically using embedded platform to reduce maintenance expenditure, human mistakes, and accidents. An Embedded system is a combination of computer hardware and software, and perhaps additional mechanical or other parts, designed to perform a specific function. The largest public sector in India is the Railways. The network of Indian Railways covering the length and breadth of our country is divided into nine Railway zones for operational convenience. The railway tracks crises-cross the state Highways and of course village road along their own length. The points or places where the Railway track crosses the road are called level crossings. Level crossings cannot be used simultaneously both by road traffic and trains, as this result in accidents leading to loss of precious lives.
  47. 47. 47 Today often we see news papers very often about the railway accidents happening at un- attended railway gates. This project is developed in order to help the INDIAN RAILWAYS in making its present working system a better one, by eliminating some of the loopholes existing in it. The program for this project is embedded in this Micro controller Integrated Chip and interfaced to all the peripherals. Early level crossings had a flagman in a nearby booth that would, on the approach of a train, wave a red flag or lantern to stop all traffic and clear the tracks. Manual or electrical closable gates that barricaded the roadway were later introduced. The gates were intended to be a complete barrier against intrusion of any road traffic onto the railway. In the early days of the railways much road traffic was horse drawn or included livestock. It was thus necessary to provide a real barrier. Thus, crossing gates, when closed to road traffic, crossed the entire width of the road. When opened to allow road users to cross the line, the gates were swung across the width of the railway, preventing any pedestrians or animals getting onto the line. With the appearance of motor vehicles, this barrier became less effective and the need for a barrier to livestock diminished dramatically. Many countries therefore substituted the gated crossings with weaker but more highly visible barriers and relied upon road users following the associated warning signals to stop. In many countries, level crossings on less important roads and railway lines are often "open" or "uncontrolled", sometimes with warning lights or bells to warn of approaching trains. Ungated crossings represent a safety concern; many accidents have occurred due to failure to notice or obey the warning. Level crossings in India, China, Thailand, and Malaysia are still largely manually-operated, where the barriers are lowered using a manual switch when trains approach.
  48. 48. 48 Existing System:- 1. Manual/Physical gate closing & opening. 2. Manual switch based gate closing & opening. Limitations of exiting system:- 1. Chances of human error. 2. Time consuming. 3. A lot of human resource is required. An automatic railway gate at a level crossing replacing the gates operated by the gatekeeper. It deals with two things. Firstly, it deals with the reduction of time for which the gate is being kept closed and secondly, to provide safety to the road users by reducing the accidents. By the presently existing system once the train leaves the station, the stationmaster informs the gatekeeper about the arrival of the train through the telephone. Once the gatekeeper receives the information, he closes the gate depending on the timing at which the train arrives. Hence, if the train is late due to certain reasons, then gate remain closed for a long time causing traffic near the gates. By employing the automatic railway gate control at the level crossing the arrival of the train is detected by the sensor placed near to the gate. Hence, the time for which it is closed is less compared to the manually operated gates and also reduces the human labor. This type of gates can be employed in an unmanned level crossing where the chances of accidents are higher and reliable operation is required. Since, the operation is automatic; error due to manual operation is prevented. Automatic railway gate control is highly economical microcontroller based arrangement, designed for use in almost all the unmanned level crossings in the country”. It intends to attain the following objectives: 1.To design a system that will enhance the existing railway gate control system. 2. To incorporate C-
  49. 49. 49 Programming in the design of the “Automatic Railway Gate Control and Track Switching”. 3. To show the application of automation in the miniature prototype of the “Automatic Railway Gate Control and Track Switching”. Using simple electronic components we have tried to automate the control of railway gates. For that it uses PIC micro controller PIC16F877A and PIC16F73, vibration sensor, Zig-Bee module, servo motor etc. As a train approaches the railway crossing the vibration sensor placed near the crossing will sense the vibrations and give the measured values to the base station which is controlled by the micro controller. The Zig-Bee Transceiver connected to the micro controller (PIC16F877A) will send a signal to the Zig-Bee Transceiver which is placed over the train. The train is also controlled by the micro controller PIC16F73.Then the train side PIC will send a signal to the gate which is controlled by the servo motor.
  50. 50. 50 FLOW CHART FOR RAILWAY GATE CONTROL Figure 3.12: flow chart for automatic railway gate control START CHECH ANY DATA PRESENT IF DATA RXEDFROM TRAIN GATE CLOSED YES NO
  51. 51. 51 FLOW CHART FOR STOPPING THE TRAIN Figure 3.13: flow chart for brake control of train SCAN FOR THE STATUS OF RC6 RB0=0 Train START NO START IS RC6=1 YES SET RB0=0 TO STOP TRAIN SET RB0=1 TRAIN USING MANUAL OVERRIDE
  52. 52. 52 3.5 CIRCUIT DIAGRAM 3.5.1 BASE STATION Figure 3.14: circuit diagram of base station side VCC GND TX RX ZIGBEE TRANSCEIVER
  53. 53. 53 3.5.2 TRAIN SIDE TIP122 Zigbee transceiver Vcc Gnd RX TX Figure 3.15: circuit diagram of train side
  54. 54. 54 3.6 CIRCUIT DIAGRAM DESCRIPTION 3.6.1 REGULATED POWER SUPPLY: A variable regulated power supply, also called a variable bench power supply, is one which you can continuously adjust the output voltage to your requirements. Varying the output of the power supply is recommended way to test a project after having double checked parts placement against circuit drawings and the parts placement. This type of regulation is ideal for having a simple variable bench power supply. Actually this is quite important because one of the first projects a hobbyist should undertake is the construction of a variable regulated power supply. While a dedicated supply is quite handy e.g. 5V or 12V, it’s much handier to have a variable supply on hand, especially for testing. Most digital logic circuits and processors need a 5 volt power supply. To use these parts we need to build a regulated 5 volt source. Usually you start with an unregulated power to make a 5 volt power supply; we use a LM7805 voltage regulator IC (Integrated Circuit). Figure 3.16: LM 7805 block diagram 1 2 3 LM 7805 VOUT 5V VIN V+ + C2 C1
  55. 55. 55 The LM7805 is simple to use. We can simply connect the positive lead to the unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin, connect the negative lead to the Common pin and then when you turn on the power, you get a 5 volt supply from the Output pin. Circuit features: • Brief description of operation: Gives out well regulated +5V output, output current capability of 100mA. • Circuit protection: Built-in overheating protection shuts down output when regulator IC gets too hot. • Circuit complexity: Very simple and easy to build. • Circuit performance: Very stable +5V output voltage, reliable operation • Availability of components: Easy to get, uses only very common basic components. Figure 3.17: Pin representation of LM 7805
  56. 56. 56 • Design testing: Based on datasheet example circuit, I have used this circuit successfully as part of many electronic projects. • Applications: Part of electronics devices, small laboratory power supply 3.6.2 TIP122 The TIP122 is silicon Epitaxial-Base NPN power transistors in monolithic Darlington configuration mounted in Jedec TO-220 plastic package. They are intented for use in power linear and switching applications. Here 1 represents base 2 represents collector and 3 represents emitter. The devices are manufactured in planar technology with “base island” layout and monolithic Darlington configuration. The resulting transistors show exceptional high gain performance coupled with very low saturation voltage. Figure 3.18: transistor TIP 122
  57. 57. 57 Transistor polarity NPN Continues collector current Ic max 5A Power dissipation 2w DC collector current 5v DC current gain hFE 1000 No of pins 3 Full power rating temperature 25°C Hfe min 1000 3.6.3 LITHIUM ION BATTERY Lithium-ion battery (sometimes Li-ion battery or LIB) is a member of a family of rechargeable battery types in which lithium ions move from the negative electrode to the positive electrode during discharge, and back when charging. Li-ion batteries use an intercalated lithium compound as the electrode material, compared to the metallic lithium used in the non-rechargeable lithium battery. The three primary functional components of a lithium-ion battery are the negative electrode, positive electrode, and the electrolyte. The negative electrode of a conventional lithium-ion cell is made from carbon. The positive electrode is a metal oxide, and the electrolyte is a lithium salt in an organic solvent. The electrochemical roles of the electrodes change between anode and cathode, depending on the direction of current flow through the cell. The most commercially popular negative electrode material is graphite. The positive Table 3.2: Features of TIP 122 transistor
  58. 58. 58 electrode is generally one of three materials: a layered oxide (such as lithium cobalt oxide), a polyanion (such as lithium iron phosphate), or a spinel (such as lithium manganese oxide). The electrolyte is typically a mixture of organic carbonates such as ethylene carbonate or diethyl carbonate containing complexes of lithium ions. These non-aqueous electrolytes generally use non- coordinating anion salts such as lithium hexafluorophosphate (LiPF6), lithium hexafluoroarsenate monohydrate (LiAsF6), lithium perchlorate (LiClO4), lithium tetrafluoroborate (LiBF4), and lithium triflate (LiCF3SO3). Depending on materials choices, the voltage, capacity, life, and safety of a lithium-ion battery can change dramatically. Recently, novel architectures using nanotechnology have been employed to improve performance. Pure lithium is very reactive. It reacts vigorously with water to form lithium hydroxide and hydrogen gas. Thus, a non-aqueous electrolyte is typically used, and a sealed container rigidly excludes water from the battery pack. Lithium ion batteries are more expensive than NiCd batteries but operate over a wider temperature range with higher energy densities, while being smaller and lighter. They are fragile and so need a protective circuit to limit peak voltages. Li-Ion Battery 7.4V 700mAh (1C) Very light weight and small size compared to Ni-Cd, Ni-MH and Lead acid batteries. Very long life without losing charging capacity. Weights just 80 grams. This battery includes an inbuilt charger and protection circuit which allows you to use this battery without worrying about over discharge, over charge or short circuit. For charging just connect to any 9V & max 1A power source. This battery can be use inline just like mobile phone battery, when connected to charger it can still use as circuit or robot and charge battery simultaneously.
  59. 59. 59 Features • Very Small in size and weight compared to Ni-Cd, Ni-MH and Lead Acid Batteries • Discharge Current upto 1A • Full Charge in 120 minutes depending on power source • Long life with full capacity for upto 1000 charge cycles • Inbuilt charge and discharge protection circuit • Inbuilt charge controller, no dedicated charger required, use any 9V 1A supply to charge • Can be used in inline application where battery is for backup, use while you are charging 3.6.4 CRYSTAL OSCILLATOR The 16 MHz Crystal Oscillator module is designed to handle off-chip crystals that have a frequency of 4.16 MHz. The crystal oscillator’s output is fed to the System PLL as the input reference. The oscillator design generates low frequency and phase jitter, which is recommended for USB operation. Crystal Equivalent Circuit Figure 3.19: Crystal electrical equivalent schematic R C Cc
  60. 60. 60 The crystal model is based on the following components: L: Motional Inductor C: Motional Capacitor R: Equivalent Series Resistor Cc: Shunt Capacitor Operational oscillation frequency is a function of the components in Freq = 1/[2*pi*sqrt(L*C)] The conditions for oscillation are as follows: • Amplifier Gain ≥ 1 • Total phase shift across crystal = 360 degrees The following factors influence crystal oscillation: 1. As Cc increases, Gain decreases. 2. As R increases, Gain decreases. 3. The C1 and C2 load capacitors affect the gain and phase margin Enabling the On-Chip 16 MHz Oscillator To use the on-chip 16 MHz oscillator with a crystal, you must use a high quality crystal with an ESR below 20 ohms. To enable the on-chip 16 MHz oscillator, the Clock Source Control Register (CSCR) must have the following settings: • CLKO_SEL . Set to any value other than 011 (CLK16M). • OSC_EN . To enable the on-chip 16 MHz oscillator, set to 1. • Set System_SEL . To select the 16 MHz oscillator as the clock source of the System PLL, set to 1.
  61. 61. 61 Caution When you enable the on-chip 16 MHz oscillator, make sure CLKO_SEL is not set to output CLK16M. Experiments have shown that this setting can load down the on-chip oscillator during crystal start up. After the 16 MHz oscillator starts to oscillate, however, it is all right to output CLK16M. If you are not using the CLKO signal, it is advisable to disable the CLKO pin by setting CLKO_SEL to 110 or 111. Applications • Automotive • Cable Modems • Cell Phones • Computer Peripherals • Copiers • Infotainment • PCs • Printers Figure 3.20: Crystal electrical equivalent schematic C2 C1 EXTAL
  62. 62. 62 Applications Information • Crystal Selection The DS1080L requires a parallel resonating crystal operating in the fundamental mode, with an ESR of less than 90 . The crystal should be placed very close to the device to minimize excessive loading due to parasitic capacitances. • Oscillator Input When driving the DS1080L using an external oscillator clock, consider the input (X1) to be high impedance. • Crystal Capacitor Selection The load capacitors CL1 and CL2 are selected based on the crystal specifications (from the data sheet of the crystal used). The crystal parallel load capacitance is calculated as follows: CL=[(CL1*CL2)/ (CL1+CL2)]CIN For the DS1080L use CL1 = CL2 = CLX. In this case, the equation then reduces to: CL= (CLX/2) +CIN Where CL1 = CL2 = CLX. Equation 2 is used to calculate the values of CL1 and CL2 based on values on CL and CIN noted in the data sheet electrical specifications. • Power-Supply Decoupling To achieve best results, it is highly recommended that a decoupling capacitor is used on the IC power-supply pins. Typical values of decoupling capacitors are 0.001µF and 0.1µF. Use a high-quality, ceramic, surface- mount capacitor, and
  63. 63. 63 mount it as close as possible to the VCC and GND pins of the IC to minimize lead inductance. • Layout Considerations As noted earlier, the crystal should be placed very close to the device to minimize excessive loading due to parasitic capacitances. Care should also be taken to minimize loading on pins that could be floated as a programming option (SMSEL and CMSEL). Coupling on inputs due to clocks should be minimized. 3.6.5 RELAY SWITCH A relay is an electrically operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits, repeating the signal coming in from one circuit and re-transmitting it to another. Relays were used extensively in telephone exchanges and early computers to perform logical operations A type of relay that can handle the high power required to directly control an electric motor or other loads is called a contractor. Solid-state relays control power circuits with no moving parts, instead using a semiconductor device to perform switching. Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults; in modern electric power systems these functions are performed by digital instruments still called "protective relays".
  64. 64. 3.7 OVER VIEW OF THE PROPOSED SYSTEM The sensors sense the input and sends to the microcontroller, where it responds and gives command to the particular component with predefined algorithm. The time parameters are crucial which can be easily changed and modified using Micro-controllers. Thus, would help to reduce the train collisions. 3.8 SOFTWARE SPECIFICATION 3.8.1 MPLAB IDE MPLAB Integrated Development Environment (IDE) is a free, integrated toolset for the development of embedded applications employing Microchip PIC and dsPIC microcontrollers. MPLAB IDE runs as a 32 MS Windows, is easy to use and includes a host of free software components Figure 3.21: Over view of the proposed system 64 OVER VIEW OF THE PROPOSED SYSTEM The sensors sense the input and sends to the microcontroller, where it responds and gives command to the particular component with predefined algorithm. The time parameters are crucial which can be easily changed and controllers. Thus, this device would work in coherence would help to reduce the train collisions. SOFTWARE SPECIFICATION MPLAB Integrated Development Environment (IDE) is a free, integrated for the development of embedded applications employing Microchip PIC and dsPIC microcontrollers. MPLAB IDE runs as a 32-bit application on MS Windows, is easy to use and includes a host of free software components Figure 3.21: Over view of the proposed system The sensors sense the input and sends to the microcontroller, where it responds and gives command to the particular component with predefined algorithm. The time parameters are crucial which can be easily changed and this device would work in coherence MPLAB Integrated Development Environment (IDE) is a free, integrated for the development of embedded applications employing Microchip’s bit application on MS Windows, is easy to use and includes a host of free software components
  65. 65. 65 for fast application development and supercharged debugging. MPLAB IDE also serves as a single, unified graphical user interface for additional Microchip and third party software and hardware development tools. Moving between tools is a snap, and upgrading from the free software simulator to hardware debug and programming tools is done in a flash because MPLAB IDE has the same user interface for all tools. A development system for embedded controllers is a system of programs running on a desktop PC to help write, edit, debug and program code- the intelligence of embedded systems applications in to a microcontroller. MPLAB IDE runs on a PC and contains all the components needed to design and deploy embedded systems applications. MPLAB IDE Programmer’s Editor Helps write correct code with the language tools of choice. The editor is aware of the assembler and compiler programming constructs and automatically “color-keys” the source code to help ensure it is syntactically correct. The Project Manager enables you to organize the various files used in your application source files, processor description header files and library files. Language tools run into errors when building the application, the offending line is shown and can be “double-clicked” to go to the corresponding source for immediate editing. After editing, press the “build” button to try again. Often this write-compile-fix loop is done many times for complex code, as the subsections are written and tested. Once the code builds with no errors, it needs to be tested. MPLAB IDE has components called “debuggers” and free software simulators for all PIC micro and PIC devices to help test the code. Even if the hardware is not yet finished, you can begin testing the code with the simulator, a software program that simulates the execution of the microcontroller. Once the hardware is in a prototype stage, a hardware debugger, such as MPLAB ICE or MPLAB ICD 2 can be used. These debuggers run the code in real time on your actual
  66. 66. 66 application. The MPLAB ICE physically replaces the microcontroller in the target using a high-speed probe to give you full control over the hardware in your design. The MPLAB ICD 2 uses special circuitry built into many Microchip MCUs with Flash program memory and can “see into” the target microcontroller’s program and data memory. The MPLAB ICD 2 can stop and start program execution, allowing you to test the code with the microcontroller in place on the application. After the application is running correctly, you can program a microcontroller with one of Microchip’s device programmers, such as PICSTART Plus or MPLAB PM3. These programmers verify that the finished code will run as designed. MPLAB IDE supports most PIC micro MCUs and every PIC Digital Signal Controller. MPLAB IDE – An Integrated Development Environment MPLAB IDE is an easy-to-learn and use Integrated Development Environment (IDE). The IDE provides firmware development engineers the flexibility to develop and debug firmware for Microchip’s PIC micro MCU families. The MPLAB IDE runs under Microsoft Windows 3.1x, Windows 95/98, Windows NT, or Windows 2000. MPLAB IDE provides functions that allow you to: 1.Create and Edit Source Files 2.Group Files into Projects 3.Debug Source Code 4.Debug Executable Logic Using the Simulator or Emulator the MPLAB IDE allows you to create and edit source code by providing you with a full-featured text editor. Further, you can easily debug source code with the aid of a Build Results window that displays the errors found by the compiler, assembler, and linker when generating executable files.. The MPLAB IDE also provides feature-rich simulator and emulator environments to debug the logic of executables. Some of the features are a variety of windows allowing you to view the contents of all data and program
  67. 67. 67 memory locations source code, program memory and absolute listing windows allowing you to view the source code and its assembly-level equivalent separately and together. 3.8.2 CCS C COMPILER The compiler contains Standard C operators and built in libraries that are specific to the PIC registers. Access to hardware features from C. The compiler includes built-in functions to access the PIC microcontroller hardware such as READ_ADC to read a value from the A/D converter. Discrete I/O is handled by describing the port characteristics in a PRAGMA. Functions such as INPUT and OUTPUT_HIGH will properly maintain the tri-state registers. Variables including structures may be directly mapped to memory such as I/O ports to best represent the hardware structure in C. The microcontroller clock speed may be specified in a PRAGMA to permit built in functions to delay for a given number of microseconds or milliseconds. Serial I/O functions allow standard functions such as GETC and PRINTF to be used for RS-232 like I/O. The compiler runs under Windows 95, 98, ME, NT4, 2000, XP, Vista or Linux. It outputs hex and debug files that are selectable and compatible with popular emulators and programmers including the MPLAB IDE for source level debugging. During the linking process the program structure, including the call tree, is analyzed. Functions that call one another frequently are grouped together in the same page segment. Functions may be implemented inline or separate. RAM is allocated efficiently by using the call tree to determine how locations can be re-used. Constant strings and tables are saved in the device ROM.
  68. 68. 68 3.8.3 PROTEUS SIMULATION SOFTWARE Proteus Virtual System Modeling (VSM) combines mixed mode SPICE circuit simulation, animated components and microprocessor models to facilitate co simulation of complete microcontroller based designs. For the first time ever, it is possible to develop and test such designs before a physical prototype is constructed. This is possible because one can interact with the design using on screen indicators such as LED and LCD displays and actuators such as switches and buttons. The simulation takes place in real time (or near enough to it): a 300 MHz Pentium II can simulate a basic 8051 system clocking at over 12MHz. Proteus VSM also provides extensive debugging facilities including breakpoints, single stepping and variable display for both assembly code and high level language source. 3.8.4 ORCAD Orcad is a proprietary software tool suite used primarily for electronic design automation. The software is used mainly to create electronic prints for manufacturing of printed circuit boards, by electronic design engineers and electronic technicians to create electronic schematics. The name OrCAD is a portmanteau, reflecting the software’s origins: Oregon +CAD. Easy-to-use and powerful, cadence OrCAD capture is the most widely used schematic design solution, supporting both flat and hierarchal designs from the simplest to the most complex. Seamless bi-directional integration with OrCAD PCB editor enables data synchronization and cross-probing placing between the schematic and the board design. OrCAD capture allows designers to back annotate layout changes, make gate/pin swaps, and change component names or values from board design to schematic using the feedback process.
  69. 69. 69 CHAPTER 4 RESULTS AND DISCUSSION 4.1 TEST RESULTS 1) Testing values of vibration sensor’s
  70. 70. 70 4.2 FUTURE ENHANCEMENT As future expansion it is proposed that licensing procedures of satellite communications may be initiated so as to implement a system upgrade whereby real time data of moving trains like speed and current location may be tracked and monitored at the control station. Such real-time information can be utilized for system upgrade so as to avert accidents due to natural calamities such as land slide and cyclone. An additional geographic sensors and interface with geographic information system may be required for the same. Panic buttons may be provided in all compartments of the train which may be used by passengers in case of danger and alert the control station. Algorithm of the proposed system may also be altered so as to incorporate a cruise control such that whenever speed of train is detected to be higher than a rated level automatic brake may be applied. Automatic slowdown of trains when approaching stations without stops may also be implemented as per requirements from Indian Railways. Anti collision device is a self acting microprocessor based data communication device designed and developed by Konkan Railway (KR). When installed on locomotives, guard vans, stations and level crossing gates. The network of ACD systems prevents high speed head on collisions in mid sections, station areas and at level crossing gates, thereby saving the lives of rail passengers and road users. This device can be integrated with the Anti collision device for better sophistication and optimization.
  71. 71. 71 4.3 CONCLUSION Collision avoidance systems are especially useful in bad weather conditions. In this paper, a design for automatically averting train collisions and accidents at level crossing gate have been designed, simulated and tested. • It uses the advanced features of pic micro controller with vibration sensor and zigbee communication technique, proves to be effective in achieving the objects • It is applicable at every aspect of the railways for uninterruptible service • Saving human life, protection against accidents and the communicable electronic systems are the salient features and the added advantage of this project. From the above discussion and information of this system we, up to now surely comes to know that it is highly reliable effective and economical at dense traffic area, sub urban area and the route where frequency of trains is more. As it saves some auxiliary structure as well as the expenditure on attendant it is more economical at above mentioned places than traditional railway crossing gate system. We know that though it is very beneficial but it is also impossible to install such system at each and every place, but it gives certainly a considerable benefit to us, thereby to our nation.
  72. 72. 72 4.4 APPENDICES PCB LAYOUT 1) BASE STATION
  73. 73. 73 2) TRAIN SIDE
  74. 74. 74 COMPONENT LAYOUT 1) BASE STATION SIDE
  75. 75. 75 2) TRAIN SIDE
  76. 76. 76 4.5 REFERENCES 1. Arun.P, Saritha.S, K.M.Martin, Madhukumar.S “Simulation of zigbee based TACS for collision detection and avoidance for railway traffic., “in International conference on advanced computing & communication technologies for high performance application, paper ID 51,June 2012. 2. “Communication Systems” by Simon Hawkins. 3. Jennic, JN-AN-1059 Deployment guidelines for IEEE 802.15.4/ZigBee wireless networks, 37-38, 2007 4. D.Roychoudary and Sail Jain”L.I.C”, New Age International. 5. Kenneth.J.Ayala”The 89C51 Microcontroller Architecture programming and Applications”, Pen ram International. 6. “Principles of Electronics” by V.K.MEHTA.

×