Difference between revisions of "2019WinterTeam4"

From MAE/ECE 148 - Introduction to Autonomous Vehicles
Jump to: navigation, search
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
 
The goal of our project is to create a '''smart traffic light'''. We created structures for ultrasonic sensors to detect the car's presence and manage traffic. Utilizing the idea of smart infrastructure, smart cars are able to become more effective and optimizing traffic. We are able to turn off street lighting when it is unused and give priority to emergency vehicles. This simple model minimizes cost and complexity. This project surrounds the problem of directing traffic when 2 way streets merge into 1 on a mountain road.
 
The goal of our project is to create a '''smart traffic light'''. We created structures for ultrasonic sensors to detect the car's presence and manage traffic. Utilizing the idea of smart infrastructure, smart cars are able to become more effective and optimizing traffic. We are able to turn off street lighting when it is unused and give priority to emergency vehicles. This simple model minimizes cost and complexity. This project surrounds the problem of directing traffic when 2 way streets merge into 1 on a mountain road.
 
Our GitHub repository can be found here: [https://github.com/Jupiderp/ECEMAE148Team4Winter2019.git]
 
  
 
[[File:Team4car.jpg | 500px]]
 
[[File:Team4car.jpg | 500px]]
Line 12: Line 10:
  
 
Kaj Kuchina
 
Kaj Kuchina
 
  
 
== Mountain Road Model ==
 
== Mountain Road Model ==
Line 21: Line 18:
  
 
[[File:Arduino_US_LED_bb.jpg | 400px]]
 
[[File:Arduino_US_LED_bb.jpg | 400px]]
 
 
[[File:Arduino_US_LED_schem.jpg | 400px]]
 
[[File:Arduino_US_LED_schem.jpg | 400px]]
  
  
 
== STL Models ==
 
== STL Models ==
 +
 +
 +
 +
== Decreasing Ultrasonic Variability ==
 +
Car Detection
 +
If range is less than baseline, car present
 +
Real world objects aren’t flat or stationary
 +
Flat acrylic plates placed across track helps with consistency
  
  
Line 70: Line 74:
 
   }
 
   }
 
  }
 
  }
 +
 +
== Demo ==
 +
[[File:Demo2.mp4 | 600px]]
  
 
== Resources ==
 
== Resources ==

Revision as of 23:07, 22 March 2019

Introduction

The goal of our project is to create a smart traffic light. We created structures for ultrasonic sensors to detect the car's presence and manage traffic. Utilizing the idea of smart infrastructure, smart cars are able to become more effective and optimizing traffic. We are able to turn off street lighting when it is unused and give priority to emergency vehicles. This simple model minimizes cost and complexity. This project surrounds the problem of directing traffic when 2 way streets merge into 1 on a mountain road.

Team4car.jpg

Team Members

Justine Lee

Mihir Sathe

Kaj Kuchina

Mountain Road Model

MountainModel.png

Circuit Schematics

Arduino US LED bb.jpg Arduino US LED schem.jpg


STL Models

Decreasing Ultrasonic Variability

Car Detection If range is less than baseline, car present Real world objects aren’t flat or stationary Flat acrylic plates placed across track helps with consistency


Arduino Code

#include <NewPing.h>
#define SONAR_NUM 2      // Number of sensors.
#define MAX_DISTANCE 100 // Maximum distance (in cm) to ping.
#define THRESH 40
#define led_g 7
#define led_r 8
NewPing sonar[SONAR_NUM] = {   // Sensor object array.
  NewPing(10, 9, MAX_DISTANCE), // Each sensor's trigger pin, echo pin, and max distance to ping.
  NewPing(6, 5, MAX_DISTANCE),
};
void setup() {
  Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
  pinMode(led_r, OUTPUT);
  pinMode(led_g, OUTPUT);
  digitalWrite(led_g, LOW);
  digitalWrite(led_r, HIGH);
}
void loop() {
  Serial.print(sonar[0].ping_cm());
  Serial.print(",");
  delay(50); // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
  Serial.println(sonar[1].ping_cm());
  if (sonar[0].ping_cm() < THRESH) {
    digitalWrite(led_g, HIGH);
    digitalWrite(led_r, LOW);
    delay(1000);
  }
  else if (sonar[1].ping_cm() < THRESH) {
    digitalWrite(led_g, LOW);
    digitalWrite(led_r, HIGH);
  }
  else {
    digitalWrite(led_g, LOW);
    digitalWrite(led_r, LOW);
  }
}

Demo

Resources

Traffic Light STL:

https://www.thingiverse.com/thing:2826057 

NewPing Arduino Library :

https://playground.arduino.cc/Code/NewPing