Introduction:
In this project, we have designed Arduino RADAR Model using Ultrasonic Sensor for Detection & Ranging. RADAR is an object detection system that uses radio waves to identify the range, altitude, direction, and speed of the objects. The radar antenna transmits radio wave pulses that bounce off any object in its path. The object returns a portion of the wave received by the receiver which is in line of sight with the transmitter.
This Arduino RADAR project aims to achieve a radar system prototype based on an Arduino board, capable of
detecting stationary and moving objects.
Check about the Ultrasonic Sensor here:
1. Distance Measurement Using Arduino & HC-SR04 Ultrasonic Sensor
2. Arduino Ultrasonic Range Finder with HC-SR04 on OLED Display
Bill of Materials
For designing Arduino RADAR Model using Ultrasonic Sensor, we need the following components.
S.N. | Components Name | Quantity | Purchase Links |
---|---|---|---|
1 | Arduino UNO Board | 1 | Amazon | AliExpress |
2 | Ultrasonic Sensor HC-SR04 | 1 | Amazon | AliExpress |
3 | 16x2 LCD Display | 1 | Amazon | AliExpress |
4 | Potentiometer 10K | 1 | Amazon | AliExpress |
5 | Servo Motor SG90 | 1 | Amazon | AliExpress |
6 | Buzzer 5V | 1 | Amazon | AliExpress |
7 | LED 5mm Any Color | 2 | Amazon | AliExpress |
8 | Connecting Wires | 20 | Amazon | AliExpress |
9 | Breadboard | 1 | Amazon | AliExpress |
Arduino RADAR Model using Ultrasonic Sensor
Block Diagram:
Circuit Diagram:
Program/Source Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
#include <Servo.h> #include <LiquidCrystal.h> Servo myservo; LiquidCrystal lcd(7, 6, 5, 4, 3, 2); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7) int pos = 0; // la position initiale du servo moteur const int trigPin = 9; const int echoPin = 10; const int moteur = 11; const int buzzer = 12; const int ledPin1 = 14; const int ledPin2 = 15; float distanceCm, DistanceSec,duration; void setup() { myservo.attach(moteur); // attache le Servo moteur a la pin numéro 11 lcd.begin(16,2); // Initialiser l'interface de Lcd avec leurs Dimensions pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(buzzer, OUTPUT); pinMode(ledPin1, OUTPUT); pinMode(ledPin2, OUTPUT); DistanceSec=20; } void loop() { for (pos = 0; pos <= 180; pos += 1) { // aller de 0 a 180 degée // in steps of 1 degree myservo.write(pos); // Programmer le Servo pour aller a la position (pos) digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); //envoyer une impulsion de 10 micro seconds delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distanceCm= duration*0.034/2; if (distanceCm <= DistanceSec) { if(distanceCm <= DistanceSec/2) { tone(buzzer, 10); // Send 1KHz sound signal... digitalWrite(ledPin1, LOW); digitalWrite(ledPin2, HIGH); delay(700); noTone(buzzer); // Stop sound... lcd.setCursor(0,0); // positionner le cursor a 0,0 lcd.print("Distance: "); // Printe "Distance" sur LCD lcd.print(distanceCm); // Printe la valeur Obtenue sur LCD lcd.print(" cm "); // Printe l'unité sur LCD delay(10); lcd.setCursor(0,1); lcd.print("Angle : "); lcd.print(pos); lcd.print(" deg "); delay(2000); } else { digitalWrite(buzzer, HIGH); digitalWrite(ledPin2, LOW); digitalWrite(ledPin1, HIGH); delay(100); digitalWrite(buzzer, LOW); lcd.setCursor(0,0); // positionner le cursor a 0,0 lcd.print("Distance: "); // Printe "Distance" sur LCD lcd.print(distanceCm); // Printe la valeur Obtenue sur LCD lcd.print(" cm "); // Printe l'unité sur LCD delay(10); lcd.setCursor(0,1); lcd.print("Angle : "); lcd.print(pos); lcd.print(" deg "); delay(2000); } } else{ digitalWrite(buzzer, LOW); digitalWrite(ledPin1, LOW); digitalWrite(ledPin2, LOW); } lcd.setCursor(0,0); // positionner le cursor a 0,0 lcd.print("Distance: "); // Printe "Distance" sur LCD lcd.print(distanceCm); // Printe la valeur Obtenue sur LCD lcd.print(" cm "); // Printe l'unité sur LCD delay(10); lcd.setCursor(0,1); lcd.print("Angle : "); lcd.print(pos); lcd.print(" deg "); delay(80); //attendre 100ms pour que le servo cherche sa position } for (pos = 180; pos >= 0; pos -= 1) { // myservo.write(pos); // digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distanceCm= duration*0.034/2; if (distanceCm <= DistanceSec){ if(distanceCm <= DistanceSec/2) { tone(buzzer, 10); // Send 1KHz sound signal... digitalWrite(ledPin1, LOW); digitalWrite(ledPin2, HIGH); delay(700); noTone(buzzer); // Stop sound... lcd.setCursor(0,0); // positionner le cursor a 0,0 lcd.print("Distance: "); // Printe "Distance" sur LCD lcd.print(distanceCm); // Printe la valeur Obtenue sur LCD lcd.print(" cm "); // Printe l'unité sur LCD delay(10); lcd.setCursor(0,1); lcd.print("Angle : "); lcd.print(pos); lcd.print(" deg "); delay(2000); } else { digitalWrite(buzzer, HIGH); digitalWrite(ledPin2, LOW); digitalWrite(ledPin1, HIGH); delay(100); digitalWrite(buzzer, LOW); lcd.setCursor(0,0); // positionner le cursor a 0,0 lcd.print("Distance: "); // Printe "Distance" sur LCD lcd.print(distanceCm); // Printe la valeur Obtenue sur LCD lcd.print(" cm "); // Printe l'unité sur LCD delay(10); lcd.setCursor(0,1); lcd.print("Angle : "); lcd.print(pos); lcd.print(" deg "); delay(2000); } } else{ digitalWrite(buzzer, LOW); digitalWrite(ledPin1, LOW); digitalWrite(ledPin2, LOW); } lcd.setCursor(0,0); // lcd.print("Distance: "); // lcd.print(distanceCm); // lcd.print(" cm "); delay(10); lcd.setCursor(0,1); lcd.print("Angle : "); lcd.print(pos); lcd.print(" deg "); delay(80); } } |
Working of the Project:
Arduino board sends a signal of +5V to the trig pin of Ultrasonic Sensor HC-SR04 which triggers the sensor. Then it provides rotational action at the servo motor mechanically fitted along with ultrasonic Sensor HC-SR04 so that it can detect the moving objects and locate within 180 degrees.
The Arduino sends a HIGH pulse width of (10 S) 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.
The signal on pin ECHO the sensor remains at the HIGH position during transmission, thereby measuring the duration of the round trip of ultrasound and thus determine the distance.
The LCD display displays the calculated distance and the angle of rotation. The buzzer is an additional component, it rings when there is a detection (Tone1 and Tone2) along with LEDs. Both LEDs along with the buzzer determine the field where the object is located (near or distant).
Photos:Mechanical Arrangement
Video Demonstration: Arduino RADAR Ultrasonic Sensor
A better version of RADAR can be designed using the TFMini-S LiDAR Distance Sensor. You can achieve more accuracy and better distance upto 1200 meters.
16 Comments
link of the redar app
hi sir, where is the code 🙁
Hi sir? The Code is missing. Can you upload the code? by the way, its a cool project 🙂
Code is already given as source code/program.
Which angle is shown by lcd
Respected sir, i need the explanation of the flow chart! Pls upload the explanation.
Respected sir, pls upload the explanation of flow chart
which software used to programing
Hi, if it possible can you explain how it works to my email? Thank you.
Hi .I did truely all circuit diagram ,but no working .Could you help me ??? Please reply .My servo is not working.
Processing code?
what is the use of B10K potentiometer???
have you found the solution please reply::
What is the application for this project please reply I need it now
sir where is the processing code ?
1200 meters !! with TFMini-S LiDAR Distance Sensor, i think thats a typo.