Go Down

Topic: Ping ))) Radar (Read 4 times) previous topic - next topic

mr_electric

Hi Everyone,

I have seen that you can make an arduino radar by using a ping))) sensor, an arduino, and a processing sketch. I'm hoping that someone can direct me to a tutorial on how this can be achieved. I'm looking to an output similar to this:
(http://www.youtube.com/watch?v=sfBOC980KYA)
or this
(http://www.youtube.com/watch?v=xmVpsQygtiU)

Thanks,
Mr_E

AWOL

Break the problem down:
1) driving the sonar unit.
2) driving the servo
3) transmitting the results to Processing
4) receiving the results in Processing and plotting them.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

mr_electric


Break the problem down:
1) driving the sonar unit.
2) driving the servo
3) transmitting the results to Processing
4) receiving the results in Processing and plotting them.



Exactly. I have obtained a ping))) and successfully gotten it working with my arduino uno and serial. I need help with transmitting the results to processing and plotting the results as a radar screen in processing.

Thank You,
Mr_E  :smiley-eek:

AWOL

Quote
I need help with transmitting the results to processing and plotting the results as a radar screen in processing.

If you're transmitting the results to the PC, then you can transmit to Processing, so you don't need help there.
The rest is all Processing then.
Break it down further.
1) Read a line of results
2) parse the results into variables.
3) Polar plot the variables.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

mr_electric

And how would I do that? I'm just a beginner  :(

AWOL

I'm pretty sure there are Processing examples showing how to receive strings and then break them down into numbers.
Then you need to concentrate on how to plot those values.

Quote
I'm just a beginner 

We all have to start somewhere.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

novice


And how would I do that? I'm just a beginner  :(


Keep taking small steps.

eg: this uses Processing to provide a very basic display for Ultrasonic sensors http://webzone.k3.mah.se/projects/arduino-workshop/projects/arduino_meets_processing/instructions/ultrasound.html

novice

There's also an instructive page about "Using Processing to Send Values using the Serial Port to Arduino" at http://luckylarry.co.uk/arduino-projects/using-processing-to-send-values-to-arduino/.

The same site goes on to implement a "Radar Screen" using Processing at http://luckylarry.co.uk/arduino-projects/arduino-processing-make-a-radar-screen-to-visualise-sensor-data-from-srf-05-part-1-setting-up-the-circuit-and-outputting-values/

mr_electric

Thanks, I'm going to try and see if I can modify that processing sketch to suit my needs. I am surprised that there are no tutorials on the ping))) radar.

Thanks,
Mr_E   XD

AWOL

Quote
I am surprised that there are no tutorials on the ping))) radar.

So am I:
http://arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor

(it's a sonar, not a radar)
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

novice


AWOL

#11
Aug 05, 2011, 08:23 am Last Edit: Aug 05, 2011, 11:47 am by AWOL Reason: 1
Not really - it is (IMO) one of the poorer code examples, but at least it demonstrates the power of a simple search.
(Compiled but not tested - I don't have a Ping)
Code: [Select]
const int pingPins [] = {7};
const int nPings = sizeof (pingPins) / sizeof (pingPins [0]);

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  for (int i = 0; i < nPings; ++i) {
    unsigned long range = pingRange (pingPins [i]);
    Serial.print (i);
    Serial.print(" ping ");
    Serial.print(microsecondsToInches(range));
    Serial.print("in, ");
    Serial.print(microsecondsToCentimetres(range));
    Serial.println("cm");
    delay(20);    // wait a while for the echoes to die away
  }
}

unsigned long pingRange (int pingPin)
{
  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);

  // The same pin is used to read the signal from the PING))): a HIGH
  // pulse whose duration is the time (in microseconds) from the sending
  // of the ping to the reception of its echo off of an object.
  pinMode(pingPin, INPUT);
 
  return pulseIn(pingPin, HIGH);
}

unsigned long microsecondsToInches(unsigned long microseconds)
{
  // According to Parallax's datasheet for the PING))), there are
  // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
  // second).  This gives the distance travelled by the ping, outbound
  // and return, so we divide by 2 to get the distance of the obstacle.
  // See: http://www.parallax.com/dl/docs/prod/acc/28015-PING-v1.3.pdf
  return microseconds / 74 / 2;
}

unsigned long microsecondsToCentimetres(unsigned long microseconds)
{
  // The speed of sound is 340 m/s or 29 microseconds per centimetre.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  return microseconds / 29 / 2;
}
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

mr_electric

As in tutorial, I meant one on creating a radar screen with ping. I found one online that uses an arduino and an ultrasonic sensor to make a screen, but that one uses a different sensor. Currently, I'm trying to modify the code to suit my needs.

Thanks again,
Mr_E

P.S. I'll be sure to post a tutorial with ping once I get this sorted out.

AWOL

Quote
I found one online that uses an arduino and an ultrasonic sensor to make a screen, but that one uses a different sensor.

That's why abstraction is important - it should not matter whether the range information comes from a Ping, a real RADAR or Sharp IR range sensor (or a length of string)

Don't get too bogged-down in specifics.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

retrolefty


Quote
I found one online that uses an arduino and an ultrasonic sensor to make a screen, but that one uses a different sensor.

That's why abstraction is important - it should not matter whether the range information comes from a Ping, a real RADAR or Sharp IR range sensor (or a length of string)

Don't get too bogged-down in specifics.


I agree, what such range sensors have in common is that they are all  "flight of time" sensors where the time duration between sending a pulse and receiving a echo is proportional to the sensing range, regardless of the medium used, RF, ultrasonic, IR, laser, etc.

Lefty


Go Up