Built to order

Contactless Theremin-Style Musical Instrument using Ultrasonic Sensors and Arduino

This project builds a contactless theremin-style musical instrument with two HC-SR04 ultrasonic sensors and an Arduino. The right-hand sensor maps hand distance to pitch while the left-hand sensor maps hand height to volume — the theremin's play-without-touching idea, rebuilt with sound waves. The Arduino turns echo flight-times into notes on a buzzer or speaker and shows note and frequency on a small OLED. It ships as a breadboard prototype with firmware, note chart, and viva documentation. Suitable for B.E./B.Tech final-year projects in Electronics, E&TC and Electrical.

Chat on WhatsApp — get a quotation

Electronics / E&TC Arduino NanoArduino IDE0.96 in I2C OLEDSolderless breadboard jumper wires10 µF supply decoupling capacitorsHardware
Contactless Theremin-Style Musical Instrument using Ultrasonic Sensors and Arduino — project thumbnail preview
More project photos (3)

The problem

The Contactless Theremin-Style Musical Instrument using Ultrasonic Sensors and Arduino exists because playing music without touching anything feels like magic, yet the real instrument is hard to source, tune, and demonstrate in a college lab. A genuine theremin works on hand capacitance around two metal antennas — circuitry that drifts with humidity, grounding, and nearby objects, and it gives a beginner nothing visible to measure. This project answers the musical idea with honest, affordable physics: inside each HC-SR04 a 40 kHz ultrasonic burst bounces off the player's hand and the echo's flight time converts directly into distance, so the theremin's invisible antenna field is rebuilt out of sound. The Arduino maps one hand's distance to pitch and the other's to volume, plays the note through a buzzer or speaker, and shows the note name and frequency on an OLED. Students get the same contactless thrill on a breadboard anyone can afford, debug, and explain note by note in the viva.

How it works

Playing this instrument is a short chain from hand to ear. Each HC-SR04 fires a 40 kHz ultrasonic burst and listens for the echo off the hand; the Arduino measures the echo's flight time and converts it to centimetres. The pitch firmware averages several readings, clamps them to the playing zone of approximately 5–40 cm, and looks up the nearest note in its table — roughly one octave from C4 to C5 — then plays that note's frequency through the Arduino tone() square-wave output. The volume firmware does the same distance math on the left hand and scales the output drive level, so a raised hand is loud and a lowered hand is silent. The OLED refreshes every cycle with the note name and frequency: hand distance becomes echo time, echo time becomes distance, distance becomes pitch and volume, and the player hears and sees the result at once.

  1. Each HC-SR04 is triggered in turn (never simultaneously, to avoid crosstalk); it emits a 40 kHz ultrasonic burst and raises its echo pin until the reflection returns.
  2. The Arduino measures the echo pulse width and converts it to hand distance in centimetres using the speed of sound.
  3. Raw readings pass through a short moving average plus range clamping, rejecting one-off spikes from angled hands or loose sleeves.
  4. The smoothed pitch-sensor distance is mapped to a note table (default approximately C4–C5) and its standard frequency in hertz.
  5. The smoothed volume-sensor distance is mapped to an output drive level, from silent at hand-down to full at hand-up.
  6. The Arduino tone() function outputs the note's square-wave frequency while the drive level sets its loudness through the buzzer or speaker.
  7. The OLED display updates with the current note name and frequency, giving the player visual feedback on every reading cycle.
  8. A 10 µF capacitor across each sensor's supply rails keeps the 5 V line stable, which is the single most common fix for jittery pitch readings.

Tech stack:

  • Arduino Nano (ATmega328P)
  • HC-SR04 ultrasonic sensor · 2 units
  • Piezo buzzer · 8 Ω speaker option
  • 0.96 in I2C OLED (SSD1306)
  • Arduino IDE
  • Solderless breadboard · jumper wires
  • 10 µF supply decoupling capacitors
  • USB 5 V power · 9 V battery option
Parameter Value
Controller Arduino Nano (ATmega328P)
Pitch sensor HC-SR04, 2–400 cm sensing range (datasheet)
Volume sensor HC-SR04, 2–400 cm sensing range (datasheet)
Pitch control zone Approximately 5–40 cm hand distance (design target)
Pitch range Approximately C4–C5, 262–523 Hz (design target, configurable)
Volume control zone Approximately 5–40 cm hand height (design target)
Audio output Square-wave via tone(), approximately 100 Hz–2 kHz usable (expected)
Display 0.96 in, 128 × 64 px I2C OLED (datasheet)
Reading cycle Approximately 50–100 ms per sensor pair (expected)
Power 5 V USB, approximately 200 mA peak (expected)
Major components 12 (counted)

Project features

