top of page

Hardware

From buttons to microcontrollers, let's look at what makes the MTP-25K work.

teensy-4.1-cover.webp

Teensy 4.1

The Teensy 4.1 has exceeded our expectations as the 'brains' of the operation. We chose the Teensy based on its powerful processor and included amenities. For instance, its 600MHz Arm Cortex-M7 microcontroller (MCU), two ADC units with 18 input pins, 3 I2C busses, and over 40 GPIO pins... This all comes packaged with out-of-the-box Arduino IDE compatibility and pre-existing USB MIDI libraries, which made getting to work immediately accessible. If you want to learn more about the Teensy 4.1, you can visit their website, here.

1000002040_edited.png

Capacitive Touch Keys

We designed our touch keys to be integrated into the final Printed Circuit Board (PCB) design. When you play the keys, you are directly interacting with the PCB itself!

The touchpads themselves are, technically speaking, electrodes - flat areas of copper pour on the top layer of the PCB which have an inherent electrical capacitance. When the user touches the surface of the touchpad, the much-smaller amount of capacitance in the user's finger is combined with the capacitance in the electrode - creating a small change in the total capacitance on the line. These changes are detected by AT42QT1010 sensor ICs, which generate on or off signals within milliseconds for the MCU to read and process. 

Due to the number of touch pads and the number of pins on the Teensy, we used GPIO expanders to incorporate all the needed controls.

MCP23017 I/O Expanders

In order to get all our user inputs into our MCU, we needed to expand our available inputs and outputs (I/O). This is precisely where the Adafruit MCP23017 I²C I/O Expander comes in. The MCP23017 uses the Inter-Integrated Circuit (I²C) communication protocol to feed digital data to and from the MCU. This allows the MCU to read or set the states of the expander's 16 pins using only one data line and one clock line connecting them. Multiple I²C devices can be attached on the same I²C bus (in other words, the same pair of pins on the Teensy.) We used two of these GPIO expanders to read the states of our two-octave keyboard - one for the lower 13 keys, and the other for the 12 upper keys.

adafruit_products_5346-09.jpg
SchemaPiezo.gif

Piezoelectric Circuit

To detect how hard the user hits a key, we used piezoelectric sensors attached to the bottom of our PCB. When the sensor vibrates, it generates a voltage waveform proportional to that vibration. In this context, our piezoelectric sensors work as a simple form of microphone, converting physical vibration into an electrical signal. We can combine this with a peak detector circuit to get a stable magnitude reading for each touch, then read that voltage with our MPU’s internal analog-to-digital converter (ADC) and use it to set the note velocity, changing the volume and timbre of the note played. 

​​

In the animation on the left, the change in shape has been exaggerated to better illustrate the piezoelectric phenomenon. The piezoelectric crystal generates a potential difference (a voltage) across its terminals when deformed from its normal state.

Peak Detectors

Due to the rapid oscillation and changing amplitudes of the piezoelectric sensor waveforms, we had trouble consistently reading the maximum values reached in initial testing. To fix this problem, we added peak detecting circuitry. These circuits use a capacitor to hold the maximum voltage level reached by the sensor, giving us much more reliable results when taking an ADC read.  We used Digikey’s article on peak detection as a reference in designing this circuit. We tested basic functionality with an LM324N op amp from our parts kit, but used the 4-channel LMV324 with better low-voltage behaviour (used at 3.3V) and rail-to-rail output which allows us to accurately reproduce the peak level of the input signal.

Waveform-Peak-Detection.webp
modulators.jpg

Modulation Controls

In place of mechanical knobs and sliders, the MTP-25K will use capacitive touch surfaces shaped as two sliders and an XY pad for modulation controls. Similarly to the keyboard, these are made up of copper pour electrodes in the top layer of the PCB. We are using two IQS7211A ICs to control these: one for the Pitch Bend and Mod sliders, and one for the XY trackpad. These sensor chips track the location of the user’s fingertip in real time as it moves across the modulation area, and communicates with the MCU over I²C. Unlike the AT42QT1010 sensors in the keyboard section which provide a simple on/off signal, the IQS7211A gives real time 2-dimensional X and Y position data for touch surfaces like trackpads.

Mechanical Push Buttons

The MTP-25K will be equipped with five push buttons. Four will control musical features - octave up, octave down, hold, and arpeggio - while the last acts as a Shift key. Holding the Shift key will modify the behaviour of the buttons and sliders, allowing the user to change feature modes and arpeggio tempo. We have tested basic functionality on a breadboard and are working on implementing these on our final PCB.

Buttons.jpg
2946-06.jpg

IS31FL3731 Charlieplexer 

The MTP-25K uses over 80 Light-Emitting Diode (LED) indicator lights as visual feedback to the user, indicating critical information about what the device is doing. To drive these, we used an IS31FL3731 from Adafruit. This driver is able to control up to 144 LEDs at once with only two banks of 9 pins. This is possible due to the use of charlieplexing, a form of multiplexing that allows (n) number of pins to individually control (n² - n) LEDs.

In our case: 9 pins per bank = (9² - 9) LEDS per bank = 72 LEDS per bank, x 2 banks = 144 LEDs total.

The charlieplexer takes information from the MCU regarding which LEDs to light and when over I²C, just like the I/O expanders. We were able to connect both expanders and the charlieplexer all on the same I²C bus. The IS31FL3731 is also capable of separate Pulse-Width Modulation (PWM) of each individual LED, allowing us to dim the LEDs to our liking, reducing the total power consumption of the lighting system.

LED Lighting Matrix

Next, our charlieplexer wouldn't do anything for us without a matrix of LEDs for it to control. After several days of studying the wiring pattern and manually soldering thin gauge stranded wire to our low-power LEDs by hand, we had a fully working lighting system capable of lighting any indicator we needed with just a simple command in the firmware code.

LED Matrix - Interior_edited.jpg

Enclosure

In order to hold it all together, we needed an enclosure. We elected to design a custom, 3D-printed case which would allow us to lay out our hardware exactly as we needed it to sit. This was critical for a musical instrument, which is an inherently tactile device. Even small differences in the layout would massively affect the feel and playability. The enclosure has numerous openings for the touch surfaces which the user interacts with, as well as giving a space underneath the top surface for the wiring of the LEDs to sit inside.

Enclosure Diagonal.png
bottom of page