0% found this document useful (0 votes)
1K views38 pages

Radar System Project Report

The document describes a project to build an object detection radar system using an Arduino microcontroller. It will use an ultrasonic sensor to detect and measure the distance to objects. The Arduino will process the sensor data and display a radar-like representation of detected objects on a screen. Components discussed include the Arduino, ultrasonic sensor, power adapter, servo motor and jumper wires. The objective is to create a basic radar system that can detect objects within its range.

Uploaded by

Faisal Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views38 pages

Radar System Project Report

The document describes a project to build an object detection radar system using an Arduino microcontroller. It will use an ultrasonic sensor to detect and measure the distance to objects. The Arduino will process the sensor data and display a radar-like representation of detected objects on a screen. Components discussed include the Arduino, ultrasonic sensor, power adapter, servo motor and jumper wires. The objective is to create a basic radar system that can detect objects within its range.

Uploaded by

Faisal Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

OBJECT DETECTION RADAR SYSTEM

OBJECT DETECTION RADAR SYSTEM

A PROJECT REPORT SUBMITTED TO

BHARATI VIDYAPEETH
(DEEMED TO BE
UNIVERSITY)
COLLEGE OF ENGINEERING, PUNE.

ACADEMIC YEAR 2023-24

IN THE SUBJECT OF
ESSENTIALS OF INTERNET OF THINGS (PBL)

UNDER THE
GUIDANCE OF
Prof. R .G. KHALKAR

SUBMITTED BY:

FAISAL KHAN (Roll No. 33)


MUKUL LAKHANI (Roll No. 44)
TUSHAR (Roll No. 37)
AVNISH KASHYAP (Roll No. 31)
VANSHIKA KHANCHANDANI(Roll No. 34)

1
OBJECT DETECTION RADAR SYSTEM

ABSTRACT

Radar (Radio Detection and Ranging) is a critical technology used in various applications,
including aviation, weather monitoring, and security systems. In this project, we explore the
development of a radar system using Arduino, a versatile and cost-effective microcontroller
platform. The primary objective is to create a basic radar system that can detect and display the
presence of objects within its range.
The project leverages ultrasonic or microwave sensor technology for distance measurement
and detection. The Arduino platform is used to control the sensor, process the collected data,
and visualize the radar-like representation on a screen or display

2
OBJECT DETECTION RADAR SYSTEM

INDEX

S. No TOPIC PAGE NO
1 INTRODUCTION & COMPONENTS 4
1.1 WHAT IS ARDUINO 5
1.11 WHY ARDUINO 6
1.12 ADVANTAGES 7
1.2 ULTRA SONIC SENSOR 8-11
1.3 5V ADAPTOR 12
1.4 SERVO MOTOR 13-14
1.5 JUMPER WIRES 15-16
2 OBJECTIVE 17
3 PROCEDURE 18-19
4 WORKING 20-21
5 CODE FOR ARDUINO 22-24
6 PROCESSING CODE 25-31
7 CIRCUIT DIAGRAM 32-34
8 OUTPUT IMAGES 35
9 FUTURE SCOPE 36
10 CONCLUSION 37
11 REFERENCES 38

3
OBJECT DETECTION RADAR SYSTEM

1. INTRODUCTION

Radar, short for Radio Detection and Ranging, is a technology that has been a cornerstone in
various fields such as aviation, military, meteorology, and maritime navigation for decades.
Radar systems are instrumental in detecting, tracking, and identifying objects and targets by
transmitting radio waves and analyzing their reflections. These systems provide critical
information on object location, speed, and other characteristics, making them indispensable in
a multitude of applications.

This project aims to explore the design and implementation of a radar system using Arduino as
the core control and processing unit. Utilizing various sensors, data processing algorithms, and
visualization techniques, this system can emulate the basic principles of traditional radar, albeit
on a smaller scale. The project not only serves as a hands-on learning experience for electronics
and programming enthusiasts but also as a foundation for potential applications in surveillance,
automation, or even just for the fun of experimenting with radar technology.

COMPONENTS:

• Arduino Uno
• Ultrasonic sensor
• 5V Adapter
• Servo Motor
• Jumper Wires

4
OBJECT DETECTION RADAR SYSTEM

1.1 WHAT IS ARDUINO?

