Community Builds: Tabletop Touch UI

Our community at PCSoc is full of talented builders, putting together everything from gaming PC systems to custom designed electronics.

One of our members has recently made something quite spectacular and we think it deserves some attention!

Vinson (who goes by fish#1811 on Discord) has made a programmable tabletop touch UI for his desk that allows him to control electronics in his room – we’ll let him tell you more about it.

As a tinkerer, I’m always adding new things to my room to improve quality of life and/or try new ways of interfacing with things. Moving into my new room, I realised the unused cable management hole on my table was in a perfect location for some sort of interface that would let me control things in my room. Since items could potentially be placed on top of it, it had to be low profile and durable. I decided on a touch slider interface with LED indicators, similar to the Touch Bar you find in MacBooks (albeit circular rather than long).

The decision of an ESP8266 as the main MCU was very straightforward. It’s cheap with Wi-Fi capabilities, fast and I’m familiar with it. Originally the idea was to use the single ESP to manage everything. However, if there were any delays/hangs with the wifi implementation, the light/touch UI would have stutters/freezes. Hence I decided to use a ATMEGA328P (same one used in the Arduino UNO) to handle the light bar and the touch interface. It’s cheap, fast enough for the job and has readily available libraries for the ICs I would be using.

To handle the individual LED control, originally I considered using a shift register like the TPIC6B595. However, each one only has 8 outputs and board space was extremely limited so I decided on using a more expensive I2C 16 channel PWM controller, the PCA9685. The touch control was handled by using two TTP229’s. They were cheap, had 16 channels each and integration with the 328P was straightforward. I wasn’t sure of how the colour would show up through the fibreglass PCB material so I knew I wanted an RGB LED of some sort. I decided on a WS2812B as it was cheap and only took up a single GPIO pin as well as being easy to solder (4 pads as opposed to 6 tiny pads on a normal 5050 RGB LED).

Figuring out communication between the two MCUs was a bit of a challenge. At first I considered serial as it was fast and didn’t require many GPIO pins. However, it would be frustrating to program/debug it as the ESP only has a single hardware serial port and I haven’t worked with software serial before. So I decided to settle on something that I’m more familiar with; shift registers. I could use 3 pins on each MCU and have a very scalable resolution (registers are daisy chainable and can output/read 8 bits). It would also act as a buffer which means the ESP could retrieve the value any time it wanted and the 328P wouldn’t need to continuously send values.

Designing the PCB was straightforward but a very long process (as there was a lot of manual coordinate work). I had them manufactured at JLCPCB and soldered the components on by hand at home. I have two CH340C USB-UART ICs onboard as it would let me debug/program both MCUs easily.

To interface it with my Yeelights (from Xiaomi), I used the documentation to figure out the operation specifications and programmed the ESP8266 to send requests to the appropriate IP address. I’m considering making this commercially available for other tinkerers who would like a wifi enabled physical UI to play around with. 

If you liked what you saw, follow Vinson on Instagram or check out his YouTube channel for more!