Summary of Ping Organ using an Arduino
This project creates a simple musical toy using an Arduino, an ultrasonic range finder, and a speaker. The device plays different tones based on the distance detected by the range finder – the closer or farther the object, the different the pitch produced by the Arduino through the speaker. The setup is easy to build: the speaker connects to Arduino pin 11, the ultrasonic sensor to power, ground, and pin 7. The code maps distance measurements to musical notes, allowing children to create varying sounds by moving near the sensor.
Parts used in the Ultrasonic Range Finder Musical Toy:
- Arduino
- Ultrasonic Range Sensor (e.g., Parallax Ping))) or equivalent)
- Small speaker
I was trying to think of a quick toy I could build for my kids. I came up with this idea of an ultrasonic range finder, an Arduino, and a speaker. Basically the Arduino plays a tone out of the speaker based on the distance from the range finder. The result works pretty well and can be built in minutes. You can play this from anything from your entire body, to just your feet.
http://www.youtube.com/watch?v=6F4xoe1rQMs
Step 1: Parts
1. Arduino
2. Range Sensor (I used a Parallax Ping))) that I picked up a Defcon a couple of years ago, anything like this would work as well http://www.sparkfun.com/products/639)
3. A small speaker (I pulled mine out of an toy moose that sang Blue Christmas)
Ultrasonic range finders basically work by sending out an ultrasonic signal and then they sense how long it takes to come back. Think sonar for a submarine.
Step 2: Schematic
The Schematic is pretty simple. Speaker to Arduino pin 11 and ground. Ultrasonic range finder to power, ground, and Arduino pin 7
Step 3: The Code

2. Range Sensor
3. A small speaker