Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!

FPGAs with a Special Touch — Capacitive Touch

Add capacitive touch button functionality to your FPGA design with this clever controller written in platform-independent VHDL.

Hardware peripherals for FPGA designs contain quite a broad range of input sensor types. While capacitive touch buttons are not new to the FPGA realm, clever implementations of them have popped up in many places over time, and maker Stephan Nolting has developed his own capacitive touch button controller for FPGAs.

Written purely in VHDL in order to make it platform independent, captouch is a clever capacitive touch controller module that can turn any FPGA I/O pin into a capacitive touch button. The hardware is comprised of a "button" which is an area of conductive material such as PCB copper coated with solder mask being fed by an extremely limited current supply (a 1 MΩ pull-up resistor) connected to the FPGA's IO pin.

The conductive pad or "button" acts as a variable capacitor in the circuit. When the value is stable (which is when a finger is not near or touching the pad), the capacitance takes a specific amount of time to fully charge since the effective circuit is your typical RC charging circuit.

However, when a finger is introduced into the circuit through touch or close proximity, the capacitance of the pad is increased. This increase drops the voltage the FPGA IO pin sees for a period of time until is charges back up. By measuring the amount of time it takes the voltage on its IO pin to return to the supply/rail voltage, the FPGA can determine if the capacitive button is being "pressed" or not.

To further keep the controller from being hardware dependent, captouch also has a self-calibration routine written into it. Which requires the conductive pad to be in a state with no outside capacitance present (ie a finger) such that it can repeatedly measure how long it takes the pad's capacitance to change up to the supply voltage. This gives the VHDL controller a baseline for what the capacitive touch button's off state is.

Source the code for captouchhere, where you can also read a more in-depth and detailed explanation of its theory of operation.

Whitney Knitter
All thoughts/opinions are my own and do not reflect those of any company/entity I currently/previously associate with.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles