Nekhil ravi
Published © Apache-2.0

Arduino Based Radar System

I have developed a visual experience of radar by processing ID with ultrasonic sensor, servo motor and Arduino.

EasyFull instructions provided1 hour9,417
Arduino Based Radar System

Things used in this project

Hardware components

Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
SG90 9g Micro Digital Servo Motor
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Screwdriver-Jackly-32-in-1-Magnetic-Screwdriver-Set-Repair-Tool-Kit Screwdriver-Jackly-32-in-1-Magnetic-Screwdriver-Set-Repair-Tool-Kit Screwdriver-Jackly-32-in-1-Magnetic-Screwdriver-Set-Repair-Tool-Kit Screwdriver-Jackly-32-in-1-Magnetic-Screwdriver

Story

Read more

Schematics

connection

describing connection
Ready upload lismm4kv8h

Code

Arduino code

Arduino
code
#include<Servo.h>
int trigPin=2;
int echoPin=3;

long duration;
int distance;
Servo servo;

void setup()
{
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  Serial.begin(9600);
  servo.attach(9);
}

void loop()
{
  for(int i=15;i<=165;i++)
  {
    servo.write(i);
    delay(100);
    distance=calculateDistance();
    
    Serial.print(i);
    Serial.print(",");
    Serial.print(distance);
    Serial.print(".");
  }
  for(int i=165;i>15;i--)
  {
    servo.write(i);
    delay(100);
    distance=calculateDistance();
    
    Serial.print(i);
    Serial.print(",");
    Serial.print(distance);
    Serial.print(".");
  }
}

int calculateDistance()
{
  digitalWrite(trigPin,LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin,HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin,LOW);
  
  duration=pulseIn(echoPin,HIGH);
  distance=duration*0.034/2;
  return distance;
}

Credits

Nekhil ravi

Nekhil ravi

4 projects • 21 followers
HARD CORE TINKERER

Comments