Table of Contents

Play Video

TRAFFIC ROBO

The Traffic Police Bot prototype is an advanced system designed to assist traffic police officers in enforcing road safety regulations effectively. Here’s a comprehensive description of its components and functionalities:

Components:

1. Arduino Uno Microcontroller:

· Acts as the central control unit, managing all operations of the Traffic Police Bot. It receives inputs from sensors, processes data, and controls the actuators.

2. Bluetooth Module:

· Enables wireless communication with a control device (e.g., smartphone or tablet). This allows remote operation and real-time monitoring of the bot’s activities.

3. DC Motors and Motor Driver:

· Utilizes DC motors for movement, controlled by a motor driver module (e.g., L298N). This setup provides the necessary power and control for the bot to navigate through traffic and position itself effectively.

4. MQ3 Alcohol Sensor:

· Detects the presence of alcohol vapors in the vicinity. This sensor is crucial for identifying potentially intoxicated drivers, prompting necessary intervention from law enforcement.

5. MQ2 Smoke Sensor:

· Monitors the levels of smoke and other harmful gases emitted by vehicles. It helps in enforcing emissions standards and identifying vehicles with malfunctioning exhaust systems.

6. Ultrasonic Sensor:

· Measures the distance between the Traffic Police Bot and nearby vehicles. This sensor ensures safe distances are maintained, preventing accidents and congestion.

7. Servo Motor:

· Controls a mechanical arm or barrier to physically stop vehicles when required. The servo motor mechanism allows the bot to intervene and enforce traffic regulations effectively.

Functionality:

· Alcohol and Smoke Detection:

· The MQ3 and MQ2 sensors continuously monitor the air for alcohol and smoke levels. Upon detecting high levels, the bot can alert nearby officers or take immediate action to prevent unsafe driving conditions.

· Traffic Monitoring and Control:

· Utilizes the ultrasonic sensor to assess traffic density and vehicle positions. The bot can navigate through traffic, positioning itself strategically to observe and regulate traffic flow.

· Remote Operation and Intervention:

· Controlled via Bluetooth communication, enabling remote operation and monitoring by traffic police personnel. This capability enhances flexibility and responsiveness in managing traffic situations.

· Safety Barrier Deployment:

· The servo motor can deploy a physical barrier or sign to stop vehicles identified as violating traffic rules or posing safety risks. This feature ensures immediate and effective enforcement of traffic regulations.

Applications:

· Traffic Management: Assists in regulating traffic flow, ensuring compliance with traffic rules, and preventing accidents in congested areas or during peak traffic hours.

· Safety Enforcement: Enhances road safety by identifying and addressing violations such as drunk driving and vehicle emissions beyond permissible limits.

· Event Management: Useful in managing traffic during events, parades, or emergencies where precise control and intervention are required.

Conclusion:

The Traffic Police Bot prototype represents a significant advancement in utilizing robotics and sensor technology for traffic management and safety enforcement. By integrating Arduino control, Bluetooth communication, various sensors, and actuators like DC motors and servo motors, it offers a comprehensive solution to improve road safety and streamline traffic operations under the supervision of traffic authorities.

CIRCUIT DIAGRAM

CODE

   #include <Servo.h>
      #include "SoftwareSerial.h"
   SoftwareSerial HC05(3,2); 
  // /RX,TX/
  int m1=4;
  int m2=5;
  int m3=6;
  int m4=7;
  int BluetoothData;
  int servoPin = 8;
  int servoPin1 = 9;
  int smoke= A1; 
  int alco = A2;
  int alcoValue;
  #define trigPin1 10
  #define echoPin1 11 
  int buzz=12;
  int led=13;
   int smokeSensor;
  // Create a servo object
  Servo Servo1;
  Servo Servo2;
  void setup() {
  pinMode( m1 ,OUTPUT);
  pinMode( m2 ,OUTPUT);
  pinMode( m3 ,OUTPUT);
  pinMode( m4 ,OUTPUT);
   pinMode(trigPin1, OUTPUT);
     pinMode(echoPin1, INPUT);
  
    pinMode(smoke, INPUT);
    
    pinMode(alco, INPUT);
    pinMode(buzz,OUTPUT);
    pinMode(led,OUTPUT);
    HC05.begin(9600);
    Serial.begin(9600);
  // We need to attach the servo to the used pin number
  Servo1.attach(servoPin);
  Servo2.attach(servoPin1);
  }
  void loop() {
  smokeSensor = analogRead(smoke);
  Serial.print("smoke=");
  Serial.println(smokeSensor);
  delay(300);
  alcoValue = analogRead(alco);
  Serial.print("Alco=");
  Serial.println(alcoValue);
  delay(300);
  long duration1, distance1;
    digitalWrite(trigPin1, LOW);
    delayMicroseconds(2);
  
    digitalWrite(trigPin1, HIGH);
    delayMicroseconds(10);
    digitalWrite(trigPin1, LOW);
  
    duration1 = pulseIn(echoPin1, HIGH);
  
    distance1 = (duration1*0.034/2);
    Serial.print("distance=");
    Serial.println(distance1);
    
    
  Servo1.write(180);
  if  (smokeSensor>600)
    {
      digitalWrite(buzz,HIGH);
      
      digitalWrite(led,HIGH);
     Servo1.write(90);
     
    }
    
  
  if  (smokeSensor<600)
    {
      digitalWrite(buzz,LOW);
      Servo1.write(-90);
      digitalWrite(led,LOW);
      delay(1000);
      }
      if  (alcoValue>300)
    {
      digitalWrite(buzz,HIGH);
      
      digitalWrite(led,HIGH);
     Servo2.write(90);
  delay(1000);
    }
    
  
  if  (alcoValue<300)
    {
      digitalWrite(buzz,LOW);
      Servo2.write(-90);
      digitalWrite(led,LOW);
      }
      if (HC05.available())
    {
   BluetoothData=HC05.read();
    Serial.println( BluetoothData);
  if(BluetoothData == 48){            //move forward(all motors rotate in forward direction)
    digitalWrite(m1,HIGH);
    digitalWrite(m2,LOW);
    digitalWrite(m3,LOW);
    digitalWrite(m4,HIGH);
  }
   
  else if(BluetoothData == 51){      //move reverse (all motors rotate in reverse direction)
    digitalWrite(m1,LOW);
    digitalWrite(m2,HIGH);
    digitalWrite(m3,HIGH);
    digitalWrite(m4,LOW);
  }
   
  else if(BluetoothData == 49){      //turn right (left side motors rotate in forward direction, right side motors doesn't rotate)
    digitalWrite(m1,LOW);
    digitalWrite(m2,LOW);
    digitalWrite(m3,HIGH);
    digitalWrite(m4,LOW);
  }
   
  else if(BluetoothData == 56){      //turn left (right side motors rotate in forward direction, left side motors doesn't rotate)
    digitalWrite(m1,HIGH);
    digitalWrite(m2,LOW);
    digitalWrite(m3,LOW);
    digitalWrite(m4,LOW);
  }
   
  else if(BluetoothData == 57){      //STOP (all motors stop)
    digitalWrite(m1,LOW);
    digitalWrite(m2,LOW);
    digitalWrite(m3,LOW);
    digitalWrite(m4,LOW);
  }
  } }

Scroll to Top