Creating a Capacitive Touch Slider Element
Overview
A capacitive touch slider is a touch input element made from multiple conductive pads. As a finger moves across the pads, firmware can estimate position and create a smooth slider interaction for brightness, volume, menu navigation, and more.
In this tutorial, we'll build a slider footprint using multiple polygon <smtpad /> elements and cover them with solder mask.
Build the Slider Footprint
The example below creates 7 interleaved diamond/rectangle polygon pads in one custom footprint.
Each pad is exposed electrically as a separate channel (S1 to S7), but visually appears under solder mask as a clean touch area.
What coverWithSolderMask / covered_with_solder_mask Does
- In tscircuit JSX, you set
coverWithSolderMaskon each<smtpad />. - In generated PCB JSON, this is represented as
covered_with_solder_mask. - This keeps the copper pad under solder mask instead of exposing bare metal.
- For capacitive touch, this is useful because the user touches the solder mask surface while capacitive coupling still works through the mask.
Final Result
This design produces a compact capacitive slider footprint made from repeated polygon pads arranged into a continuous touch strip. In PCB view, you get a smooth slider geometry with each segment separately routable to a sensing channel.