SlideShare a Scribd company logo
Automatic Collision
Control System
Netaji Subhash Engineering College
3rd
Year/Electronics and Communication Engineering
Group MemberDetails:
Name Class Roll University Roll
Sankhadeep Rakshit 125 10900314129
Jakir Hossain Molla 40 10900313040
Subrata Bairagi 126 10900314133
Sudipto Ghosh 124 10900314134
Deepjyoti Saha 120 10900314119
Overview:
Topic Page No.
 Acknowledgement 1
 Introduction 2
 Related Work 3
 Motivation 4
 Procedure 5-9
 Component Details 5
 Circuit Diagram 6
 Arduino Code 7-9
 Result & Analysis 10
 Conclusion 11
 Future Scope 12
 References 13
Acknowledgement
We extend our sincere gratitude towards Mr. Joy Dutta and Mr. Ujjal Sengupta
for giving us thein invaluable knowledge and wonderful technical guidance.
We express our thanks to all our faculty members of the Dept. of Electronics and
Communication Engineering of our College for their endless help and support.
1
Introduction
The objective of our project is to prevent the railway accidents by using
Microcontroller based collision control system. As we know railway is a life line of
India and it’s being the cheapest mode 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. Rail road 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 from a major catastrophe. As
they cause severe damage to life and property. Train collisions occur frequently
eluding all the latest technology.
The name of our project is Automatic Collision Control System, because it’s
made by using Arduino and Ultra Sonic Range Finderto prevent the collisions that
occur in Railway track.
2
Related Works
In this project we made a device named Automatic Collision Control System. We
made this device by using an Arduino Uno and an Ultrasonic Range Finder and it
is mainly designed for preventing trains collisions only. In this project we also
used an alarm system which will make the train passengers and others alert
before the collision. In our prototype when the train comes within the 20cm of the
obstruction the alarm goes ON and when the distance between the train and the
obstruction in less than 10cm the train engine will be turned OFF. When the
obstruction will be moved the train will start automatically.
3
Motivation
The project is designed to build an obstacle avoidance vehicle using
ultrasonic sensors for its movement. An Arduino Uno is used to achieve the
desired operation. An ultrasonic sensor is used to detect any obstacle ahead
of it and sends a command to the Arduino.
Every year in India, around 40000 accident occurs. It’s a matter of huge life-
loss as well as financial loss. We can reduce this upto 60% using this
technique.
4
Procedure
Components:
Sl. No. Name of the Components Specification
1 Arduino Uno
2 Ultrasonic Rage Sensor HC SR-04
3 Diode 1N4001
4 Transistor BC337
5 Resistor 330 ohm
6 Battery Operated Train 3V
7 LED 3V
8 Battery 9V
5
Circuit Diagram:
6
Arduino Code:
/*
HC-SR04 Ping distance sensor:
VCC to arduino 5v
GND to arduino GND
Echo to Arduino pin 7
Trig to Arduino pin 8
*/
#define echoPin 7 // Echo Pin
#define trigPin 8 // Trigger Pin
#define servoPin 2 // Onboard Servo
#define buzzerPin 4 // Onboard Buzzer
int maximumRange = 30; // Maximum range needed
int minimumRange = 10; // Minimum range needed
long duration, distance; // Duration used to calculate distance
void setup() {
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(servoPin, OUTPUT); // Use Servo Motor
pinMode(buzzerPin, OUTPUT); // Use Buzzer
}
void loop() { 7
/* The following trigPin/echoPin cycle is used to determine the
distance of the nearest object by bouncing soundwaves off of it. */
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
//Calculate the distance (in cm) based on the speed of sound.
distance = duration/58.2;
if (distance <= maximumRange){
/* Send a negative number to computer and Turn Buzzer ON
to indicate "out of range" */
digitalWrite(buzzerPin, HIGH);
}
else {
/* Send the distance to the computer using Serial protocol, and
turn Buzzer OFF to indicate successful reading. */
digitalWrite(buzzerPin, LOW);
}
if (distance <= minimumRange){
/* Send a negative number to computer and Turn Servo OFF
to indicate "out of range" */
digitalWrite(servoPin, LOW); 8
}
else {
/* Send the distance to the computer using Serial protocol, and
turn Servo ON to indicate successful reading. */
digitalWrite(servoPin, HIGH);
//Delay 50ms before next reading.
delay(50);
}
}
9
Result & Analysis
We made the circuit and connected a 9v supply from a battery to the Vin of the
Arduino board. We uploaded the code via USB.Now when an obstacle comes
within 20cm of the train, the echo pin of the ultrasonic sensor is high and its gives
5v input to the Arduino UNO board. The LED turns ON to alert. When the obstacle
is within 10cm, the pin2 of Arduino board does not give any output and the motor
of the train stops working. When we remove the obstacle the pin2 is again high
and the motor is given 3.3v from the Arduino board, so the train will starts
moving.
10
Conclusion
After a long discuss between all group members we have decided this topic as
our project, because it has practical life benefits and the idea is innovative. At the
time of doing this project we face some minor and common problems like,
transistor burn, errors in coding, faults in circuit etc. But finally we together
overcome all the problems and completed the project successfully and the device
is also running nearly accurately as we expected.
11
Future Scope
We made this device for trains only, but it is true that the accident occurs on
roads more than tracks. So it will be also very useful device if it can be used in
personal vehicles like cars and public vehicles like bus etc. But before doing this
we have to make some minor changes in it like it should be handier and
compact, and it should be used on each and every car. Otherwise this whole
project will not be 100% successful.
12
References
Websites:
1. http://www.instructable.com
2. http://www.arduino.cc
3. http://www.youtube.com
Books:
1. Beginning Arduino By Michel McRobert
13

