The Micro:bit Accelerometer Theremin. Cool case, but no lights this time. (All Images: ME)
I didn’t care for the sound that the last accelerometer Theremin produced. I wanted something that produced a pure square wave sound. The result was more than I could have wanted. It sounds like Atari sounds better than the Atari Punk Console a few projects back.
There are two modes of this Theremin. One is a pure square wave. The second is “smooth” mode, where the sound can be adjusted. Both modes have their charms. So, it’s up to you what you want to do with it.
The software works as follows:
- Power it up.
- Press and hold button “A.”
- Move the Micro:bit around to hear the sounds change.
First, let’s gather all the necessary components you’ll need to build this project.
Laser cutter to cut the case
Video demonstration of the project:
Load the code onto the Micro:bit.
I am providing the hex file you need to drag and drop onto the Micro:bit, and the python code as two separate files. For the below process, just use the hex file.
Plug the MicroUSB cable into the Micro:bit, and plug the other end of the cable to a PC or MAC.
At this point, you are going to copy over the code to the Micro:bit. I am providing the program (code) in this post that needs to be copied over. When the Micro:bit plugs into a computer, it shows up as a USB flash drive. All you have to do is copy the file over to the Micro:bit, like it’s a USB Flash Drive, and the Micro:bit will reset, and the program is active.
You can remove the Micro:bit from the computer at this point. The program will start running, and without the rest of the circuit, it will not function.
A little bit about the code:
This section defines how this Theremin operates. You can adjust the two variables at the bottom for some distinct changes.
I like this project a lot, since it doesn’t have a lot of steps and parts. Following is the only wiring you have to do.
Wire up the audio connector.
- Plug in powered speakers to the 3.5mm jack.
- Power it with a 5V microUSB cable from either a PC, outlet or battery.
- Press and hold button "A." It will produce a tone.
- Move the Micro:bit around to hear the sounds.
STEP 4 (Optional)
Changing the sound parameters.
- In the code there are a few variables you can change to modify the sound.
- If the variable smooth = True, you can change the following two variable to modify the sound.
- Change those variable to see what differences can be made to the sound.
Pure square wave sound is, by far, my favorite. I could see a performance made from using several Micro:bit accelerometers tuned to various ranges and qualities.
I'm not sure where else to take this project. I am open to suggestions...