We’ve seen LCDs with touch input before, but what if the LCD itself could be used as a touch sensor? That’s exactly what YouTuber CNLohr has accomplished with his latest project, combining a 7-segment LCD, USB functionality, and touch sensing—all powered by the ultra-affordable CH32V003 RISC-V microcontroller, AKA "The $0.10 RISC V microcontroller". The CH32V003 doesn’t natively support USB, LCD driving, or touch sensing, but CNLohr’s ingenuity pushed its limits to create a fully functional, connectorless USB device with all the above functionalities using bit-banging.
The project began with tiny, budget-friendly 7-segment LCDs sourced from AliExpress, costing as little as $0.21 each in bulk. Using a custom PCB with 0.6mm thickness and ENIG surface finish, CNLohr designed a setup where the PCB doubles as a USB-C connector. For LCD control, he used precise bit-banging techniques to handle the voltage required for segment illumination, carefully avoiding damaging the LCD. To implement touch sensing, he leveraged the conductive properties of the LCD glass. By driving the outputs low and monitoring the voltage rise with the microcontroller’s ADC, he was able to detect capacitance changes caused by a finger touching the display. Oversampling further refined the touch sensing, while hysteresis ensured stable operation at the threshold of touch detection.
Integrating USB was another challenge. Since the CH32V003 lacks native USB support, CNLohr wrote a bit-banged USB stack that could handle data exchange with a host PC. He even wrote a USB bootloader for the CH32V003, that fits within the code space with a very minimal footprint of 1920 bytes. Interrupts from USB communication temporarily disrupted the LCD and touch routines, but clever timing ensured these interruptions didn’t degrade performance. The entire system, including touch sensing and LCD driving, works seamlessly alongside USB data handling. The result is a self-contained, USB-enabled, touch-capable 3-digit 7-segment display with an incredibly low bill of materials. CNLohr has shared his code and designs on GitHub, making it possible for others to replicate or build upon his work.