Pages: [1] 2   Go Down
Author Topic: Ping ))) Radar  (Read 3679 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
 ( )
 or this
 ( )

Thanks,
Mr_E
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24454
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"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.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24454
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"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.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And how would I do that? I'm just a beginner  smiley-sad
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24454
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"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.

Offline Offline
Full Member
***
Karma: 1
Posts: 200
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And how would I do that? I'm just a beginner  smiley-sad

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
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 200
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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/
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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   smiley-lol
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24454
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

"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.

Offline Offline
Full Member
***
Karma: 1
Posts: 200
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice find AWOL.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24454
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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;
}
« Last Edit: August 05, 2011, 04:47:06 am by AWOL » Logged

"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.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24454
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"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.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16548
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Pages: [1] 2   Go Up
Jump to: