The Ultrasonic Theremin is an Arduino project that uses a cheap theremin to teach sound waves. By changing the distance of my hand to the device, I am changing the frequency of the sound waves. Also, moving a potentiometer changes the amplitude of the wave. This can be used as a science lesson about sound waves.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Tools and Supplies
- Arduino Uno with USB Cord
- Ultrasonic Sensor to change frequency (pitch)
- Piezo Buzzer to play the sound
- Potentiometer to change the amplitude (volume)
- LED with 220ohm Resistor (visual for the frequency)
- Foamcore Board for the case
- Jumper Wires
NOTE: Most of these parts came from an Arduino kit.
- Computer with Arduino Installed
- Hot Glue Gun
- Laser Cutter for enclosure
- Power Bank if you want to make it portable
Step 2: Assembly
The first two images, to the right, show the electronics in testing but in the third, I moved around the components around to accommodate the case. The LED and Ultrasonic Sensor use 40cm male to female jumper wires which can definitely be smaller but that was what I had on hand. I just wrapped the excess around the Arduino before casing it.
The case was made by MakerCase with dimensions that were a little small so my prototype required extra glue to piece it together. After you measure your parts on top of your Arduino, add a few millimeters to your values and insert them into MakerCase for a file that can then be laser cut on the foam-core.
Step 3: The Code
The code is mainly controlled by a variable called pitch. The pitch uses map to covert the values from the ultrasonic sensor to something readable by the piezo speaker and in particular to frequencies between A3 and C5. The constrain makes sure the map doesn't predict a high frequency when it sees a high distance (they were annoying). The rest of the code is to read the sensor, add an LED, and add serial messages.
pitch = constrain(map (distanceCm, 1, 40, 256, 523), 220, 523);