featheremin

featheramin

A microcontroller-based theremin using CircuitPython and two LiDAR range detectors.

This project uses the new, amazing, and very cool “synthio” package. There are so many great features in there that it’s hard to know what to include and what not to. So as a design goal, this theremin project will try to keep it simple, and just support what gets us the most “theremin-y” device in the end. Perhaps a follow-on project will explore more of what-all synthio has to offer.

Hardware

So far, almost all components are from Adafruit. I love Adafruit!

Software required

Dev environment

I have been using Visual Studio Code for my IDE but I don’t think that matters. I have the CircuitPython extension installed, which is nice, but it is only somewhat functional as I also have my VS Code running in WSL2, which breaks some things. YMMV.

Note: The main code is in a file called “feathereminMain.py”; if you simply “include” this in your main.py, it will run. This is how I test various other modules - by incudling the code I want to run/test in main.py, rather than having to rename entire files to “main.py”.

Hardware config

The I2C devices are chained together in no particular order, but the 20W amplifier, if used, must be last in the chain because it has no StemmaQT connector and is attached via a StemmaQT pigtail. (It uses I2C to set volume only, not for audio data.)

The ILI9341 display is wired to the Feather’s hardware SPI interface via 6 wires (plus ground and 3.3v).

One of the VL53L0X’s XSHUT pin is connected to a GPIO output pin so we can re-assign its I2C address.

Functionality

Things to do (some of which are done - or abandoned):

Notes

Pinouts/connections for PCM5102 I2S line out breakout

| RP2040 | PCM5102 | | —— | ——- | | D9 | BCK | | D10 | LCK | | D11 | DIN | | GND | SCK |

Pinouts/connections for MAX98357A I2S amplifier breakout (not currently used)

| RP2040 | Max98357A | | —— | ——— | | D9 | BCLK | | D10 | LRC | | D11 | DIN |

Pinouts for Adafruit 2.2” TFT and EyeSPI breakout

Pretty obvious now, but I’ll document it just for fun. This shows two possible sets of connections: the first, for direct Pico-to-ILI9341 board connection; the second is for using the EyeSPI breakout board in-between.

Pico Display EyeSPI
MI - -
MO MOSI MOSI
SCK SCK SCK
A2 CS TCS
A1 RST RST
A0 DC DC
3v3 Vin Vin
GND Gnd GND

I2C Addresses

We use two VL53L0X devices; by default they both have the same address, so we need to do some magic to make things work. See the code!

I2 Address Device Notes
0x29 VL53L0X #1 Default is good
0x30 VL53L0X #2 We must set this via software and hardware (GPIO)
0x36 Rotary Encoder Default is OK; can change via jumper
0x39 APDS-9960 Gesture sensor Cannot be changed

Common Mistakes and their solutions

Demo Video