More Related Content

What's hot

Obstacle avoiding Robot
Obstacle avoiding RobotObstacle avoiding Robot
Obstacle avoiding Robot
Rasheed Khan
 
Final_Technical_Report_KevinHuang
Final_Technical_Report_KevinHuangFinal_Technical_Report_KevinHuang
Final_Technical_Report_KevinHuangKevin Huang
 
Obstacle Avoidance ROBOT using ARDUINO
Obstacle Avoidance ROBOT using ARDUINOObstacle Avoidance ROBOT using ARDUINO
Obstacle Avoidance ROBOT using ARDUINO
jovin Richard
 
Obstacle avoiding robot(Lab report)
Obstacle  avoiding  robot(Lab report)Obstacle  avoiding  robot(Lab report)
Obstacle avoiding robot(Lab report)
Захір Райхан
 
OBSTACLE AVOIDING CAR
OBSTACLE AVOIDING CAROBSTACLE AVOIDING CAR
OBSTACLE AVOIDING CAR
Shubham Thakur
 
Maze solver robot presentation
Maze solver robot presentationMaze solver robot presentation
Maze solver robot presentation
Naveed Ahmed
 
Obstacle avoiding robot.doc
Obstacle avoiding robot.docObstacle avoiding robot.doc
Obstacle avoiding robot.doc
Electronics - Embedded System
 
Obstacle Avoidance Robot (Powered by Arduino)
Obstacle Avoidance Robot (Powered by Arduino)Obstacle Avoidance Robot (Powered by Arduino)
Obstacle Avoidance Robot (Powered by Arduino)
Amanullah Mahmood
 
Impediment detection robot using Arduino
Impediment detection robot using ArduinoImpediment detection robot using Arduino
Impediment detection robot using Arduino
Ayush Chhangani
 
Line maze solver
Line maze solverLine maze solver
Line maze solver
Sushil Dahal
 
Obstacle avoiding robot
Obstacle avoiding robotObstacle avoiding robot
Obstacle avoiding robot
Electronics - Embedded System
 
Maze solving robot
Maze solving robotMaze solving robot
Maze solving robot
Kevin Mathew
 
Obstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopy
Obstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopyObstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopy
Obstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopyElijah Barner
 
obstacle avoiding robot
obstacle avoiding robotobstacle avoiding robot
obstacle avoiding robot
ssuser5ba2241
 
Maze Solver Robot Poster
Maze Solver Robot PosterMaze Solver Robot Poster
Maze Solver Robot Poster
Naveed Ahmed
 
Autonomous maze solving robot (1/2)
Autonomous maze solving robot (1/2)Autonomous maze solving robot (1/2)
Autonomous maze solving robot (1/2)
Musfiqur Rahman
 
Line following using maze simulator
Line following using maze simulatorLine following using maze simulator
Line following using maze simulatorSharjeel Sarwar
 