The Contactless Theremin-Style Musical Instrument using Ultrasonic Sensors and Arduino is built around four ideas that make it both fun to play and easy to defend in a viva. First, dual-hand gesture control: two HC-SR04 sensors act as invisible faders, one reading the right hand's distance for pitch and the other reading the left hand's height for volume. Second, an honest note readout: a small OLED continuously shows the nearest note name and its frequency in hertz, so every tone the instrument makes is tied to a number the student can point at. Third, firmware smoothing with a builder's calibration note — each sensor's supply rails carry a 10 µF capacitor, the single most common fix for jittery pitch readings, and the firmware averages successive readings before mapping them to notes. Fourth, a printed distance-to-note chart so the student can verify every claim on the bench with a ruler, a hand, and the OLED.

  • [Dual-hand ultrasonic gesture control] Two HC-SR04 sensors face upward like antenna posts; the right hand's distance sets the pitch and the left hand's height sets the volume, mirroring how a real thereminist's hands shape sound.
  • [Live note and frequency display] A 0.96-inch I2C OLED continuously shows the current note name (e.g. C4) and its frequency in Hz, so the player and the examiner both see exactly what is being played.
  • [Pitch mapping with note table] Firmware maps hand distance to a chromatic note table spanning approximately C4–C5 by default, with the mapping range adjustable in one clearly marked section of the code.
  • [Volume-by-hand-height] The left-hand sensor's distance is mapped to the buzzer/speaker drive level, so raising the hand swells the note and lowering it fades to silence.
  • [Reading smoothing in firmware] Successive distance readings are averaged and clamped to reject the occasional ultrasonic misfire, and a 10 µF capacitor across each sensor's supply rails damps the electrical jitter that otherwise makes the pitch wobble.
  • [Tone output through buzzer or speaker] The Arduino's tone() function drives a piezo buzzer in the base build, and the same output pin drives a small 8 Ω speaker for a louder, fuller demonstration.
  • [Distance-to-note chart] A printed chart maps hand distance in centimetres to the note the firmware plays at that distance, giving the student a bench-verifiable reference for demonstrations and viva questions.

What is included

  • Working breadboard prototype with labeled wiring and sensor stands
  • Commented Arduino firmware (.ino) with adjustable note table and mapping ranges
  • Distance-to-note chart for bench verification
  • Circuit and wiring documentation with component list
  • Project report PDF (background, sensing principle, firmware design, calibration procedure)
  • PPT presentation for final review
  • Viva Q&A preparation document
  • Demonstration guidance for playing the instrument

Limitations & prerequisites

  • This is a demo instrument, not a concert-grade theremin — it is built for the thrill of contactless play and for learning, not for stage performance.
  • The default firmware quantizes pitch to a note table, so there is no continuous glissando as shipped; continuous-pitch mode is a small firmware change, listed as a customization.
  • The HC-SR04 cannot sense below approximately 2 cm (datasheet blind zone), and readings jitter with loose sleeves or angled hands — smoothing reduces this but does not eliminate it.
  • Arduino tone() produces a thin square-wave tone, not the warm sine of an analog theremin; a speaker plus amplifier improves it but changes the sound only modestly.
  • Ultrasonic sensing assumes reasonably still air — a fan or moving curtain near the sensors causes spurious readings.
  • No pitch accuracy is claimed as measured; the note chart gives the student a buyer-run calibration procedure to verify every note.
  • For indoor demonstration only; outdoor wind and background ultrasound make readings unreliable.

Frequently Asked Questions

How does it play music without touching anything?

It never touches the player — two ultrasonic sensors watch the hands like invisible faders. The right-hand sensor measures how far the hand is and converts that distance into a musical note, while the left-hand sensor reads hand height and converts it into volume, exactly how a thereminist's hands shape pitch and loudness around a real theremin's antennas. The Arduino samples both sensors roughly every 50–100 ms, maps the distances to a note frequency and a loudness level, plays the result through the buzzer or speaker, and shows the note name and frequency on the OLED so the audience sees what the hands are doing.

Which controller is used and why?

An Arduino Nano (ATmega328P). The Nano plugs straight into the solderless breadboard, provides enough digital pins for two HC-SR04 trigger/echo pairs plus I2C for the OLED and one tone() output pin, and the entire firmware is plain commented Arduino C — nothing is hidden in libraries the student cannot read. Because the build uses a Nano rather than a larger board, the whole prototype stays compact on a single breadboard, which also keeps the wiring short and the ultrasonic readings stable.

Does it need internet, a phone, or a computer to play?

No — it plays fully offline once built. The firmware runs entirely on the Arduino Nano, the note table and mappings live in the code, and power comes from any 5 V USB source or a 9 V battery through the Nano's regulator. A computer is needed only during development, to upload the firmware from the Arduino IDE; during a demonstration or viva, the instrument is a standalone box with two sensors, a buzzer or speaker, and the OLED.

Is this project suitable for a final-year project?

Yes — for Electronics, E&TC and Electrical final-year programs. It demonstrates ultrasonic time-of-flight sensing, embedded C firmware, signal smoothing and mapping, human-machine interaction, and basic audio synthesis through tone(), every part of which the student builds, calibrates, and demonstrates personally. Every parameter is measurable on the bench — a student can verify distance-to-note mapping with a ruler and the OLED — which makes viva questions about working, calibration and limitations easy to answer honestly.

Can it play smooth pitch slides like a real theremin?

Not as shipped — the default firmware deliberately quantizes pitch to a note table so a beginner can hit clean notes. A real theremin glides continuously, and that behavior is only a small firmware change away: the note-table lookup can be replaced with a continuous distance-to-frequency map, which is documented as a customization. No glissando smoothness is claimed or measured; it is presented honestly as a configurable mode, not a shipped feature.

Can it be customized?

Yes, with realistic modifications only. Common requests are a small 8 Ω speaker with an amplifier stage for richer tone, a wider pitch range of two octaves, continuous-pitch mode instead of the note table, MIDI-over-USB output to drive a computer synthesizer, and an alternate sensing method such as infrared distance sensors. Each is assessed for technical feasibility and timeline before it is promised, and the base note-table instrument is never described as including them. Suitable for B.E./B.Tech final-year projects in Electronics, E&TC and Electrical.

Components & software requirements
  • Arduino Nano (ATmega328P)
  • HC-SR04 ultrasonic sensor · 2 units
  • Piezo buzzer · 8 Ω speaker option
  • 0.96 in I2C OLED (SSD1306)
  • Arduino IDE
  • Solderless breadboard · jumper wires
  • 10 µF supply decoupling capacitors
  • USB 5 V power · 9 V battery option
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Related guides

All guides
Get a quotation