Long range proximity sensor that triggers mp3 files?

Hey all,

Just starting to work with proximity sensors (Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0F) and hoping to connect it via arduino (Im hoping a lilypad arduino? Not sure if the 5v requirments can be processed by lilypad?).
Anyway, Id like to create something that, when you are farther away, you hear say, "Track 1", then move closer and you hear "Track 2" etc.
How difficult would that be?
I have just this basic code for the prox sensor here:

int sensorPin = 0; //analog pin 0

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

void loop(){
int val = analogRead(sensorPin);
Serial.println(val);

//just to slow down the output - remove if trying to catch an object passing by
delay(100);

}
and am wondering how to combine the calibrations of the proximity sensor to the mp3 files being triggered.
Thanks in advance to all you knowledgeable folks out there!

use "if statements" to determine which track to play based on your analog input reading

Hi,
For longer-distance measurements you probably want an Ultrasonic ranging device. See:

http://arduino.cc/playground/Main/InterfacingWithHardware#DistanceSensing
and

I have some of these here:
[url=http://arduino-direct.com/sunshop/index.php?l=search_list&s[search]=ultrasonic&s[title]=Y&s[short_desc]=Y&s[full_desc]=Y&s[sku]=Y&s[match]=all&s[cid]=0]http://arduino-direct.com/sunshop/index.php?l=search_list&s[search]=ultrasonic&s[title]=Y&s[short_desc]=Y&s[full_desc]=Y&s[sku]=Y&s[match]=all&s[cid]=0[/url]

DISCLAIMER: I mentioned stuff from my own Shop...

Thanks guys!

I guess I shouldnt say long range, it will only be from about 10ft away?

I guess I shouldnt say long range, it will only be from about 10ft away?

That is long range… Short range is up to about 500mm, long range is up to about 0.5m-4m or so (approximate limits of standard ultra-sonic range sensors).

The code is easy enough with ‘if statements’.

long range proximity

That's a oxymoron, isn't it?

You know, like "military intelligence"