- Hi. In this project we are going to make a simple radar to detect obstacles.
Range depends on the range of the Ultrasonic we used *Step 1: Components :
Components :
1* Arduino Uno
2* Ultrasonic Distance Sensor
3* Servo Motor.
2* Ultrasonic Distance Sensor
3* Servo Motor.
1* Connect Ultrasonic (5V and GND) to Arduino (5V and GND).
2* Connect Ultrasonic (SIG) to Arduino (Digital pin 8).
2* Connect Ultrasonic (SIG) to Arduino (Digital pin 8).
3* Connect Servomotors (5V and GND) to Arduino (5V and GND).
4* Connect Servomotors (SIG) to Arduino (Digital pin 9).
4* Connect Servomotors (SIG) to Arduino (Digital pin 9).
5* Connect Arduino Uno to your Computer using USB cable.
-There are two code files attached in this step :
The first one for Arduino and the other of MATLAB.
The first one for Arduino and the other of MATLAB.
for Arduino code :you don't need to modify it , just upload it on Arduino.
for MATLAB code :
you need to modify line 28 ( s1 = serial('COM12'); )
to your new com port # .
you need to modify line 28 ( s1 = serial('COM12'); )
to your new com port # .
NOTE : Before closing MATLAB, close the serial port by writing "s1.close()" in MATLAB workspace.
download
EmoticonEmoticon