DIY Hidden Capacitive Touch Buttons in 3D Prints for ESP32

by John Phillips in Circuits > Microcontrollers

10399 Views, 39 Favorites, 0 Comments

DIY Hidden Capacitive Touch Buttons in 3D Prints for ESP32

IMG_7163.jpg

This project shows you how to create durable, professional-looking capacitive touch sensors using 3D printing and embedded copper tape — perfect for ESP32-based touch projects.

The process is simple but gives excellent results:

  1. Start the 3D print and let it lay down the first 3 layers (about 0.6 mm).
  2. Pause the print and carefully stick copper tape in the designated pad area. This tape will form the actual capacitive sensor surface.
  3. Resume printing, allowing the remaining layers to encapsulate the copper tape inside the object. This protects the tape from wear, gives a clean appearance, and keeps the surface flush.
  4. The design includes an extruded hole down to the tape, so you can solder a hookup wire directly to it. The hole is then sealed with hot glue for mechanical strength and insulation.

Once connected to an ESP32 touch-capable pin, the embedded pad works just like any capacitive touch button — but with the added benefit of being part of your custom 3D-printed part. The copper is fully protected, the wiring is secure, and the finish is smooth enough to blend seamlessly into your design.

Capacitive Touch Sensing on ESP32

The ESP32 has built-in capacitive touch sensing on ten dedicated pins (T0–T9), so you can read touch input directly without extra hardware. Each touch pin is connected to an internal circuit that measures the time it takes for the pin’s voltage to charge or discharge through stray capacitance.

When you touch a sensor pad (for example, copper tape or conductive paint), your body adds extra capacitance to ground. This slows the charge/discharge rate, and the ESP32’s touchRead() function reports a lower value.

A few key points:

  1. No additional components are required — just a conductive pad connected to a touch-capable pin.
  2. Lower readings mean more touch — typical idle values might be 50–100+, and touched values 10–40 depending on pad size, shape, and grounding.
  3. Pad design matters — larger pads or shapes with more surface area increase sensitivity, but also pick up more noise.
  4. Environment affects readings — humidity, grounding, and nearby objects can shift values, so it’s common to calibrate thresholds at startup.
  5. Software filtering (e.g., averaging or an exponential moving average) helps smooth noise and avoid false triggers.

Supplies

  1. 5 mm Adhesive Copper TapeJaycar NM2870, 5 mm × 10 m
  2. Hookup Wire – approx. 24 AWG; stranded core recommended (e.g. stripped from CAT5 cable)
  3. Soldering Tools & Supplies – soldering iron, solder, wire strippers, tweezers, hot glue gun
  4. 3D Printer & Filament – for printing the panel with embedded copper tape.
  5. PETG or another temperature-tolerant filament is recommended to better withstand soldering heat near the access hole.
  6. ESP32 Microcontroller with Touch Inputs – e.g. WROOM-32 Dev board

Creating the Design

Screenshot 2025-08-10 at 1.56.24 pm.png
Screenshot 2025-08-10 at 1.56.43 pm.png

The goal is to create a 3D-printed panel that hides the copper tape inside the print while leaving a clean, professional surface — with a small access point for soldering. Here’s how to model it:

1. Extrude the base panel to three layers thick

  1. In most slicers, three layers at 0.2 mm per layer equals 0.6 mm total thickness.
  2. This forms the base surface where the copper tape will sit.
  3. Keep the top surface of this extrusion flat — it will be the bonding surface for the tape.

2. Add marker grooves for tape placement

  1. Cut shallow markers one layer deep (about 0.2 mm) into the top of the 3-layer base.
  2. These markers act as guides so you can place the copper tape precisely when you pause the print.
  3. You can make these grooves match the exact width and shape of your copper tape.
  4. I have tested using 20mm lengths of 5mm copper tape. Different tape lengths will impact the sensitivity of the panel, and you will need to test based on your final configuration.

3. Extrude the remaining layers with a solder access hole

  1. Extrude the rest of the panel to your final desired thickness (for example, another 1.4 mm for a 2 mm total thickness).
  2. Include an extruded hole from the top surface all the way down to the third layer (where the tape will be).
  3. This hole allows you to solder a hookup wire directly to the embedded copper tape after printing.
  4. Plan for the hole to be large enough that you'll be able to solder hookup wire to the copper tape, 3mmx5mm has been workable for me.

When printed, these features create a perfectly embedded copper sensor pad — invisible from the surface but electrically accessible through the small hole.

Slicing and Printing

IMG_7149.jpg

These steps assume a 0.2 mm layer height, with the copper tape embedded after layer three (0.6 mm height).