Line maze solver robot
Line maze solver robot Line maze solver robot
Line maze solver robot
saiharsha41
 
Obstacle Avoidance Robot
Obstacle Avoidance RobotObstacle Avoidance Robot
Obstacle Avoidance Robot
Ratan Srikanth
 

What's hot (19)

Obstacle avoiding Robot
Obstacle avoiding RobotObstacle avoiding Robot
Obstacle avoiding Robot
 
Final_Technical_Report_KevinHuang
Final_Technical_Report_KevinHuangFinal_Technical_Report_KevinHuang
Final_Technical_Report_KevinHuang
 
Obstacle Avoidance ROBOT using ARDUINO
Obstacle Avoidance ROBOT using ARDUINOObstacle Avoidance ROBOT using ARDUINO
Obstacle Avoidance ROBOT using ARDUINO
 
Obstacle avoiding robot(Lab report)
Obstacle  avoiding  robot(Lab report)Obstacle  avoiding  robot(Lab report)
Obstacle avoiding robot(Lab report)
 
OBSTACLE AVOIDING CAR
OBSTACLE AVOIDING CAROBSTACLE AVOIDING CAR
OBSTACLE AVOIDING CAR
 
Maze solver robot presentation
Maze solver robot presentationMaze solver robot presentation
Maze solver robot presentation
 
Obstacle avoiding robot.doc
Obstacle avoiding robot.docObstacle avoiding robot.doc
Obstacle avoiding robot.doc
 
Obstacle Avoidance Robot (Powered by Arduino)
Obstacle Avoidance Robot (Powered by Arduino)Obstacle Avoidance Robot (Powered by Arduino)
Obstacle Avoidance Robot (Powered by Arduino)
 
Impediment detection robot using Arduino
Impediment detection robot using ArduinoImpediment detection robot using Arduino
Impediment detection robot using Arduino
 
Line maze solver
Line maze solverLine maze solver
Line maze solver
 
Obstacle avoiding robot
Obstacle avoiding robotObstacle avoiding robot
Obstacle avoiding robot
 
Maze solving robot
Maze solving robotMaze solving robot
Maze solving robot
 
Obstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopy
Obstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopyObstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopy
Obstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopy
 
obstacle avoiding robot
obstacle avoiding robotobstacle avoiding robot
obstacle avoiding robot
 
Maze Solver Robot Poster
Maze Solver Robot PosterMaze Solver Robot Poster
Maze Solver Robot Poster
 
Autonomous maze solving robot (1/2)
Autonomous maze solving robot (1/2)Autonomous maze solving robot (1/2)
Autonomous maze solving robot (1/2)
 
Line following using maze simulator
Line following using maze simulatorLine following using maze simulator
Line following using maze simulator
 
Line maze solver robot
Line maze solver robot Line maze solver robot
Line maze solver robot
 
Obstacle Avoidance Robot
Obstacle Avoidance RobotObstacle Avoidance Robot
Obstacle Avoidance Robot
 

Similar to Automatic Collision Control System

371275588.pptx
371275588.pptx371275588.pptx
371275588.pptx
AnandVerma529372
 
Automatic railway gate control using arduino uno
Automatic railway gate control using arduino unoAutomatic railway gate control using arduino uno
Automatic railway gate control using arduino uno
selvalakshmi24
 
pdf-obstacle-avoiding-robot.docx
pdf-obstacle-avoiding-robot.docxpdf-obstacle-avoiding-robot.docx
pdf-obstacle-avoiding-robot.docx
maheshwaran79
 
Automatic railway gate control using arduino uno
Automatic railway gate control using arduino unoAutomatic railway gate control using arduino uno
Automatic railway gate control using arduino uno
selvalakshmi24
 
Arduino Base Door Automation System.ppt
Arduino Base Door Automation System.pptArduino Base Door Automation System.ppt
Arduino Base Door Automation System.ppt
Sazzad Hossain
 
IRJET - Automated Railway Crossing System using IoT
IRJET - Automated Railway Crossing System using IoTIRJET - Automated Railway Crossing System using IoT
IRJET - Automated Railway Crossing System using IoT
IRJET Journal
 
