Theremin
.jpeg)
Made during a fast prototyping course, this project consists of the creation of a theremin. It is a musical instrument whose note frequency and tempo change depending on the distance between the hands and the sensors.
Supplies
Arduino Uno
Breadboard
Wires
2 Grove Speakers Plus kit
2 Pololu VL53L0X Time-Of-Flight Distance Sensors
Volume Knob (potentiometer)
Plywood Sheet
Wiring
It is necessary to use a small breadboard.
There must be one positive (5V) rail and one ground rail with 5 components connected (the Arduino board, the two Speaker kits and the two Pololu Sensors).
Each speaker is connected to its amplifier with the supplied cable in the kit.
Each amplifier has three connections : power (red), ground (black), pin (yellow). The spot for the white cable is unused. The pin must be a PWM compatible one. In our case, the pins for the amplifiers are pins 9 and 10.
Each optical sensor has five connections : power, ground, SDA, SCL, and pin. Since both of the sensors have SDA and SCL ports, there must a SDA line and a SCL line on the breadboard, connected to the SDA and SCL pins of the Arduino Uno. Once again, the pin must be PWM compatible. In our case, the pins for the sensors are pins 3 (sensor 1) and 5 (sensor 2).
Arduino Code
The library VL53L0X (by Pololu) must be installed.
Most of the code is based on the continuous readings example, which can be found in the library.
The Arduino board can't distinguish the sensors at this point.
In the setup, both sensors are shut down, so that the broadcast address of sensor 1 can be modified to 0x30 (I2C communication protocol). The continuous readings are then launched.
In the loop, if distance 1 and distance 2 are valid, distance 1 is used to identify the note (thanks to the octaves table) whereas distance 2 determines the delay between the notes.
The notes can be seen in the Serial Monitor. Your theremin works!
Downloads
Casing



First, we have started by measuring the size of our components, permitting to deduce the necessary volume for the casing. To dimension the box, we used the makercase.com website.
Then, we generated a dxf file of that box to import in on Fusion, which allowed us to place the holes on our box.
The final substep was to set up laser cutting parameters.
3D Printing



For this project, only a piece needs to be 3D printed : the turntables.They are modelised in Fusion 360 (screenshots are displayed above) and then put in Creality Print to then print them with supports.
They are two circular shaped pieces with a max diameter of 8cm and a smaller diameter of 7cm to perfectly fit in the holes of the case.
They are also holed by a rectangular hole with the dimensions of the sensor, surrounded by 4 little holes at the dimensions of a screw, in order to fix the sensor with a small laser cutted piece.
Testing
We can finally test our project by putting all the pieces together, uploading the code and obtaining our first sound!
Both sensors are working great but the music isn’t pleasant to hear as you can hear above. This is because our speakers can only produce monochromatic waves, resulting in a cheap electronic sound.