inspire award science project, Road safety Accident Prevention Technology in Hilly Terrain project using Arduino
Accident Prevention Technology in Hilly Terrain
In hilly regions, there will be a number of curves and hairpin bends. The roadway is one of the often-used modes of transport in these regions. Accident rate and death rate in hilly regions are increasing day by day. The roads in this region will definitely have bends and steep curves; hence, it is difficult to see the vehicles coming from the opposite side. The proposed system aims in reducing the risk of driving vehicle in the terrain region with hairpin bends and steep curves
Components Required.
1. Microcontroller (Arduino UNO)
2. Ultrasonic sensors
3. Buzzer
4. Red & Green LEDs.
5. Resistor.
6. Vero Board.
7. DC Generator.
8. Battery.
9. Switch.
10. Connecting Wires.
11. Ply Board.
12. Toy car.
Circuit Diagram
Working
The Micro-controller with ultrasonic sensor senses the vehicle coming towards the bend and intimates it to the other side of the bend or curve, it gives three stages of LED alerts to the driver driving the vehicle from the opposite side of the hairpin bend or curve.
Making Video
Arduino Code
int ledPin1 = 2;
int ledPin2 = 3;
int ledPin3 = 4;
int ledPin4 = 5;
int buzzer1 = 10;
int buzzer2 = 11;
int trigPin1 = 6;
int echoPin1 = 7;
int trigPin2 = 8;
int echoPin2 = 9;
void setup() {
Serial.begin (9600);
pinMode(13,OUTPUT);
pinMode(trigPin1, OUTPUT);
pinMode(echoPin1, INPUT);
pinMode(trigPin2, OUTPUT);
pinMode(echoPin2, INPUT);
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
pinMode(buzzer1, OUTPUT);
pinMode(buzzer2, OUTPUT);
}
void firstsensor(){ // This function is for first sensor.
int duration1, distance1;
digitalWrite (trigPin1, HIGH);
delayMicroseconds (10);
digitalWrite (trigPin1, LOW);
duration1 = pulseIn (echoPin1, HIGH);
distance1 = (duration1/2) / 29;
Serial.print("1st Sensor: ")
Serial.print(distance1);
Serial.print("cm ");
if (distance1 < 15) { // Change the number for long or short distances.
digitalWrite (ledPin1, HIGH);
digitalWrite (ledPin2, LOW)
digitalWrite(buzzer1, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(buzzer1, LOW); // turn the LED off by making the voltage LOW
delay(200);
} else {
digitalWrite (ledPin1, LOW);
digitalWrite (ledPin2, HIGH);
digitalWrite (buzzer1, LOW);
}
float sensorValue = analogRead(A0);
// Reads the analog input ranging from 0 to 1023
Serial.println(sensorValue);
if(sensorValue<=400)
{
digitalWrite(13,HIGH);
}
else
digitalWrite(13,LOW);
}
void secondsensor(){ // This function is for second sensor.
int duration2, distance2;
digitalWrite (trigPin2, HIGH);
delayMicroseconds (10);
digitalWrite (trigPin2, LOW);
duration2 = pulseIn (echoPin2, HIGH);
distance2 = (duration2/2) / 29.1;
Serial.print("2nd Sensor: ");
Serial.print(distance2);
Serial.print("cm ");
if (distance2 < 15) { // Change the number for long or short distances.
digitalWrite (ledPin3, HIGH);
digitalWrite (ledPin4, LOW);
digitalWrite(buzzer2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(buzzer2, LOW); // turn the LED off by making the voltage LOW
delay(200);
}
else {
digitalWrite (ledPin3, LOW);
digitalWrite (ledPin4, HIGH);
digitalWrite (buzzer2, LOW);
}
}
void loop() {
Serial.println("\n");
firstsensor();
secondsensor();
delay(100);
}
Conclusion
The system was able to alert the vehicle approaching in the opposite direction of curve, hairpin bend or a blind spot to reduce the accident rate in hilly regions. The system shall help in saving many lives which are lost due to accident in these difficult hilly terrains.
Comments
Post a Comment