Professional Documents
Culture Documents
PROJECT
TEAM-22
Team Members
HP AL SK HS
Himanshu Panwar Anurag Lakra Shagun Katariya Harsh Saini
20GG20023 20EC30004 20HS20050 20CH30009
2
Topic : RADAR using an ultrasonic sensor
3
Materials required
Breadboard Arduino
Uno
Servo motor
ultrasonic
4
sensor
TINKERCAD DIAGRAM
5
BIG CONCEPT
The Arduino sends a HIGH pulse width on the TRIGGER pin of the sensor to
regenerate a series of ultrasonic waves that propagate through the air until it
touches an obstacle and returns in the opposite direction towards the sensor pin
ECHO. The sensor detects the width of the pulse to calculate the distance of the
object.
6
Continued …
The signal on pin ECHO of the sensor remains at the HIGH position
during transmission, thereby measuring the duration of the round trip
of ultrasonic and thus determine the distance, then the output is
displayed on the computer screen using Processing software.
Meanwhile, the servo motor slowly rotates back and forth between 0°
and 180°.
7
VIDEO DEMONSTRATION
8
Roadmap
In week 1, we gathered all In week 2, we started
the information related to working on the coding part
our project. of our project.
1 2
3 4
In week 3, we got all the In the last week, we made some changes in
components and started the Processing coding and prepared the
assembling the model. video demonstration.
9
Arduino code
#include <Servo.h>
int trig = 9, echo = 10, servopin = 11;
int time;
float cm;
int i;
Servo servo;
void setup() {
// put your setup code here, to run once:
// selecting pinmode
pinMode(trig, OUTPUT);
pinMode(echo, INPUT);
Serial.begin(9600);
servo.attach(servopin);
}
void loop() {
// put your main code here, to run repeatedly:
for(i = 0;i<=180;i++){
servo.write(i);
cm = TimeToDistanceCM();
10
Continued…
printToSerial();
delay(100);
}
for(i=180;i>=0;i--){
servo.write(i);
cm = TimeToDistanceCM();
printToSerial();
delay(100);
}
int getUltraSonicTime()
{
delayMicroseconds(2);
11
Continued…
delayMicroseconds(10);
digitalWrite(trig, LOW);
float TimeToDistanceCM()
{
time = getUltraSonicTime();
void printToSerial()
{
Serial.print(i);
Serial.print("*");
Serial.print(cm);
Serial.print("#");
}
12
Processing code
Serial myPort;
String serialAngle;
String serialDistance;
String serialData;
float ObjectDistance;
int radarAngle, radarDistance, index, Range = 60;
ToxiclibsSupport gfx;
void setup()
{
size (1366, 710);
gfx = new ToxiclibsSupport(this);
smooth();
//assigning port
13
Continued…
myPort.bufferUntil('#');
}
void draw()
{
//setting Background to black
fill(0, 4);
noStroke();
rect(0, 0, 1366, 710);
//pushMatrix();
translate(683, 660);
noFill();
strokeWeight(2);
stroke(10,255,10);
arc(0, 0, 1300, 1300, PI, TWO_PI);
arc(0, 0, 1050, 1050, PI, TWO_PI);
arc(0, 0, 720, 720, PI, TWO_PI);
arc(0, 0, 480, 480, PI, TWO_PI);
strokeWeight(4);
line(-683,0,683,0);
14
Continued…
//rotating arcs
RotatingArcs();
void RotatingArcs()
{
noStroke();
fill(10, 255, 10, 50);
ObjectDistance = radarDistance*15;
if(radarDistance<Range){
noStroke();
15
Continued…
fill(255, 5, 5);
arc(0, 0, 1300, 1300, -radians(radarAngle + .5), -radians(radarAngle - 0.5));
fill(10, 255, 10);
arc(0, 0, ObjectDistance, ObjectDistance, -radians(radarAngle + .5), -radians(radarAngle - 0.5));
}
radarAngle = int(serialAngle);
radarDistance = int(serialDistance);
}
16
Image imported in Processing
code
17
WORK DISTRIBUTION
Himanshu Panwar Anurag Lakra
He managed to do all the work Anurag did all the assembling of
related to arduino code and also our project and made the video of
the weekly presentations. the working.
18
PROBLEMS & SOLUTIONS
We faced many problems like delay in components and faulty components but they
all were minor problems and were managed properly by the team members, but the
major problem we faced was to code the visuals on Processing software, as it was
bit new for all of us.
So to cope up with this problem we gave quite bit of time to learn the software and
watched several tutorials available online.
19
THANK YOU
From Team - 22
20