Arduino is a project made by the largest technical community of engineers, developers, and
hobbyists whose goal is to develop ideas and interactive control projects around the world,
based on different types of electronic panels but programmed in a language Single
programming and free. Sure, Arduino is not the only electronic controller in the market, but
there are many microcontrollers available in the market such as Parallax, Basic Stamp and the
most powerful competitor, Raspberry Pi, all with powerful capabilities and the ability to work.
Full projects, of course depending on the needs of your project, but what distinguishes the
following Arduino Open-Source Platform Open-Source Hardware and Software. This is the
most important feature for electronic circuit designers because it makes it easier for them to
design anything they want the software is written in C ++ and is available to everyone to
download and programmers can modify it according to their needs. It is the most widely used
and widely used one of the many Arduinos. It is the first choice for beginners. It is easy to
learn. It operates with an ATmega328 controller. This type has 14 digital ports (I / O), 6 of
which can be used as ports to control the "PWM Outputs ", the most important feature of this
type is that the control chip" ATmega328 "is not fixed in the board but installed on the holder
of the integrated circuit" IC".

Arduino Board

5
OBJECT DETECTION RADAR SYSTEM

The ATmega328 controller is like the same model. The first-ever type of Arduino's
motherboard is theATmega32u4 controller, which has a unique feature that contains a built-in
USB connection, eliminating the need to use a secondary processor.

The feature allows the panel as soon as it is connected to your device to appear as a keyboard
and mouse, which makes it ideally suited to build various applications that enable you to
control your PC.

1.11 WHY ARDUINO?

Thanks to its simple and accessible user experience, Arduino has been used in thousands of
different projects and applications. The Arduino software is easy-to-use for beginners, yet
flexible enough for advanced users. It runs on Mac, Windows, and Linux. Makers, of course,
use it to build many of the projects exhibited at the Maker Faire, for example. Arduino is a
key tool to learn new things. Arduino also simplifies the process of working with
microcontrollers, but it offers some advantage for teachers, students, and interested amateurs
over other systems:

• Inexpensive - Arduino boards are relatively inexpensive compared to other


microcontroller platforms. The least expensive version of the Arduino module can be
assembled by hand.

• Cross platform - The Arduino Software (IDE) runs on Windows, Macintosh OSX,
and Linux operating systems. Most microcontroller systems are limited to Windows.

• Simple, clear programming environment - The Arduino Software (IDE) is easy-to-


use for beginners, yet flexible enough for advanced users to take advantage of as well.
For teachers, it's conveniently based on the Processing programming environment, so
students learning to program in that environment will be familiar with how the Arduino
IDE works.

• Open source and extensible software - The Arduino software is published as open-
source tools, available for extension by experienced programmers. The language can
be expanded through C++ libraries, and people wanting to understand the technical
details can make the leap from Arduino to the AVR C programming language on which

6
OBJECT DETECTION RADAR SYSTEM

it's based. Similarly, you can add AVR-C code directly into your Arduino programs if
you want to.

• Open source and extensible hardware - The plans of the Arduino boards are
published under a Creative Commons license, so experienced circuit designers can
make their own version of the module, extending it and improving it.

➢ 1.12Advantages of Arduino

• Simplicity - Arduino's paintings are designed to suit the needs of all engineers,
designers, professors, students, and interactive electronics enthusiasts around the
world.

• The Price - The Arduino Plate is less expensive than any competitor of the same type.

• Self-Assembly - Easy to deal with and easy to connect circuits, it is an easy solution
to the problem of microcontrollers and complex connections.

• Multi-platform - The Arduino program can work with all the different operati ng
systems of Windows, Mac, and Linux, while most other boards running on Windows only

• Easy and simple software environment - The

"Environment" programming environment is designed to be easy for beginners and


powerful professionals and its programming language "Arduino C" is easy to learn.

ARDUINO RADAR

7
OBJECT DETECTION RADAR SYSTEM

1.2 ULTRA SONIC SENSOR


Utilizing an ultrasonic sensor in an Arduino-based radar implementation is a cost-effective and
straightforward way to detect objects' presence and measure their distance within a certain
range. Ultrasonic sensors work on the principle of sending out high-frequency sound waves
and then measuring the time it takes for the sound waves to bounce off an object and return.
This time measurement can be used to calculate the distance to the object. Below is a step-by-
step guide on how to use an ultrasonic sensor in your Arduino radar project:

