assembly

My boardhouse boards arrived from JLCPCB. Time to solder a million components!

This board was basically a larger version of the multi-controller touchpad prototype I made. I started from there and adapted it for more touchpads.

The big problem with these boards was the time it took to measure touch response and send them over serial to the master board. If a touch board was measuring the touchpads while the master board asked for its state, it would miss the communication. So, I initially had the slave boards constantly waiting for the master board to ask for its state, then it would quickly scan the touchpads and send the result back over serial.

This obviously took far too long, so I started having the main loop compute the state of the touchpads. This would be interrupted by a change on the MOSI pin. I ran into problems at first where the MOSI pin value would change, triggering the interrupt, but no character would be relayed on MOSI (ie when the master board first powers on). The slave board code would initially wait forever to read a character. To fix this, I simply added a timeout while reading a serial character.

Timing when working with multiple boards was definitely my largest problem. It made me realize how useful it is to have an OS that does time scheduling and process management!

There also had to be a notion of strumming, as this is a ukulele. The master microcontroller is also connected to four touchpads that make up the lower half of the neck. I initially only wanted to play a string when the respective string's strumming touchpad was hit, but I found it very unreliable and noisy when swiping a finger quickly across the neck, likely due to timing resolution. So, I decided that whenever any part of the strumming neck is touched, all four strings would strum.

When a strum is triggered, the master board asks all slave boards for their state, assembles it into a holistic view of what frets are touched on each string, and then spits it out over serial for the computer to interpret.

The final serial code can be found here.

I eventually got the boards to talk to each other amicably.

a bit of fixturing

While fiddling with the board, I started to prepare it to be enclosed in the wooden chassis I'd been working on.

Knowing that I'd need to connect the FTDI header through the pocket on the backside of the ukulele body, I made the simplest of boards to which I could solder some cables carrying all the signals necessary for the FTDI header.

I also needed a small liner for the board to keep the components suspended off the surface of the wooden ukulele. I decided to lasercut a shim out of 1/8" acrylic.

This nicely elevated the components. I attached it to the board with my favorite: double sided tape!

And it snuggled nicely into the pocket on the body.