Final report obstacle avoiding roboat
Final report obstacle avoiding roboatFinal report obstacle avoiding roboat
Final report obstacle avoiding roboat
Shubham Thakur
 
obstacle avoiding robot project
obstacle avoiding robot projectobstacle avoiding robot project
obstacle avoiding robot project
Aisha Naeem
 
A presentation on obstacle avoiding robot
A presentation on obstacle avoiding robotA presentation on obstacle avoiding robot
A presentation on obstacle avoiding robot
kantankit4
 
Project Instrumentation (Smart Trashbin)
Project Instrumentation (Smart Trashbin)Project Instrumentation (Smart Trashbin)
Project Instrumentation (Smart Trashbin)
handymg
 
Autonomous navigation robot
Autonomous navigation robotAutonomous navigation robot
Autonomous navigation robot
IRJET Journal
 
BOT FOR WILDLIFE PROTECTION
BOT FOR WILDLIFE PROTECTIONBOT FOR WILDLIFE PROTECTION
BOT FOR WILDLIFE PROTECTION
IRJET Journal
 
IRJET - Automatic Potholes Detection and Alert System with Speed Reduction Fe...
IRJET - Automatic Potholes Detection and Alert System with Speed Reduction Fe...IRJET - Automatic Potholes Detection and Alert System with Speed Reduction Fe...
IRJET - Automatic Potholes Detection and Alert System with Speed Reduction Fe...
IRJET Journal
 
Self Obstacle Avoiding Rover
Self Obstacle Avoiding RoverSelf Obstacle Avoiding Rover
Self Obstacle Avoiding Rover
Emam Hasan
 
ARTIFICAL INTELLIGENCE OF SEVEN FEATURES SMART BIKE
ARTIFICAL INTELLIGENCE OF  SEVEN FEATURES SMART BIKEARTIFICAL INTELLIGENCE OF  SEVEN FEATURES SMART BIKE
ARTIFICAL INTELLIGENCE OF SEVEN FEATURES SMART BIKE
Agara Mudhalvan
 
Implementation of anti-collision train prototype based on arduino microcontro...
Implementation of anti-collision train prototype based on arduino microcontro...Implementation of anti-collision train prototype based on arduino microcontro...
Implementation of anti-collision train prototype based on arduino microcontro...
IJAAS Team
 
Y3.pptx
Y3.pptxY3.pptx
OBSTACLE AVOIDACE ROBOT USING ARDUINO UNO AND ULTRASONIC SENSOR
OBSTACLE AVOIDACE ROBOT USING ARDUINO UNO AND ULTRASONIC SENSOROBSTACLE AVOIDACE ROBOT USING ARDUINO UNO AND ULTRASONIC SENSOR
OBSTACLE AVOIDACE ROBOT USING ARDUINO UNO AND ULTRASONIC SENSOR
LeTsKnOw1
 
Arduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning SystemArduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning System
Madhav Reddy Chintapalli
 
23 2 feb17 15nov16 13357 27441-1-sp(edit)
23 2 feb17 15nov16 13357 27441-1-sp(edit)23 2 feb17 15nov16 13357 27441-1-sp(edit)
23 2 feb17 15nov16 13357 27441-1-sp(edit)
IAESIJEECS
 

Similar to Automatic Collision Control System (20)

371275588.pptx
371275588.pptx371275588.pptx
371275588.pptx
 
Automatic railway gate control using arduino uno
Automatic railway gate control using arduino unoAutomatic railway gate control using arduino uno
Automatic railway gate control using arduino uno
 
pdf-obstacle-avoiding-robot.docx
pdf-obstacle-avoiding-robot.docxpdf-obstacle-avoiding-robot.docx
pdf-obstacle-avoiding-robot.docx
 
Automatic railway gate control using arduino uno
Automatic railway gate control using arduino unoAutomatic railway gate control using arduino uno
Automatic railway gate control using arduino uno
 
Arduino Base Door Automation System.ppt
Arduino Base Door Automation System.pptArduino Base Door Automation System.ppt
Arduino Base Door Automation System.ppt
 
IRJET - Automated Railway Crossing System using IoT
IRJET - Automated Railway Crossing System using IoTIRJET - Automated Railway Crossing System using IoT
IRJET - Automated Railway Crossing System using IoT
 