Hardware Setup:

1. Ultrasonic Sensor Selection: Choose an appropriate ultrasonic sensor. Common choices


include the HC-SR04 or similar modules, which are readily available and compatible
with Arduino.

2. Connection to Arduino: Wire the ultrasonic sensor to the Arduino as follows:

• Connect the VCC pin of the ultrasonic sensor to the 5V output on the Arduino.

• Connect the GND pin of the ultrasonic sensor to the GND (Ground) on the
Arduino.

• Connect the Trigger (TRIG) pin of the ultrasonic sensor to a digital output pin
on the Arduino (e.g., D2).

• Connect the Echo (ECHO) pin of the ultrasonic sensor to a different digital input
pin on the Arduino (e.g., D3).

3. Power Supply: Ensure that the power supply to your Arduino is stable and can provide
sufficient current for both the Arduino board and the ultrasonic sensor.

Data Processing and Visualization:

Depending on the specific requirements of your radar project, you can use the distance
measurements from the ultrasonic sensor to create a radar-like display on a screen or any other
output device. This might involve using servos or motors to rotate the sensor or creating a
graphical interface on a computer or LCD display.

8
OBJECT DETECTION RADAR SYSTEM

By following these steps and customizing your code and hardware setup, you can create a basic
radar-like system using an ultrasonic sensor and Arduino. Keep in mind that this is a simplified
example, and more complex radar systems can be developed by adding

Ultrasonic sensors offer several advantages in various applications due to their versatility and
ease of use. Some of the primary advantages of ultrasonic sensors include:

1. Non-Contact Sensing: Ultrasonic sensors do not require physical contact with the
object they are measuring, making them non-invasive. This is particularly useful for
applications where contact with the object is undesirable or infeasible, such as
measuring the level of liquids or detecting the presence of objects.

2. Distance Measurement: Ultrasonic sensors are excellent for distance measurement.


They can accurately measure distances by emitting sound waves and measuring the
time it takes for the waves to bounce back. This makes them suitable for tasks like
obstacle detection, level measurement, and proximity sensing.

3. Wide Measurement Range: Ultrasonic sensors can cover a wide range of distances,
from a few centimeters to several meters, depending on the sensor's design and
specifications. This adaptability makes them suitable for various applications, from
close-range to long-range measurements.

4. Accuracy: Ultrasonic sensors provide reasonably high accuracy in distance


measurement, especially within their effective range. They are often precise enough for
most applications, and some advanced models offer even greater accuracy.

5. Fast Response Time: Ultrasonic sensors have fast response times, typically providing
distance measurements in milliseconds. This quick response is essential for applications
that require real-time data, such as robotics, security systems, and automated
machinery.

6. Wide Field of View: Many ultrasonic sensors have a wide field of view, allowing them
to detect objects within a broad area. This is advantageous for applications where you
need to detect objects or obstacles over a large region, such as parking assistance in
automobiles.

9
OBJECT DETECTION RADAR SYSTEM

7. Versatility: Ultrasonic sensors can be used in various environments, including air,


water, and vacuum, depending on the sensor's specifications. This versatility enables
their use in diverse industries and additional features and functionalities.

Disadvantage of ultrasonic sensor

While ultrasonic sensors offer many advantages, they also have some limitations and
disadvantages that should be considered for specific applications. Here are some of the primary
disadvantages of ultrasonic sensors:

1. Limited to Air and Similar Media: Ultrasonic sensors primarily operate in air or other
gases, which can limit their use in applications where contact with liquids or solid
materials is necessary. The presence of certain materials, such as soft fabrics or foam,
can also affect sensor accuracy.

2. Limited Detection of Small Objects: Ultrasonic sensors may have difficulty detecting
very small objects, as the sound waves might not reflect well off of them. This can limit
their effectiveness in applications requiring the detection of tiny or low-density objects.

3. Inaccurate in Harsh Environments: Extreme environmental conditions, including


high humidity, temperature variations, or air turbulence, can affect the accuracy of
ultrasonic sensors. This can be a limitation in applications where consistent and precise
measurements are critical.

4. Limited Angle of Detection: Ultrasonic sensors typically have a limited angle of


detection, which means they might not detect objects that are outside their field of view.
This can be a disadvantage in applications where a wide detection range is required.

