merrypaulraj
Published © GPL3+

Child Acceleration & Vehicle Fall Sensor to KILL Engine

Two-wheel auto gear ENGINE is KILLED (off) when the sensor detects a child accelerate the vehicle or a vehicle falls down to avoid accident.

BeginnerProtip3,093
Child Acceleration & Vehicle Fall Sensor to KILL Engine

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Perma-Proto Breadboard Half Size
Perma-Proto Breadboard Half Size
×1
IR Sensor Module
×4
5V Relay Module
×1
Jumper wires (generic)
Jumper wires (generic)
×1
9V battery (generic)
9V battery (generic)
×1
PVC Pipe 10mm ID x 300mm Lg (Bent)
×1
Metal Ball 9.5mm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Welding Machine
For sensor stand fabrication
Multi meter

Story

Read more

Schematics

Circuit Drawing

arduino-circuit_t1aNkKFXkx.jpg

Code

Arduino-UNO Code

Arduino
int obstaclePin3 = 3;  // This is our input pin (Rotation)
int obstaclePin4 = 4;  // This is our input pin (Hand Sensor 1of4)
int obstaclePin5 = 5;  // This is our input pin (Hand Sensor 2of4)
int obstaclePin6 = 6;  // This is our input pin (Hand Sensor 3of4)
int obstaclePin7 = 7;  // This is our input pin (Hand Sensor 4of4)

int hasObstacle3 = HIGH;  // HIGH MEANS OBSTACLE (Rotation)
int hasObstacle4 = LOW;  // LOW MEANS NO OBSTACLE
int hasObstacle5 = LOW;  // LOW MEANS NO OBSTACLE
int hasObstacle6 = LOW;  // LOW MEANS NO OBSTACLE
int hasObstacle7 = LOW;  // LOW MEANS NO OBSTACLE
int fall = HIGH; // HIGH MEANS VEHICLE HAS NOT FALLEN

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(obstaclePin3, INPUT);
  pinMode(obstaclePin4, INPUT);
  pinMode(obstaclePin5, INPUT);
  pinMode(obstaclePin6, INPUT);
  pinMode(obstaclePin7, INPUT);
  pinMode(8, OUTPUT);
  pinMode(9, INPUT_PULLUP);
  Serial.begin(9600);  
}
  
void loop() {
  hasObstacle3 = digitalRead(obstaclePin3); //Reads the output of the obstacle sensor from the 7th PIN of the Digital section of the arduino
  hasObstacle4 = digitalRead(obstaclePin4);
  hasObstacle5 = digitalRead(obstaclePin5);
  hasObstacle6 = digitalRead(obstaclePin6);
  hasObstacle7 = digitalRead(obstaclePin7);
  fall = digitalRead(9);

  if (fall == LOW)
  {
    Serial.println("Engine Killed - fall");
    digitalWrite(LED_BUILTIN, HIGH); // Open the main scooter KEY circuit
    digitalWrite(8, LOW); // no power to relay
    delay (5000);
    digitalWrite(LED_BUILTIN, LOW);
    digitalWrite(8, HIGH); // no power to relay
  }
  else if (hasObstacle3 == HIGH)
  {
    Serial.println("Engine is in running condition1");
    digitalWrite(LED_BUILTIN, LOW);//Illuminates the 13th Port LED
    digitalWrite(8, HIGH); // no power to relay
  }
   else if (hasObstacle3 == LOW && hasObstacle4 == HIGH && hasObstacle5 == HIGH && hasObstacle6 == HIGH && hasObstacle7 == HIGH)
  {
    Serial.println("Engine is in running condition1");
    digitalWrite(LED_BUILTIN, LOW);//OFF the 13th Port LED
    digitalWrite(8, HIGH); // no power to relay
  }
  
  else
  {
    Serial.println("Engine Killed");
    digitalWrite(LED_BUILTIN, HIGH); // Open the main scooter KEY circuit
    digitalWrite(8, LOW); // no power to relay
    delay (5000);
    digitalWrite(LED_BUILTIN, LOW);
    digitalWrite(8, HIGH); // no power to relay
 }
}

Credits

merrypaulraj
2 projects • 3 followers
Contact

Comments

Please log in or sign up to comment.