0% found this document useful (0 votes)
71 views

Radar For Object Detection

This document describes a RADAR system prototype using an Arduino board that detects stationary and moving objects. It uses an ultrasonic sensor connected to the Arduino to measure the presence, range, and angle of any obstacles. A servo motor is used to rotate the ultrasonic sensor. Processing software visualizes the sensor data, showing the detected object locations on a graphical radar display.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

Radar For Object Detection

This document describes a RADAR system prototype using an Arduino board that detects stationary and moving objects. It uses an ultrasonic sensor connected to the Arduino to measure the presence, range, and angle of any obstacles. A servo motor is used to rotate the ultrasonic sensor. Processing software visualizes the sensor data, showing the detected object locations on a graphical radar display.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

RADAR FOR OBJECT DETECTION

Abstract:
This Arduino RADAR project aims to achieve a radar system prototype based on an Arduino board that
detects stationary and moving objects and visualizing the object locations in Graphical manner using
Processor Software. RADAR is a radio wave based detection system that works by sending radio waves
and then studying the echo or the reflected back waves. The full form of RADAR is RAdio Detection And
Ranging.
1. List of Technical Components with specifications :
1. Arduino Uno
2. Ultrasonic Distance Sensor - HC-SR04
3. Servo Motor (TowerPro SG 90 Micro)

Radar in TinkerCad

Servo Motor

Ultra Sonic Sensor


2. Description of the Project:
This project aims on building the prototype of the RADAR with the use of Ultrasonic Sensor connected to
the Arduino UNO board and the signal from the sensor further provided to the screen formed on the
system to measure presence of any obstacle in front of the sensor as well as to determine the range and
angle at which the obstacle is detected by the sensor.
RADAR :
A radar is an electromagnetic sensor that is used to detect and locate an object. Radio waves or
microwaves are radiated out from the radar into free space. Some of these waves are intercepted by
reflecting objects. These intercepted radio waves hit the target and are reflected in many different
directions. Some of these waves can be directed back toward the radar, where they are received and
amplified. If these waves are received again at their origin, then it means an object is in the propagation
direction. The modern radar system is very advanced and used in highly diverse applications such as Air
traffic control, Air-defence system, radar Astronomy, Antimissile system, Outer space Surveillance
system, and many more.
ULTRASONIC SENSOR :
An ultrasonic sensor is an electronic device that measures the distance of a target object by emitting
ultrasonic sound waves, and converts the reflected sound into an electrical signal. It generates sound
waves beyond the scope of human hearing and measures distance by calculating the time required by
these waves to hit an obstacle and travel back. This is similar to the principle used by bats and cruise
ships. Ultrasonic waves travel faster than the speed of audible sound. Ultrasonic sensors have two main
components: the transmitter (which emits the sound using piezoelectric crystals) and the receiver (which
encounters the sound after it has travelled to and from the target).In order to calculate the distance
between the sensor and the object, the sensor measures the time it takes between the emission of the
sound by the transmitter to its contact with the receiver. The formula for this calculation is D = 1/ 2 T x C
(where D is the distance, T is the time, and C is the speed of sound ≈ 343meters/second).
SERVO MOTOR :
A servomotor is a rotary actuator that allows for precise control of angular position and speed. A normal
servo motor has three terminals:
1.VCC
2. GND
3. PULSE
A servo motor works at normally 4.8 to 6 volts. The total time for servo motor pulse is usually 20ms. To
move it to one end of say 0 degree angle, a 1ms pulse is used and to move it to other end i.e 180
degrees, a 2ms pulse is applied. Hence, according to this to move the axis of the servo motor to the
center, a pulse of time 1.5 ms should be applied. For this, the pulse wire of the servo motor is connected
to the Arduino that provides the digital pulses for pulse width modulation of the pulse. Hence, by
programming for a particular pulse interval the servo motor can be controlled easily. It differs from the
usual DC motor that it can turn very precisely to a given angular position and hold its state there. When a
servo motor is given pulses of a specific duration, it moves to the corresponding angular position.
Normally this type of motor consists of a control circuit that provides feedback on the current position of
the motor shaft, this feedback allows the servo motors to rotate with great precision. If you want to
rotate an object at some specific angles or distance, then you use a servo motor. It is just made up of a
simple motor which runs through a servo mechanism. This motor will only rotate as much we want and
then stop. The servo motor is a closed-loop mechanism that uses positional feedback to control the
speed and position. PROCESSING SOFTWARE : Processing is a free graphical library and integrated
development environment (IDE) which uses java language to visualize data. It provides a graphical user
interface for the projects in Arduino.It can read the data from the serial port from arduino and can use it
for visualization and processing.
3. Circuit Diagram of the Project