5. Limited Resolution: Ultrasonic sensors may have limited resolution in distance


measurements, making them less suitable for applications that demand highly precise
measurements over short distances.

6. Interference and Crosstalk: In environments with multiple ultrasonic sensors


operating simultaneously, interference and crosstalk can occur, leading to inaccurate
measurements. Proper sensor placement and frequency management are necessary to
mitigate these issues.

10
OBJECT DETECTION RADAR SYSTEM

7. Limited Performance in Noisy Environments: Background noise and acoustic


interference in noisy environments can affect the reliability of ultrasonic sensors. In
such cases, additional signal processing or noise filtering may be required to ensure
accurate measurements.

8. Limited Velocity Measurement: While ultrasonic sensors can measure distance


accurately, they may have limitations when it comes to measuring the velocity of
moving objects, especially those moving at high speeds.

9. Limited Material Compatibility: Ultrasonic sensors may not work well with certain
materials that do not reflect sound waves effectively. Absorbent or porous surfaces may
absorb the ultrasonic waves, preventing accurate detection.

10. Power Consumption: Some ultrasonic sensors, especially those with continuous
measurement operation, can consume relatively more power than other sensor types.
This can be a disadvantage in battery-operated applications.

Despite these disadvantages, ultrasonic sensors remain a valuable and versatile tool in various
applications, and many of their limitations can be addressed or mitigated through careful sensor
selection, configuration, and integration into a system.

ULTRASONIC SENSOR

11
OBJECT DETECTION RADAR SYSTEM

1.3 5V ADAPTOR
A 5V adapter is a power supply that provides a constant output voltage of 5 volts direct current
(DC). These adapters are commonly used to power various electronic devices, including:

1. USB Devices: Many USB-powered devices, such as smartphones, tablets, and portable
chargers, require a 5V power supply. In such cases, a 5V adapter with a USB output can
be used.

2. Microcontrollers: Boards like the Arduino and Raspberry Pi often use 5V adapters to
provide a stable power source for projects and prototypes.

3. Wireless Routers and Modems: Networking equipment like routers and modems
often use 5V adapters to ensure continuous operation.

4. LED Lighting: Some LED strips and lighting modules operate on a 5V power supply.
Adapters are used to provide power to these lighting systems.

5. Small Appliances: Certain small appliances, such as fans and cooling pads, may use
5V adapters.

6. Electronics Prototyping: When working on electronics projects, hobbyists and


engineers use 5V adapters to power various components and circuits.

5V adapters typically have a barrel plug or USB connector at one end and a standard AC plug
at the other end. They come in various current ratings (measured in amperes or milliamperes),
so it's important to choose an adapter that can provide sufficient current for the device or circuit
you intend to power. Additionally, the voltage should be stable and regulated to ensure the
proper functioning of the connected devices.

When using a 5V adapter, it's essential to check the adapter's specifications to ensure it meets
the voltage and current requirements of the device or circuit you plan to power. This helps
prevent damage to your equipment and ensures safe and reliable operation.

(5V ADAPTOR)

12
OBJECT DETECTION RADAR SYSTEM

1.4 SERVO MOTOR


A servo motor is a type of rotary actuator that is used for precise control of angular position,
velocity, and acceleration. It is a closed-loop feedback control system, meaning it continuously
monitors and adjusts its position based on feedback from a position sensor, often called a
potentiometer or encoder. Servo motors are commonly used in various applications, including
robotics, automation, industrial machinery, and hobbyist projects, where precise control and
positioning are required.

Here are some key features and characteristics of servo motors:

1. Control and Precision: Servo motors offer precise control over angular position and
velocity. They can maintain a specific angle or rotate at a specific speed with high
accuracy.

2. Feedback System: Servo motors include a built-in feedback system, such as a


potentiometer or an encoder, which continuously provides information about the
motor's current position. This feedback allows the control system to make real-time
adjustments to maintain the desired position.

3. Closed-Loop Operation: The feedback loop makes servo motors operate in a closed-
loop control system. This means they are constantly comparing the desired position
with the actual position and making adjustments as needed.

4. High Torque: Servo motors are capable of delivering high torque, which makes them
suitable for applications requiring precise and strong movements, such as in robotics.

5. Small Size: Servo motors are often compact and lightweight, making them ideal for
applications with space constraints.