Final report obstacle avoiding roboat
Final report obstacle avoiding roboatFinal report obstacle avoiding roboat
Final report obstacle avoiding roboat
 
obstacle avoiding robot project
obstacle avoiding robot projectobstacle avoiding robot project
obstacle avoiding robot project
 
A presentation on obstacle avoiding robot
A presentation on obstacle avoiding robotA presentation on obstacle avoiding robot
A presentation on obstacle avoiding robot
 
Project Instrumentation (Smart Trashbin)
Project Instrumentation (Smart Trashbin)Project Instrumentation (Smart Trashbin)
Project Instrumentation (Smart Trashbin)
 
Autonomous navigation robot
Autonomous navigation robotAutonomous navigation robot
Autonomous navigation robot
 
BOT FOR WILDLIFE PROTECTION
BOT FOR WILDLIFE PROTECTIONBOT FOR WILDLIFE PROTECTION
BOT FOR WILDLIFE PROTECTION
 
IRJET - Automatic Potholes Detection and Alert System with Speed Reduction Fe...
IRJET - Automatic Potholes Detection and Alert System with Speed Reduction Fe...IRJET - Automatic Potholes Detection and Alert System with Speed Reduction Fe...
IRJET - Automatic Potholes Detection and Alert System with Speed Reduction Fe...
 
Self Obstacle Avoiding Rover
Self Obstacle Avoiding RoverSelf Obstacle Avoiding Rover
Self Obstacle Avoiding Rover
 
ARTIFICAL INTELLIGENCE OF SEVEN FEATURES SMART BIKE
ARTIFICAL INTELLIGENCE OF  SEVEN FEATURES SMART BIKEARTIFICAL INTELLIGENCE OF  SEVEN FEATURES SMART BIKE
ARTIFICAL INTELLIGENCE OF SEVEN FEATURES SMART BIKE
 
Implementation of anti-collision train prototype based on arduino microcontro...
Implementation of anti-collision train prototype based on arduino microcontro...Implementation of anti-collision train prototype based on arduino microcontro...
Implementation of anti-collision train prototype based on arduino microcontro...
 
Y3.pptx
Y3.pptxY3.pptx
Y3.pptx
 
OBSTACLE AVOIDACE ROBOT USING ARDUINO UNO AND ULTRASONIC SENSOR
OBSTACLE AVOIDACE ROBOT USING ARDUINO UNO AND ULTRASONIC SENSOROBSTACLE AVOIDACE ROBOT USING ARDUINO UNO AND ULTRASONIC SENSOR
OBSTACLE AVOIDACE ROBOT USING ARDUINO UNO AND ULTRASONIC SENSOR
 
Arduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning SystemArduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning System
 
23 2 feb17 15nov16 13357 27441-1-sp(edit)
23 2 feb17 15nov16 13357 27441-1-sp(edit)23 2 feb17 15nov16 13357 27441-1-sp(edit)
23 2 feb17 15nov16 13357 27441-1-sp(edit)
 