Set Up

Setup

Processor Software Visual Interface


4. Source Code
Arduino Code:
#include<Servo.h>
const int trigPin = 12;
const int echoPin = 13;
float duration, distance;
Servo Myservo;
int pos;
void setup()
{
Myservo.attach(7);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(11, OUTPUT);
digitalWrite(11, HIGH);
Serial.begin(9600);
}
void loop()
{
for(pos=0;pos<180;pos++){
Myservo.write(pos);
delay(15);
Serial.print(pos);
Serial.print(",");
calculateDistance();
Serial.print("&");

}
//delay(1000);
for(pos=180;pos>0;pos--)
{
Myservo.write(pos);
delay(15);
Serial.print(pos);
Serial.print(",");
calculateDistance();
Serial.print("&");
}
//delay(1000);
}

void calculateDistance(){

digitalWrite(trigPin, LOW);
delayMicroseconds(2);// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(2);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH); // Reads the echoPin, returns the sound wave travel time in
microseconds
distance= duration*0.034/2;
//Serial.print(distance);
//Serial.println("cms");
return distance;
}
Processing Software Code:
import processing.serial.*; // imports library for serial communication
import java.awt.event.KeyEvent; // imports library for reading the data from the serial
port
import java.io.IOException;
Serial myPort; // defines Object Serial
// defubes variables
String angle="";
String distance="";
String data="";
String noObject;
float pixsDistance;
int iAngle, iDistance;
int index1=0;
int index2=0;
PFont orcFont;
void setup() {

size (1200, 700); // ***CHANGE THIS TO YOUR SCREEN RESOLUTION***


smooth();
myPort = new Serial(this,"COM5", 9600); // starts the serial communication change it to
your Serial port
myPort.bufferUntil('&'); // reads the data from the serial port up to the character '.'. So
actually it reads this: angle,distance.
}
void draw() {

fill(98,245,31);
// simulating motion blur and slow fade of the moving line
noStroke();
fill(0,4);
rect(0, 0, width, height-height*0.065);

fill(98,245,31); // green color


// calls the functions for drawing the radar
drawRadar();
drawLine();
drawObject();
drawText();
}
void serialEvent (Serial myPort) { // starts reading data from the Serial Port
// reads the data from the Serial Port up to the character '&' and puts it into the String
variable "data".
data = myPort.readStringUntil('&');
data = data.substring(0,data.length()-1);

index1 = data.indexOf(","); // find the character ',' and puts it into the variable "index1"
angle= data.substring(0, index1); // read the data from position "0" to position of the
variable index1 or thats the value of the angle the Arduino Board sent into the Serial Port
distance= data.substring(index1+1, data.length()); // read the data from position
"index1" to the end of the data pr thats the value of the distance

// converts the String variables into Integer


iAngle = int(angle);
iDistance = int(distance);
}
void drawRadar() {
pushMatrix();
translate(width/2,height-height*0.074); // moves the starting coordinats to new
location
noFill();
strokeWeight(2);
stroke(98,245,31);
// draws the arc lines
arc(0,0,(width-width*0.0625),(width-width*0.0625),PI,TWO_PI);
arc(0,0,(width-width*0.27),(width-width*0.27),PI,TWO_PI);
arc(0,0,(width-width*0.479),(width-width*0.479),PI,TWO_PI);
arc(0,0,(width-width*0.687),(width-width*0.687),PI,TWO_PI);
// draws the angle lines
line(-width/2,0,width/2,0);
line(0,0,(-width/2)*cos(radians(30)),(-width/2)*sin(radians(30)));
line(0,0,(-width/2)*cos(radians(60)),(-width/2)*sin(radians(60)));
line(0,0,(-width/2)*cos(radians(90)),(-width/2)*sin(radians(90)));
line(0,0,(-width/2)*cos(radians(120)),(-width/2)*sin(radians(120)));
line(0,0,(-width/2)*cos(radians(150)),(-width/2)*sin(radians(150)));
line((-width/2)*cos(radians(30)),0,width/2,0);
popMatrix();
}
void drawObject() {
pushMatrix();
translate(width/2,height-height*0.074); // moves the starting coordinats to new
location
strokeWeight(9);
stroke(255,10,10); // red color
pixsDistance = iDistance*((height-height*0.1666)*0.025); // covers the distance from
the sensor from cm to pixels
// limiting the range to 40 cms
if(iDistance<40){
// draws the object according to the angle and the distance
line(pixsDistance*cos(radians(iAngle)),-pixsDistance*sin(radians(iAngle)),(width-
width*0.505)*cos(radians(iAngle)),-(width-width*0.505)*sin(radians(iAngle)));
}
popMatrix();
}
void drawLine() {
pushMatrix();
strokeWeight(9);
stroke(30,250,60);
translate(width/2,height-height*0.074); // moves the starting coordinats to new
location
line(0,0,(height-height*0.12)*cos(radians(iAngle)),-(height-
height*0.12)*sin(radians(iAngle))); // draws the line according to the angle
popMatrix();
}
void drawText() { // draws the texts on the screen
pushMatrix();
if(iDistance>40) {
noObject = "Out of Range";
}
else {
noObject = "In Range";
}
fill(0,0,0);
noStroke();
rect(0, height-height*0.0648, width, height);
fill(98,245,31);
textSize(25);

text("10cm",width-width*0.3854,height-height*0.0833);
text("20cm",width-width*0.281,height-height*0.0833);
text("30cm",width-width*0.177,height-height*0.0833);
text("40cm",width-width*0.0729,height-height*0.0833);
textSize(40);
text("ECE-RGUKT-BASAR", width-width*0.875, height-height*0.0277);
text("Angle: " + iAngle +" °", width-width*0.48, height-height*0.0277);
text("Distance: ", width-width*0.26, height-height*0.0277);
if(iDistance<40) {
text(" " + iDistance +" cm", width-width*0.225, height-height*0.0277);
}
textSize(25);
fill(98,245,60);
translate((width-width*0.4994)+width/2*cos(radians(30)),(height-height*0.0907)-
width/2*sin(radians(30)));
rotate(-radians(-60));
text("30°",0,0);
resetMatrix();
translate((width-width*0.503)+width/2*cos(radians(60)),(height-height*0.0888)-
width/2*sin(radians(60)));
rotate(-radians(-30));
text("60°",0,0);
resetMatrix();
translate((width-width*0.507)+width/2*cos(radians(90)),(height-height*0.0833)-
width/2*sin(radians(90)));
rotate(radians(0));
text("90°",0,0);
resetMatrix();
translate(width-width*0.513+width/2*cos(radians(120)),(height-height*0.07129)-
width/2*sin(radians(120)));
rotate(radians(-30));
text("120°",0,0);
resetMatrix();
translate((width-width*0.5104)+width/2*cos(radians(150)),(height-height*0.0574)-
width/2*sin(radians(150)));
rotate(radians(-60));
text("150°",0,0);
popMatrix();
}

