This is a simple music instrument, basing on the Arduino with an Ultrasonic range sensor and a small 5 Ohms speaker.
The setup of the board is simple, two different circuits: Range sensor has 3 pins (power, ground, output), Speaker has 2 (power and ground).
Expecting the sensor to read an analog signal that would need to be interpreted to a digital one, the first setup was different the the picture, apparently, this sensor (SKU 2760342) is smarter then that and is giving a digital read which is useable directly with the Arduino. This required a few adjustments to the code given. In addition, the Ultrasonic Range Sensor is using a library and comes with a code that defines te sensor in a class “Ultrasonic”. It was interesting to see a subject from processing applied on the Arduino.
The code gives the possibility to have output in inches or Centimeters and it prints out in the Serial Monitor.
At this point we have a tone sound that is coming out of the speaker (separate circuit). Building the “instrument” from a piece of wood and a board of carton and a long page that have lines to indicate where to stop and a serial of prewritten numbers for a song.
In the video below there is an attempt of playing Beethoven’s “Fur Elise” famous classic and “Marry had a little lamb” using our new instrument and basing on the lines on the page.
Tone Lab 1 from Oryan Inbar on Vimeo.
Very fun, and impressive implementation of the ultrasonic sensor. The video was rather hard to hear– I’d suggest recording in a quiet room next time.
The paper notations you made to play Fur Elise and Mary Had a Little Lamb are compelling visuals in and of themselves– an interesting idea for an expanded project!