After initially discussing and researching the various project ideas, we came up with the idea of making a modified theremin. A theremin is an electronic instrument that is played without physical contact. Our main modification comes from using ultrasonic rangers to sense distances rather than an electric field. A Theremin is played on two axes, one controlling pitch (frequency) and one controlling volume. Thus, we decided to use two ultrasonic rangers and the GroveKit, one on top and one on the side of the device. In order to control volume, we decided to use 4 piezo buzzers, with more buzzers turning on the further the user's hand gets from the ultrasonic ranger controlling volume.
To build this, we manufactured a 5” x 3.5” x2.5” box out of posterboard and tape. Once we cut out the six pieces to make the box, we cut two holes on the top and two holes on the left side of the box in which to mount the ultrasonic rangers, as well as a large hole in the front.Initially, this would have been covered with cloth of some sort for aesthetic purposes, but due to the low volume of the piezo buzzers, we opted to leave it open. Additionally, we cut a small hole in the right side of the box with which to pass the USB cable through. Once all the holes had been cut, we assembled the circuitry for the Theremin. This is outlined in the schematics section, and also pictured below. We used a breadboard to house the four piezo buzzers, with each negative pin connected to the negative bus on the breadboard. To connect the breadboard to the grove kit, we used jumper wires extending from the grove cables. One jumper connected the ground bus to the ground wire in an arbitrary cable, and four jumpers connected the signal wires on two cables. These cables were then linked to ports J13(D) and J16(D), essentially performing the same function as linking the jumper wires to pins 37 – 40 (andground) on the launchpad. We then used the adhesive pad on the breadboard to attach it to the inside back side of the box, connected the ultrasonic rangers (top to port J8(A), side to port J7(A)), and inserted them in their appropriate holes. From there, we threaded the USB cable through its appropriate hole, and taped the box together, folding it around the grove kit and launchpad.
Distance is read from the Ultrasonic Rangers by producing an ultrasonic sound and then listening for the echo by using pulseIn. The distance read is then transformed to an input between 0 and 1 based on the minimum and maximum input distances.
The code simulates a square waveform by turning on and subsequently turning off multiple piezzo buzzers. The number of buzzers (out of n
buzzers) to play sound with is determined by partitioning the [0, 1]
input range into n
equal sub-ranges and determining which sub-range the read input falls in. If the input is in the i
'th sub-range, i
buzzers are used.
The code design is highly modular, and allows for all sorts of modifications by changing at most one or two lines of code. Our implementation uses 4 buzzers, but the code can be easily modified to use more/less buzzers by changing just two lines of code. The input distance ranges and sound frequency ranges can similarly be modified just by changing the corresponding constants in the code.
Final ProductOur final product consists of a breadboard with 4 piezo buzzers wired in parallel, as well as the GroveKit with 2 ultrasonic rangers attached, and a rectangular enclosure with one open face made of posterboard with holes for the ultrasonic rangers on the top and sides. The user places one hand in the air on the axis of each buzzer, with the top sensor indicating a higher volume as distance increases and the side sensor indicating a higher pitch as distance increases. Pitch is controlled by increasing frequency as distance sensed on the horizontal axis increases, while volume is controlled by increasing the number of buzzers playing the tone as distance sensed on the vertical axis increases.
Comments