Automatic Collision Control System

  • 1. Automatic Collision Control System Netaji Subhash Engineering College 3rd Year/Electronics and Communication Engineering Group MemberDetails: Name Class Roll University Roll Sankhadeep Rakshit 125 10900314129 Jakir Hossain Molla 40 10900313040 Subrata Bairagi 126 10900314133 Sudipto Ghosh 124 10900314134 Deepjyoti Saha 120 10900314119
  • 2. Overview: Topic Page No.  Acknowledgement 1  Introduction 2  Related Work 3  Motivation 4  Procedure 5-9  Component Details 5  Circuit Diagram 6  Arduino Code 7-9  Result & Analysis 10  Conclusion 11  Future Scope 12  References 13
  • 3. Acknowledgement We extend our sincere gratitude towards Mr. Joy Dutta and Mr. Ujjal Sengupta for giving us thein invaluable knowledge and wonderful technical guidance. We express our thanks to all our faculty members of the Dept. of Electronics and Communication Engineering of our College for their endless help and support. 1
  • 4. Introduction The objective of our project is to prevent the railway accidents by using Microcontroller based collision control system. As we know railway is a life line of India and it’s being the cheapest mode 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. Rail road 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 from a major catastrophe. As they cause severe damage to life and property. Train collisions occur frequently eluding all the latest technology. The name of our project is Automatic Collision Control System, because it’s made by using Arduino and Ultra Sonic Range Finderto prevent the collisions that occur in Railway track. 2
  • 5. Related Works In this project we made a device named Automatic Collision Control System. We made this device by using an Arduino Uno and an Ultrasonic Range Finder and it is mainly designed for preventing trains collisions only. In this project we also used an alarm system which will make the train passengers and others alert before the collision. In our prototype when the train comes within the 20cm of the obstruction the alarm goes ON and when the distance between the train and the obstruction in less than 10cm the train engine will be turned OFF. When the obstruction will be moved the train will start automatically. 3
  • 6. Motivation The project is designed to build an obstacle avoidance vehicle using ultrasonic sensors for its movement. An Arduino Uno is used to achieve the desired operation. An ultrasonic sensor is used to detect any obstacle ahead of it and sends a command to the Arduino. Every year in India, around 40000 accident occurs. It’s a matter of huge life- loss as well as financial loss. We can reduce this upto 60% using this technique. 4
  • 7. Procedure Components: Sl. No. Name of the Components Specification 1 Arduino Uno 2 Ultrasonic Rage Sensor HC SR-04 3 Diode 1N4001 4 Transistor BC337 5 Resistor 330 ohm 6 Battery Operated Train 3V 7 LED 3V 8 Battery 9V 5
  • 9. Arduino Code: /* HC-SR04 Ping distance sensor: VCC to arduino 5v GND to arduino GND Echo to Arduino pin 7 Trig to Arduino pin 8 */ #define echoPin 7 // Echo Pin #define trigPin 8 // Trigger Pin #define servoPin 2 // Onboard Servo #define buzzerPin 4 // Onboard Buzzer int maximumRange = 30; // Maximum range needed int minimumRange = 10; // Minimum range needed long duration, distance; // Duration used to calculate distance void setup() { Serial.begin (9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(servoPin, OUTPUT); // Use Servo Motor pinMode(buzzerPin, OUTPUT); // Use Buzzer } void loop() { 7
  • 10. /* The following trigPin/echoPin cycle is used to determine the distance of the nearest object by bouncing soundwaves off of it. */ digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); //Calculate the distance (in cm) based on the speed of sound. distance = duration/58.2; if (distance <= maximumRange){ /* Send a negative number to computer and Turn Buzzer ON to indicate "out of range" */ digitalWrite(buzzerPin, HIGH); } else { /* Send the distance to the computer using Serial protocol, and turn Buzzer OFF to indicate successful reading. */ digitalWrite(buzzerPin, LOW); } if (distance <= minimumRange){ /* Send a negative number to computer and Turn Servo OFF to indicate "out of range" */ digitalWrite(servoPin, LOW); 8
  • 11. } else { /* Send the distance to the computer using Serial protocol, and turn Servo ON to indicate successful reading. */ digitalWrite(servoPin, HIGH); //Delay 50ms before next reading. delay(50); } } 9
  • 12. Result & Analysis We made the circuit and connected a 9v supply from a battery to the Vin of the Arduino board. We uploaded the code via USB.Now when an obstacle comes within 20cm of the train, the echo pin of the ultrasonic sensor is high and its gives 5v input to the Arduino UNO board. The LED turns ON to alert. When the obstacle is within 10cm, the pin2 of Arduino board does not give any output and the motor of the train stops working. When we remove the obstacle the pin2 is again high and the motor is given 3.3v from the Arduino board, so the train will starts moving. 10
  • 13. Conclusion After a long discuss between all group members we have decided this topic as our project, because it has practical life benefits and the idea is innovative. At the time of doing this project we face some minor and common problems like, transistor burn, errors in coding, faults in circuit etc. But finally we together overcome all the problems and completed the project successfully and the device is also running nearly accurately as we expected. 11
  • 14. Future Scope We made this device for trains only, but it is true that the accident occurs on roads more than tracks. So it will be also very useful device if it can be used in personal vehicles like cars and public vehicles like bus etc. But before doing this we have to make some minor changes in it like it should be handier and compact, and it should be used on each and every car. Otherwise this whole project will not be 100% successful. 12
  • 15. References Websites: 1. http://www.instructable.com 2. http://www.arduino.cc 3. http://www.youtube.com Books: 1. Beginning Arduino By Michel McRobert 13