Pop and kids wanna switch a speaker on with motion detect

Really interested in Arduino and open source hardware and want to do a simple project for an artist friend to get me and my kids started Arduino-ing.

Our friend paints and makes music (new agey stuff, natch) and for an installation she wants music to play when someone steps in front of and peers at a little, almost tiny painting. There should be a dwell time (maybe 30 sec to a minute) so the music doesn't start and stop abruptly every time someone moves. The dwell time should reset to the max time if someone moves (so it's continuous as long as people are in range). We're thinking a motion sensor on the input side and a simple switch which we just hook up to connect and disconnect the speaker wire (We'd just let the CD loop-play continuously).

But we're open to ideas: ex: maybe multiple motion detectors that control a CD player through IR to play a certain track if you're far away but another when you're peering at the little thing (with priority for the peering track). Perhaps also an automatic fader control so the music does not cut in and out abruptly.

We're looking for suggestions on an approach and for IO devices, as well as general ideas about programming this. We want the project to help us learn the basics of programming Arduinos, though if code exists for specific devices we're happy to incorporate it.

Any suggestions are appreciated!

Your project has 2 parts, detecting motion and playing sound.
For detecting motion motion you could use a distiance sensor like this one from Sharp.

For sound, I have found the easiest way is to use a shield (a board that sits on top of your Arduino) . We like the WAV shield from Adafruit. Adafruit Wave Shield for Arduino Kit [v1.1] : ID 94 : $22.00 : Adafruit Industries, Unique & fun DIY electronics and kits

I have used this setup as a sort of doorbell to an office. The sensor was put in the doorway and measured the distance. When the value returned from the sensor was below a certain level I new something had passed in front of it and it played a sound.

Good luck with your project.

Pauly, thanks. If the Sharp dealie measures distance, could I program the arduino to play one sound at one distance and another at a different distance?

I read a little on the shield and it looks like time is plenty and audio quality is good enough for new age. -bye bye CD!

Yes, you could certainly do that. You could do something like the following pseudo code.

if (sensorInput>600)
{
  // play sound A
}
else if (sensorInput>500)
{
  // play sound B
}
else if (sensorInput>400)
{
  // play sound C

Also keep in mind the WAV Shield only plays WAV files, which is kind of a pain. I mostly had MP3 files and had to convert them. I think there is also an MP3 shield from sparkfun. http://www.sparkfun.com/products/9736

I did something similar with a cheap MP3 player.

http://arduino.cc/forum/index.php/topic,49979.0.html

Great suggestions! So we're off to do a project! You guys are great. And BioCow -I once was in a band called Bovine Awareness.

If you've got a couple weeks to work with, I can STRONGLY recommend this:
http://www.mdfly.com/index.php?main_page=product_info&cPath=9_53&products_id=284

It is a great little MP3 player that is CHEAP (<$10) and incredibly easy to use. A total of 4 lines of code will get it running for you and only use up your serial.tx pin.

MDFLY assures me that they will have more in stock within 2 weeks.

so the MDFLY mp3 player only needs a separate 6v power supply. That's perfect. I wonder if it would get by on 5v from the arduino.

I've heard of people running them on 5, but I wouldn't recommend it. I say run the arduino on a 9v 750mA or so wall wart and connect the mp3 player to VIN.

Here's the data sheet for that player:
http://www.thaieasyelec.net/archives/Manual/TDB380%20datasheet%20V2[1].0%20.pdf

Let us know how the project goes UncleGeo.

Will do and thanks so much for the help!