Loading...

The “Poor Man’s Theremin” – Arduino project (Ultrasonic Sensor)

This is a didactic project for to learn how to connect an Ultrasonic Sensor to an Arduino UNO.

 

 

COMPONENTS REQUIRED

COMPONENTSPRICE
Arduino UNO clone (Aliexpress)$ 2.40
Ultrasonic Sensor (Aliexpress)$ 0.75
2 Buttons (Aliexpress)$ 0.64 ($ 0,32 x 2)
Plastic box for cheese 🙂Free

 

CONNECTIONS

ULTRASONIC SENSORARDUINO
VCC5V
TRIGD5
ECHOD6
GNDGND
BUTTON 1
PIN15V
PIN2- GND (resistor 10K ohm)
- D12 (see the picture)
BUTTON 2
PIN15V
PIN2- GND (resistor 10K ohm)
- D13 (see the picture)

In this schematic I drawn a connection to an external speaker but, if you prefere, you can connect the PIN 8 to a Panel Mount Jack (if you wish connect a earphones).

 

SOFTWARE (SKETCH)

To upload the software for the Poor Man’s Theremin you have to download and install the free ARDUINO IDE clicking here.

The Ultrasonic sensor sends very short pulses of ultrasound to measure the distance to an object. The distance is calculated in CM e converted in tones: distance = 0.034 * duration / 2;
I created an array to convert the CM in tones: tone(PIN8, tones[distance ]);

Copy and paste this code in a new arduino sketch!

Enjoy it!

5 comments