5. Construction and Testing


Steps to setup the RADAR :
1. Connect the +Vcc of the Ultrasonic sensor and the Servo motor to the voltage supply of the
Arduino and Ground to the ground.
2. Now connect the Trig pin and Echo pin of ultrasonic sensor to the Digital out pins of the
Arduino. Connect the Digital out pin to the servo motor signal pin. By this the connections of the Setup is
completed.
Steps for the installation of Arduino IDE, Processing Software and code execution :
1. Download the latest Arduino IDE from the official Arduino website (arduino.cc) and Processing
Software from its official website (processing.org) and install them on your system.
2. Now open the Arduino IDE and paste the code provided above. After uploading the code, the
servo motors start running from 0 to 180 degrees and again back to 0 degrees. The ultrasonic sensor also
rotates along with the servo as it is mounted on the motor. You can change the pin numbers as per your
requirement and dump the code into Arduino. You can view the distance values and current angle of the
rotation of Servo motor in the serial monitor present at the top right in the Arduino IDE. If the ultrasonic
sensor detects any object within its range, you can see the same on the graphical representation. Now
open the Processing software and paste the Processing code. Here you have to change the port number
to read values from the specified port. Now you can execute the code then 4 it will create an interface
with labelled graph of angles and distance with indiaction of moment of sensor direction. Testing : Now
place any object in the range of the radar then you can see the red labelled portion in the processing
interface indicating the projected structure(front side) of the object. At the bottom of the interface you
can also find the distance of the object fom the radar position. 8. Technical Challenges faced and
solutions Problem : The major issue you may face while doing this project is that the interface may not
open or you may find difficulty while opening the processing software on your system. Possible Solutions
: This problem araises because the system specifications may not reached the Software version
requirements. We have two possible solutions for this problem. 1. Instead of installing the latest
version(4.0.1) of Processing Software, install the 2.2.1 version. 2. Extract the files in downloaded zip
files(application) and copy the folder to program files in C: drive and try to run the software exe file in it.
6. Applications
1. Military : RADARs have a wide range of usage in military operations. They are used in Naval,
Ground as well as Air defence purposes. They are used for detection, tracking and surveillance purposes
also. Weapon control and missile guidance often use various types of RADARs.
2. Law Enforcement: Law enforcement, especially highway police, has extensive use of RADARs
during a pursuit to measure the speed of a vehicle. Due to bad weather conditions, when the satellite
cannot get a clear image of traffic and barricades, RADARs are used to get the desired results.
3. Space: RADARs in satellites are used for remote sensing. RADARs are used to track and detect
satellites and spacecraft. They are also used for safely landing and docking spacecraft.
4. Remote Sensing of Environment: This technology is also used to detect weather conditions of
the atmosphere.
5. Planetary Observations: It is also used for tracking the motions of planets, asteroids and other
celestial bodies in the solar system.
6. Aircraft Navigation: Ground mapping and weather avoidance RADARs are used in aircraft to
navigate them properly. This technology enables an aircraft to ensure the location of obstacles that can
threaten the flight plan.
7. Navigating Ships: Ships are guided through high resolution RADARs situated on the shores.
Because of poor visibility in bad weather conditions, RADARs provide safety by warning threats. These
ships often use this technology to measure the proximity of other ships and their speed on the water.
8. Air Traffic Controller: RADARs are used to safely control air traffic. It is used to guide aircraft
for proper landing and take-off during bad weather conditions. These RADARs also detect the proximity
and the altitude of the aircraft.
7. Advantages
1. RADAR can penetrate mediums such as clouds, fogs, mist, and snow. The signals used by
RADAR technology are not limited or hindered by snow, clouds, or fog. This means that even in the
presence of these adverse conditions, data will still be collected.
2. It can give the exact position of an object. RADAR systems employ the use of electromagnetic
to calculate the distance of an object and its exact position on the earths surface or space.
3. It can determine the velocity of a target. RADAR systems have the capability of calculating the
velocity of an object in motion. Besides knowing its location, you will also have data regarding the
velocity of the object.
4. It can measure the distance of an object. RADAR systems work by measuring the exact
distance of an object from the transmitter.
5. It can tell the difference between stationery and moving targets. The data collected by RADAR
systems is enough to tell whether the object was in motion or it was stationary.
6. RADAR signals do not require a medium of transportation. RADAR employs the use of radio
signals that can travel in air or space. They do not require any medium to be transported.
7. RADAR signals can target several objects simultaneously. The radio signals used by RADAR
operate on a wider area and can target more than one object and return data regarding all the objects
targeted. 8. The data captured by RADAR systems can be used to map an area and provide 3D images of
the area based on the varying angles of return.
9. It is wireless and does not rely on wire connectivity. Radio signals do not require a medium to
travel therefore there is no need for wire connectivity.
10. It covers a wider geographical area. The radio signals emitted by RADAR systems cover a
significantly large geographical area at once.
11. It allows for repetitive coverage. RADAR systems are not limited to single coverage of a
target. They can provide the same information multiple times about a target.
12. It is fast if the area is not too large. RADAR systems return data quite fast if the area under
observation is not too wide.
8. Disadvantages
1. The precise shape of the object cannot be predicted as the waves reach only the front side of
the object. It cannot depict the rear side structure of the object.
2. RADAR takes more time to lock on an object. Since radio signals travel freely in air and space,
it takes more time to get to the object and back.
3. RADAR has a wider beam range (Over 50ft Diameter). The beam range for RADAR is quite wide
and not target specific.
4. Large objects that are close to the Transmitter can saturate the receiver. The radio signals
work best when the object is further away from the receiver and not closer.
5. RADAR can be interfered with by several objects and mediums in the air. The radio signals face
plenty of interference from the air while traveling to and from an object.
6. The ultrasonic sensor used in this project has low range. It cannot detect the objects beyond
it.
7. This sensor cannot locate some small uneven surfaced objects.
8. It can be interrupted by other signals.
9. Future Development
1. The modern uses of radar are highly diverse, radar astronomy, marine radar start locate
landmarks and other ships, ocean surveillance systems, outer space surveillance, meteorological
precipitation monitoring, altimetry and flight control systems, guided missile target locating systems, and
ground-penetrating radar for geological observations.
2. Hightech radar systems are associated with digital signal processing and are capable of
extracting useful information from very high noise levels.
10.References
1. arduino.cc

You might also like