Hubei Hannas Tech Co.,Ltd-Professional Piezoceramic Elements Supplier
News
You are here: Home / News / Ultrasonic Transducer information / Production Process of Arduino radar

Production Process of Arduino radar

Views: 17     Author: Site Editor     Publish Time: 2020-06-08      Origin: Site

Inquire

facebook sharing button
twitter sharing button
line sharing button
wechat sharing button
linkedin sharing button
pinterest sharing button
whatsapp sharing button
sharethis sharing button

The component ultrasonic sensors that need to be listed when is using ultrasonic to make arduino radar.

Arduino Board (I use arduino Uno)

Servo motor (mg-996)

HC-SR04 ultrasonic sensor

BreadboardJumper

Step1:

1 (2)


"First, we have to cut a card board (15cm * 8cm). Then, glue the arduino and servo motor on piezoelectric ultrasonic transducer

 

Step2:



2 (2)


Now, we must make an "L" shaped bracket for the ultrasonic sensor (HC-SR04) to keep it on the servo motor.

Step3:

3


Now, we must connect the sonar sensor to the arduino. Be careful when is connecting the VCC and GND of the sensor to 5v and GND of arduino, respectively. After that, connect the trig pin to 8 and the echo pin to 9 of arduino.

Step4:

4
5


After connecting the ultrasonic transducer sensor to the arduino, it is time to connect the servo motor to it. Again, be careful to connect the VCC and GND of the servo motor. Connect the servo signal to pin 10 of arduino.

 

Step 5: Software required for Arduino radar:

You will need arduino IDE and Processing IDE to run it radar project.

Processing IDE will get the value sent from arduino and explain the target area (red mark). Follow the link to download them.

Processing IDE: https://processing.org/download/support.html

Arduino IDE: https://www.arduino.cc/en/main/software

 

Step 6: Arduino code:

#includeconst int TriggerPin = 8;

const int EchoPin = 9;

const int motorSignalPin = 10;

const int startingAngle = 90;

const int minimumAngle = 6;

const int maximumAngle = 175;

const int rotationSpeed = 1;

 

servo motor;

void setup (void)

{pinMode(TriggerPin, OUTPUT);

pinMode (EchoPin, INPUT);

motor.attach (motorSignalPin);

Serial.begin (9600);

 

void loop (void)

{static int motorAngle = startingAngle;

static int motorRotateAmount = rotationSpeed;

motor.write (motorAngle);

 

Delay (10);

SerialOutput (motorAngle, CalculateDistance());

motorAngle + = motorRotateAmount;

(motorAngle "= minimumAngle || motorAngle" = maximumAngle) {motorRotateAmount = -motorRotateAmount;

int CalculateDistance (void)

{digitalWrite(TriggerPin, HIGH);

delayMicroseconds (10);

digitalWrite (TriggerPin, LOW);

long duration = pulseIn (EchoPin, HIGH);

float distance = duration * 0.017F;

return int (distance);

 

void SerialOutput (const int angle, const int distance)

 

String angleString = String(angle);

String distanceString = String(distance);

Serial.println(angleString + "," + distanceString);

 

Step 7: Handle the IDE:

6



7



We can use the processing IDE to easily find any object within the range (40 cm). If there is no IDE on your PC, please download it. Before using this IDE, we must configure the font.

To do this, we must install the "OCRAEXT.TTF" file located in Radar.zip. Then, go to tools/create Font. Select "OCRAExtended" from the list, select a font size of 25 and click "OK".

Step8:


8


9


Now, we must find the COM port number. Go to the Arduino IDE and find the Com port (COM3 in the photo). Place the COM port number on line 13 of the processing code (COM3 in the photo).

Step9:

10




11



Finally, pressing the "Run" button will display a processing window. It will show the radar servo angle and object distance of piezoelectric ultrasonic transducer sensor.






Feedback
Hubei Hannas Tech Co.,Ltd  is a professional piezoelectric ceramics and ultrasonic transducer manufacturer, dedicated to ultrasonic technology and industrial applications.                                    
 

RECOMMEND

CONTACT US

Add: No.302 Innovation Agglomeration Zone, Chibi Avenu ,Chibi City, Xianning, Hubei Province,China
E-mail: sales@piezohannas.com
Tel: +86 07155272177
Phone: +86 +18986196674         
QQ: 1553242848 
Skype: live:mary_14398
​        
Copyright 2017  Hubei Hannas Tech Co.,Ltd All rights reserved. 
Products