This guide does not cover printing sensor boundaries in different filament colours — if you want to do that, follow your printer’s usual multi-material procedure.


Slicer Configuration

  1. Pause at completion of layer three
  2. In your slicer, insert a pause command (e.g., M0 or your printer’s pause at height feature) right after layer three finishes.
  3. This will stop the printer at exactly 0.6 mm so you can insert the copper tape.
  4. Solid layers for layers four and five
  5. Set layers 4 and 5 to print as 100% solid infill.
  6. This fully encapsulates the copper tape and ensures a flat, even surface for the remaining print.
  7. Preferably slow print speed for layers four and five
  8. Reduce print speed for these two layers (e.g., 30–40 mm/s) to ensure good adhesion to the copper tape and prevent the nozzle from dragging on it.


Applying the Copper Tape

When the printer pauses at the completion of layer three:

  1. Carefully apply copper tape to the marked pad areas.
  2. Use tweezers to place the tape precisely within the recessed grooves or boundaries you designed.
  3. Use a small, smooth tool (like the back of a plastic spudger or the flat edge of tweezers) to press the tape firmly into place.
  4. Avoid excessive contact with your fingers — the natural oils on skin reduce tape adhesion and may affect conductivity over time.
  5. Ensure a clean surface:
  6. The copper tape should be flat, wrinkle-free, and firmly bonded to the plastic.
  7. If your design includes a solder access hole, make sure the tape extends over that location to ensure a good electrical connection later.


Resuming the Print

Once the copper tape is applied and smoothed:

  1. Resume printing from layer four.
  2. Layers four and five will fully cover the copper tape, sealing it inside the print.
  3. Printing slowly over the tape helps avoid any snags or lifting.

After the print is complete, you can solder a hookup wire through the designed access hole down to the embedded tape, then seal the hole with hot glue for strength and insulation.

Solder and Secure the Wires

IMG_7164.jpg

Soldering and Securing the Wires

Once the print is complete and the copper tape is fully encapsulated inside the part, you can solder your hookup wire through the access hole to make an electrical connection.

1. Prepare the wire

  1. Strip 3–5 mm of insulation from the end of your hookup wire.
  2. Twist the strands together so they are neat and tight.
  3. Tin the wire: apply a small amount of solder to the stripped section so it is pre-coated. This makes the actual soldering to the copper tape much quicker and cleaner.

2. Position the wire

  1. Insert the tinned end of the wire into the extruded access hole until it sits flat against the copper tape.
  2. Ensure the wire is not at an angle — full surface contact between the tinned end and copper tape gives a more reliable connection.

3. Solder to the copper tape

  1. Set your soldering iron to around 350 °C.
  2. Working quickly, press the tinned wire onto the copper tape with the iron tip until the solder melts and bonds.
  3. The goal is to melt the solder just enough for it to flow — avoid prolonged heating that could soften or deform the surrounding printed plastic.
  4. Remove the iron and hold the wire steady for a few seconds while the solder cools and hardens.

4. Secure the connection

  1. Once the solder joint has cooled, apply a small amount of hot glue into the hole to hold the wire in place and protect the joint.
  2. The glue also acts as strain relief, reducing the risk of the wire breaking free if it is tugged.

This method ensures a reliable electrical connection to your embedded copper pad while keeping the printed part structurally intact and the surface looking clean.

Connecting the Touch Pads to the ESP32

Once your capacitive touch pads are soldered and secured, they can be connected directly to the ESP32’s touch-capable pins (T0–T9). These pins work with the ESP32’s built-in capacitive sensing hardware — no extra electronics are needed.

Steps

  1. Identify the touch pin you want to use (e.g., T6 = GPIO14, T4 = GPIO13 — full table is in the README of the GitHub repo).
  2. Connect the hookup wire from the pad directly to that pin on the ESP32.
  3. Connect the ESP32 ground to the same ground reference as your entire project — a stable ground improves touch sensing reliability.
  4. Upload the example code from the GitHub repository. This will allow you to monitor the touch readings and test your thresholds.

Performance tips

  1. Keep connections short — long wires increase capacitance and pick up noise, which can reduce sensitivity and stability.
  2. Avoid routing wires next to each other if the pins are on adjacent touch channels; coupling can cause false triggers.
  3. Stay clear of noisy signals — don’t run touch wires alongside high-frequency or high-current lines (e.g., PWM motor drivers, switching regulators, WS2812 LED data lines).
  4. If you must extend the wire, use shielded cable with the shield connected to ground.


A helper and example code is available at: https://github.com/johnjphillips/ESP32-Capacitive-Touch-Interface