6. Quick Response Time: Servo motors have a rapid response time, allowing them to
quickly adapt to changes in the desired position or speed.

7. Low Inertia: Low rotor inertia enables servo motors to accelerate and decelerate
rapidly.

8. Energy Efficiency: Servo motors are energy-efficient because they only consume
power when they are actively moving or maintaining their position.

13
OBJECT DETECTION RADAR SYSTEM

9. Programmability: Many modern servo motors can be programmed to follow specific


motion profiles, making them versatile for various applications.

10. Digital and Analog Control: Servo motors can be controlled digitally (using
microcontrollers or PLCs) or with analog control signals (such as PWM signals).

11. Braking: Some servo motors include a built-in brake mechanism to hold their position
when power is removed.

Servo motors come in various sizes and power ratings, so they can be tailored to specific
applications. They are widely used in robotics for joint actuation, CNC machinery for precise
control of tool movement, cameras for stabilization, and many other applications where
accurate and controlled motion is required.

In summary, servo motors are essential components in a wide range of applications that demand
precision, control, and accuracy in angular position and velocity. They are a critical part of
automation and robotics systems, helping to perform intricate tasks with high reliability.

SERVER MOTOR

14
OBJECT DETECTION RADAR SYSTEM

1.5 JUMPER WIRES


Jumper wires are electrical wires with connectors at each end that are typically used for making
temporary connections in electronic and electrical circuits. These wires are a fundamental
component in electronics prototyping, allowing you to quickly and easily connect various
components like microcontrollers, sensors, and other electronic modules on a breadboard or a
circuit board. Jumper wires come in various types, lengths, and connector styles, making them
versatile for different applications. Here are some key features and uses of jumper wires:

Key Features of Jumper Wires:

1. Connector Types: Jumper wires come with a variety of connector types, including
male-to-male, male-to-female, and female-to-female connectors. Male connectors have
exposed pins, female connectors have sockets, and male-to-female wires combine both.

2. Length Variations: Jumper wires are available in different lengths, from a few
centimeters to several inches, allowing you to choose the appropriate size for your
project and circuit layout.

3. Color Coding: Jumper wires are often color-coded, which helps in organizing and
distinguishing connections in complex circuits. Common colors include red, black,
blue, green, yellow, and white.

Uses of Jumper Wires:

1. Breadboarding: Jumper wires are widely used in breadboarding, a common method


for prototyping electronic circuits. They enable you to create and modify connections
quickly without soldering.

2. Interconnecting Components: Jumper wires help connect various electronic


components on a breadboard, such as microcontrollers, sensors, LEDs, resistors,
capacitors, and more, facilitating the construction of a functional circuit.

3. Testing and Debugging: When testing or debugging a circuit, you can use jumper
wires to create and change connections to identify and rectify issues or make temporary
connections for measurement and analysis.

4. Prototyping: Jumper wires are an essential tool for prototyping new electronic designs
and concepts. They allow for rapid iterations and experimentation without the need for
permanent connections.

15
OBJECT DETECTION RADAR SYSTEM

5. Education: Jumper wires are commonly used in electronics education to teach students
about circuit construction, connectivity, and troubleshooting.

6. Temporary Connections: Jumper wires are ideal for creating temporary connections
in projects where permanent soldering is not required or practical.

7. Arduino and Raspberry Pi Projects: When working with Arduino or Raspberry Pi


projects, jumper wires are frequently used to connect sensors, displays, and other
components to the microcontroller's pins or GPIO (General Purpose Input/Output)
headers.

8. Modular Electronics: In modular electronics, jumper wires are used to link various
modules together to build customized systems.

Jumper wires are a versatile and essential tool for electronic enthusiasts, hobbyists, students,
and professionals. They simplify the process of building, testing, and modifying electronic
circuits, making them an integral part of any electronics toolkit.

JUMPER WIRES

16
OBJECT DETECTION RADAR SYSTEM

2. OBJECTIVE
The objectives of creating a radar system using Arduino can vary depending on the specific
goals and scope of the project. Generally, such a project aims to achieve the following
objectives:
1. Demonstration of Sensor Technology: Radar projects with Arduino often employ
ultrasonic or microwave sensors. The objective is to demonstrate how these sensors
work, including their ability to emit signals, measure distances, and detect objects.

2. Distance Measurement: One common objective is to use the radar system to


