3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

How do you build an arduino radar?


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,
Mr_E

8 answers
sort by: active | newest | oldest
Aug 4, 2011. 10:06 PMorksecurity says:
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.
Aug 4, 2011. 1:50 PMorksecurity says:
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.
Aug 4, 2011. 1:50 PMorksecurity says:
Does the first item under Related at right ("DIY Arduino Radar") help you at all?
Aug 4, 2011. 5:45 PMiceng says:
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'...

A

Aug 4, 2011. 6:56 PMiceng says:
Here is a link for you...
This one does not have the range some of nine do.
You can explore the site yourself..........   A

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!