Summary
Just a simple Theremin (first project post!) using a distance sensor and a buzzer. To make it, simply connect an ultrasonic distance sensor (I used the SR04, because it came with the starter kit I got) and a passive buzzer (not an active, passives are much better) to your board. In the picture I used a prototype shield, but that is not necessary.
Wiring
Distance:
- GND to GND
- VCC to +5V
- Echo to PWM12
- Trig to PWM11
Buzzer:
EXPANDED TECHNICAL DETAILS
Non-Contact Musical Synthesis
Inspired by the classic electronic instrument, this Theremin uses sound waves to generate music based on hand position.
- Proximity Detection: Uses an HC-SR04 Ultrasonic sensor. The Arduino calculates the distance from the hand to the sensor in real-time.
- Pitch Mapping: The distance value (e.g., 5cm to 50cm) is mapped to a frequency range (e.g., 100Hz to 2000Hz).
Sound Generation
- Tone Function: The Arduino uses the
tone()function to output a square wave to a speaker. - Interactivity: By moving one hand near the sensor, the user can play melodies like a futuristic instrument. Advanced versions use a second sensor for volume control, creating a fully non-contact 2-axis expressive musical interface.