accurately measure the distance between the sensor and detected objects. This can help
users understand the principles of time-of-flight calculations and how they relate to
distance measurement.

3. Object Detection: The radar system aims to detect the presence of objects within a
specified range. This can be useful for applications such as security systems, where
object detection is a key goal.

4. Data Visualization: Another objective is to visualize the data obtained by the radar
system. The system may display object positions as blips on a screen, simulating a
radar-like interface. This helps users understand how data can be presented in a
meaningful way.

5. Real-Time Processing: Implementing real-time data processing is often a goal, where


the radar system continually monitors the environment, detects changes, and updates
the display accordingly.

17
OBJECT DETECTION RADAR SYSTEM

3. PROCEDURE
Creating a basic radar system using Arduino is an educational and hands-on project that
involves several steps. Below is a general procedure to get you started with the construction of
a simple radar-like system. Keep in mind that the specific implementation details and
complexity can vary based on your project goals and the sensors and components you use. In
this example, we'll use an ultrasonic sensor to detect objects and display their positions on a
computer screen.

1. Gather Your Components:

• Arduino board (e.g., Arduino Uno)

• Ultrasonic sensor (e.g., HC-SR04)

• Breadboard and jumper wires

• Computer with Arduino IDE installed

• USB cable for connecting Arduino to the computer

2. Connect the Ultrasonic Sensor:

• Connect the VCC pin of the ultrasonic sensor to the 5V output on the Arduino.

• Connect the GND pin of the ultrasonic sensor to the GND (Ground) on the Arduino.

• Connect the Trigger (TRIG) pin of the ultrasonic sensor to a digital output pin on the
Arduino (e.g., D2).

• Connect the Echo (ECHO) pin of the ultrasonic sensor to a different digital input pin
on the Arduino (e.g., D3).

3. Write the Arduino Code:

• Open the Arduino IDE on your computer.

• Write the Arduino code to control the ultrasonic sensor, read distance measurements,
and send the data to your computer. Here's a basic example:

4. Upload the Code to Arduino:

• Compile and upload the code to your Arduino board via the USB cable.

5. Connect Arduino to Your Computer:

18
OBJECT DETECTION RADAR SYSTEM

• Make sure your Arduino is connected to your computer via the USB cable.

6. Monitor the Serial Output:

• Open the Serial Monitor in the Arduino IDE to view the distance measurements in real-
time.

7. Data Processing and Visualization:

• Create a program on your computer (e.g., in a programming language like Python) to


read the distance data from Arduino through the serial port.

• Implement data processing and visualization, which could include displaying object
positions on a computer screen in a radar-like fashion.

8. Customize and Expand:

• Depending on your objectives, you can customize the project further by adding features
like alarms, graphical interfaces, or data logging.

This procedure provides a simplified example of creating a radar-like system using Arduino
and an ultrasonic sensor. More advanced radar systems would involve multiple sensors,
motorized scanning mechanisms, and more sophisticated data processing.

19
OBJECT DETECTION RADAR SYSTEM

4. WORKING

The working of a radar system using Arduino involves a combination of hardware components
and software to detect objects, measure distances, and display their positions in a radar-like
interface. Here is a step-by-step explanation of how a basic radar system using Arduino
operates:

1. Sensor Emission:

• The radar system typically uses an ultrasonic or microwave sensor (e.g., HC-
SR04) as the emitting source. This sensor emits high-frequency sound waves
(ultrasonic sensor) or radio waves (microwave sensor).

2. Wave Propagation:

• The emitted waves propagate through the air, and once they encounter an object,
some of the waves are reflected back toward the sensor.

3. Wave Detection:

• The same sensor that emitted the waves also serves as the receiver. It listens for
the reflected waves.

4. Time Measurement:

• The Arduino microcontroller constantly measures the time it takes for the
emitted waves to bounce off the object and return to the sensor. This time
measurement is critical for calculating the distance to the object.

5. Distance Calculation:

• Using the speed of sound in the air (approximately 343 meters per second or
34300 centimeters per second), the Arduino calculates the distance to the object.
The formula for distance (d) is:

cssCopy code

d = (time / 2) * speed_of_sound

Here, 'time' is the round-trip time in microseconds.

6. Data Processing:

20
OBJECT DETECTION RADAR SYSTEM

