Author Options:

How do you build an arduino radar? Answered

Hi Everyone,

I saw on youtube that you can make an arduino radar using a ping ultrasonic sensor, an arduino, and a processing sketch. I have successfully gotten the ping sensor to rotate (180 degrees) on a servo and report the distance to the computer via the serial monitor but I need help converting it to a radar interface using processing. Can anyone help me write a processing sketch that would do it.

Thanks in advance,


OK, I misunderstood the question. You just want to render the results on screen?

I don't know how to do it with Processing, but that's relatively straightforward graphics programming.

Rotate the sensor to a known angle.

Knowing angle, you can calculate the "sweep" line to draw on the screen. This has the side effect of overwriting the previous distance at that angle.
Ping to get range.
Knowing range, you can calculate where on the line the reflection should be (based on whatever distance scaling factor you're using) -- standard polar-to-cartesian conversion.
Remove the line. The removal has the side effect of erasing the previous distance at that angle.
Draw the point representing the reflection.
Rotate sensor to the next angle and repeat.

You can make it fancier, but that's the essence of what's happening in the video.

I asked the same question in the arduino forums and was directed to a site that has instructions on building an ultrasonic radar screen with an arduino. The only problem with that was the tutorial used another rangefinder. Right now I'm trying to modify the code to fit the ping)))

Can't tell you how to do it in Processing, but essentially you need to accurately -- or at least stably -- measure the time between when the ping goes out and when the echo comes back.

Does the first item under Related at right ("DIY Arduino Radar") help you at all?

I checked that out first, but it has instructions on how to do it with a different ultrasonic sensor and the wire library

Thanks anyways,


6 years ago

You generate a pulse of sound energy like a speaker to a reflective target at the speed of sound. A tiny portion of that energy reflects back to a microphone also at the speed of sound.

Now the micro may be too slow to be able to measure the speed of sound
time of flight.

Different sound frequencies reflect better off different materials
( wood, cushions metal wire fence, animals etc.).
The longer a pulse takes to return, the further away the target must be and
the weaker the reflected sound ( inverse square law ). So you must steadily
increase the gain of your microphone amplifier as time of response grows.
Try Parallax.COM for an audio model that does the chirp and listens returning
a binary number for distance 3' to 25'...


Actually I thought it would be possible to accomplish this task by using only an arduino, servo, ping))), and processing sketch. If you check on youtube (see the link posted below) there are many examples. I just need a processing sketch that would convert the serial values (x-inches, x-centimeters) to a graphical display.



6 years ago

Here is a link for you...
This one does not have the range some of nine do.
You can explore the site yourself..........   A