Hi, i want to connect sonar (measures distance) and the loudest speaker arduino can handle.
I want to play sound when sb crosses throught (distance changes). I dont want to build something complicated. i Thought about: sd slot to store music + speaker + sonar all conected with nano.
Any ideas or suggestions?
Thought about: sd slot to store music
You'll generally need an audio shield with memory and a digital-to-analog converter, unless you only want to play "simple tones" (square waves).
and the loudest speaker arduino can handle....
...+ speaker + sonar all conected with nano.
You can drive a piezo reasonably-loudly with a ~2khz tone.
If you want to drive a full-range 8-Ohm speaker (for voice or music), you'll need an amplifier. (The minimum impedance directly connected to an Arduino is 125 ohms.) You can build or buy an amplifier, or you can use regular "computer speakers" which have an amplifier built-in.
DVDdoug:
You'll generally need an audio shield with memory and a digital-to-analog converter, unless you only want to play "simple tones" (square waves).
You can drive a piezo reasonably-loudly with a ~2khz tone.
If you want to drive a full-range 8-Ohm speaker (for voice or music), you'll need an amplifier. (The minimum impedance directly connected to an Arduino is 125 ohms.) You can build or buy an amplifier, or you can use regular "computer speakers" which have an amplifier built-in.
I've driven a small speaker with just the Arduino pins. For square waves, you get quite a loud volume if you toggle several pins at once and connect them all to a speaker (with 150-ohm resistors). You can even get rudimentary volume control by varying the number of pins you use.
I'm also using code for a 4-voice synth that I found that uses PWM. It can drive a speaker directly and it's loud enough to easily hear - but not super loud. I agree an amp makes everything easier and better sounding, but for little projects, you don't always need one.