• The Arduino processes the distance measurements and checks for the presence
of objects within a specified range. It may also keep track of the angles at which
objects are detected.

7. Visualization:

• To provide a radar-like display, the Arduino communicates the distance and


angle data to a computer or display interface. The display can be in the form of
a radar screen, with detected objects represented as blips or targets. You can use
a computer program to visualize this data.

8. Continuous Scanning:

• For a more radar-like experience, the Arduino can be programmed to scan the
sensor's field of view continuously. This is achieved by adjusting the orientation
of the sensor (typically with a servo motor) to cover a specific range of angles.
This allows the radar system to detect objects in different directions.

9. Real-Time Feedback:

• The radar system provides real-time feedback, updating the radar screen as
objects move within the sensor's range.

10. Customization and Control:

• The Arduino code can be customized to set detection thresholds, display options, and
other features as needed.

The end result is a simplified radar system that can detect objects, measure their distances, and
display their positions on a screen. While this example is basic and does not replicate the
capabilities of professional radar systems, it serves as an educational and hands-on project for
learning about radar technology and electronics. More advanced radar systems would involve
more sensors, increased accuracy, and additional data processing capabilities.

21
OBJECT DETECTION RADAR SYSTEM

5. CODE FOR ARDUINO


#include <Servo.h>.

const int trigPin = 8;

const int echoPin = 9;

// defining time and distance

long duration;

int distance;

Servo myServo; // Object servo

