Radar_System_Using_Arduino
Radar_System_Using_Arduino
Team Members :
1.Ashutosh upadhaya
2.Sanyam Soni
3.Rahul Soni
Introduction to Radar System
Principle of Operation
Hardware
• Arduino UNO: A microcontroller used to process data and control the
system.
• Specifications: ATmega328P microcontroller, 14 digital I/O pins,
6 analog input pins, 32 KB flash memory.
• Role: Acts as the brain of the radar system, processing input
from the sensor and controlling the servo motor.
• Tower Pro SG90 Servo Motor: Rotates the ultrasonic sensor to scan the
area.
• Specifications: Operating voltage 4.8V-6V, torque 2.5kg/cm,
rotation angle 0° to 180°.
• Role: Moves the ultrasonic sensor to different angles for
scanning.
Software
• Arduino IDE: Platform for writing and uploading code to the Arduino.
Ultrasonic Sensor
The HC-SR04 ultrasonic sensor determines the distance to a target object. It
has a transmitter that converts electrical signals to ultrasonic waves and a
receiver that converts the reflected waves back into electrical signals. It
operates at 4 MHz and has a detection range of 2 cm to 400 cm.
Servo Motor
The Tower Pro SG90 servo motor operates on +5V and has a torque of
2.5kg/cm. It rotates between 0°-180° to allow the ultrasonic sensor to scan
the area.
Block Diagram
Below is a simplified block diagram illustrating the connection between the
components:
Circuit Diagram
Here is the basic circuit diagram for the radar system:
Working Principle
1. Initialization: The Arduino initializes the servo motor and sets the
ultrasonic sensor pins as input and output.
2. Scanning: The servo motor rotates the ultrasonic sensor from 0° to
180°, pausing at each step to take a distance measurement.
3. Distance Measurement: At each step, the ultrasonic sensor sends out a
40 kHz pulse. The time taken for the echo to return is measured.
4. Data Processing: The Arduino calculates the distance based on the time
delay and sends this data, along with the angle, to the Processing
application via serial communication.
5. Visualization: The Processing application plots the distance and angle
on a polar coordinate system, creating a real-time radar display.
Arduino Code
#include <Servo.h>
#define TRIG_PIN 9
#define ECHO_PIN 10
#define SERVO_PIN 11
Servo myServo;
int pos = 0;
void setup() {
Serial.begin(9600);
pinMode(TRIG_PIN, OUTPUT);
pinMode(ECHO_PIN, INPUT);
myServo.attach(SERVO_PIN);
void loop() {
myServo.write(pos);
delay(20);
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
Serial.print(pos);
Serial.print(",");
Serial.println(distance);
delay(100);
myServo.write(pos);
delay(20);
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
Serial.print(pos);
Serial.print(",");
Serial.println(distance);
delay(100);
}
Processing Code
import processing.serial.*;
Serial myPort;
String data;
float angle, distance;
void setup() {
size(800, 800);
myPort = new Serial(this, "COM3", 9600); // Adjust COM port as necessary
}
void draw() {
background(0);
fill(0, 255, 0);
translate(width/2, height/2);
ellipse(0, 0, 10, 10);
if (myPort.available() > 0) {
data = myPort.readStringUntil('\n');
if (data != null) {
data = trim(data);
String[] values = split(data, ',');
if (values.length == 2) {
angle = float(values[0]);
distance = float(values[1]);
float x = cos(radians(angle)) * distance;
float y = sin(radians(angle)) * distance;
ellipse(x, y, 10, 10);
}
}
}
}
Problem Statement
With the invention of airplanes, there arose a need for an instrument to
detect their location and time. Radar systems were developed to detect
aircraft in the air, and these systems are now crucial for defense, air-traffic
control, and many other applications. Early radar systems were large,
expensive, and limited in functionality. Modern radar systems have evolved
to be more compact, cost-effective, and versatile, but there remains a need
for educational tools to demonstrate the basic principles of radar technology
in an accessible manner.
• Air Traffic Control: Ensuring the safe and efficient movement of aircraft.
• Defense Systems: Detecting and tracking potential threats.
• Weather Monitoring: Tracking weather patterns and predicting storms.
• Automotive Safety: Providing features like adaptive cruise control and
collision avoidance.
Future Enhancements
This project demonstrates the basic principles of radar technology using cost-
effective components and open-source software. By integrating an ultrasonic
sensor with Arduino UNO and displaying the data using Processing, we have
created a functional radar system capable of detecting and measuring the
distance and position of objects. This project serves as an educational tool for
understanding radar technology and its applications.
References