void setup() {

pinMode(trigPin, OUTPUT); // trigPin as an Output

pinMode(echoPin, INPUT); // echoPin as an Input

Serial.begin(9600);

myServo.attach(10); // Pin Connected To Servo

void loop() {

// rotating servo i++ depicts increment of one degree

for(int i=15;i<=165;i++){

myServo.write(i);

delay(30);

distance = calculateDistance();

Serial.print(i);

Serial.print(“,”);

22
OBJECT DETECTION RADAR SYSTEM

Serial.print(distance);

Serial.print(“.”);

// Repeats the previous lines from 165 to 15 degrees

for(int i=165;i>15;i–){

myServo.write(i);

delay(30);

distance = calculateDistance();

Serial.print(i);

Serial.print(“,”);

Serial.print(distance);

Serial.print(“.”);

int calculateDistance(){

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance= duration*0.034/2;

23
OBJECT DETECTION RADAR SYSTEM

return distance;

24
OBJECT DETECTION RADAR SYSTEM

6. PROCESSING CODE
import processing.serial.*;

import java.awt.event.KeyEvent;

import java.io.IOException;

Serial myPort;// 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 (1366, 768);

smooth();

myPort = new Serial(this,"COM7", 9600); // change this accordingly

myPort.bufferUntil('.'); // reads the data from the serial port up to the character ‘.’. So actually
it reads this: angle,distance.

void draw() {

25
OBJECT DETECTION RADAR SYSTEM

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

26
OBJECT DETECTION RADAR SYSTEM

// 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();

27
OBJECT DETECTION RADAR SYSTEM

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();

28
OBJECT DETECTION RADAR SYSTEM

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("FAISAL KHAN", 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) {

29
OBJECT DETECTION RADAR SYSTEM

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)));

30
OBJECT DETECTION RADAR SYSTEM

rotate(radians(-60));

text("150°",0,0);

popMatrix();

31
OBJECT DETECTION RADAR SYSTEM

7. CIRCUIT DIAGRAM

32
OBJECT DETECTION RADAR SYSTEM

8. OUTPUT
The output of a radar system using Arduino typically involves the display and visualization of
data related to detected objects, their distances, and sometimes their positions. The specific
output format can vary based on the design of your radar system and the goals of your project.
Here are some common output elements of a radar system using Arduino:

1. Distance Data: The most fundamental output of the radar system is the distance
measurements to detected objects. This information is typically displayed in
centimeters and is a numerical representation of the object's distance from the sensor.

2. Object Presence: The radar system can indicate whether an object is detected within
its range. This is often shown as a binary result, such as "Object Detected" or "No
Object Detected."

3. Position Visualization: To create a radar-like display, detected objects are often


represented as blips or targets on a graphical interface. The position of these blips on
the radar screen indicates the direction in which objects are detected.

4. Angle Information: More advanced radar systems may also display the angle at which
detected objects are located. This additional information can provide a sense of the
object's position relative to the radar sensor's orientation.

5. Real-Time Updates: The output is typically updated in real-time, providing continuous


feedback as objects move or as the radar system scans its field of view.

6. Audio or Visual Alerts: Some radar systems may include audio or visual alerts to draw
attention to detected objects. For example, an audible tone or a flashing LED may be
used to signal the presence of an object.

7. Log or Record Data: The radar system may have the capability to log or record the
data over time. This feature is valuable for applications like security monitoring or data
analysis.

8. User Interface: The output can be displayed on various user interfaces, including
computer screens, LCD displays, or dedicated radar screens. The user interface may
offer options for customization and interaction.

33
OBJECT DETECTION RADAR SYSTEM

9. Data Analysis: The data collected by the radar system can be analyzed for trends,
patterns, or statistics. This can be useful for tracking the movement of objects or
conducting further analysis.

10. Additional Features: Depending on the project's complexity, the radar system's output
may include additional features, such as data storage, alarms, or integration with other
systems.

34
OBJECT DETECTION RADAR SYSTEM

35
OBJECT DETECTION RADAR SYSTEM

8. FUTURE SCOPE
The future scope of object detection using Arduino in IoT projects is promising and diverse.
Here are some potential directions and advancements:

1. Integration with AI and Machine Learning : Incorporating machine learning


algorithms for more advanced object detection capabilities. This could involve using
techniques like neural networks for real-time object recognition and classification.
2. Edge Computing: Enhancing object detection by utilizing edge computing techniques,
where data processing occurs closer to the data source (e.g., sensors), reducing latency
and bandwidth requirements.
3. Sensor Fusion: Integrating multiple sensors such as cameras, LiDAR, ultrasonic
sensors, and infrared sensors to improve object detection accuracy and reliability,
especially in complex environments.
4. Miniaturization and Power Efficiency: Developing smaller and more power-efficient
Arduino-based devices for object detection applications, enabling deployment in
resource-constrained environments and battery-powered devices.
5. IoT Integration: Integrating object detection capabilities into broader IoT systems for
applications such as smart homes, industrial automation, agriculture, and healthcare
monitoring.
6. Enhanced Connectivity: Leveraging advancements in wireless communication
protocols such as 5G, LoRaWAN, and NB-IoT to enable seamless connectivity and data
transmission for distributed object detection systems.

36
OBJECT DETECTION RADAR SYSTEM

9. CONCLUSION
The creation of a radar system using Arduino is a fascinating and educational project
that offers a hands-on opportunity to explore radar technology, electronics, and
programming. This project can be a valuable learning experience for students,
hobbyists, and electronics enthusiasts. Here are some key points to consider as a
conclusion:

1. Educational Value: Building a radar system with Arduino provides a practical way to
learn about the fundamental principles of radar technology, sensor interfacing, and data
processing.

2. Hands-On Experience: This project allows individuals to apply their theoretical


knowledge to real-world applications, fostering a deeper understanding of electronics
and microcontroller programming.

3. Customization and Creativity: The radar system can be customized and expanded to
include additional features, making it a versatile platform for experimentation and
creativity.

4. Visualization Skills: By creating a radar-like display for detected objects, individuals


gain experience in data visualization and graphical user interface design.

5. Real-Time Monitoring: The project offers insights into real-time monitoring and
feedback systems, which are essential in applications like security, automation, and
robotics.

37
OBJECT DETECTION RADAR SYSTEM

10. REFERENCES
The creation of a radar system using Arduino wouldn’t have been possible without the
contributions of some of the references that we used :

1. Arduino Official Documentation : The Arduino website and official documentation


often provide tutorials, examples, and project ideas for various applications, including
object detection. You can find specific guides and projects related to using Arduino for
object detection.
2. Arduino Project Hub : Arduino Project Hub is a platform where users share their
Arduino projects. You can search for projects related to object detection and IoT to find
inspiration and reference implementations.
3. GitHub Repositories: Many developers share their code and projects related to
Arduino and IoT on GitHub. You can search GitHub repositories for object detection
projects using Arduino and IoT and explore the code and documentation.
4. YouTube Tutorials: YouTube is a rich source of tutorials and demonstrations for
Arduino projects. Many creators share tutorials on object detection using Arduino in
IoT applications, where you can follow along and replicate the projects.

38

You might also like