Arduino Uno Metal Touch Sensor Module

This project demonstrates how to use an Arduino Uno to interface with a metal touch sensor module.

The sensor detects the presence of a touch on a metal surface and outputs a signal that the Arduino reads and displays on the Serial Monitor.

How It Works

The KY-036 metal touch sensor detects contact with human skin by using the body's own conductivity. A small exposed metal wire acts as the electrode, and touching it completes a path to ground through the body — a path with resistance in the hundreds of kilohms to megohms, far too high to drive a logic input directly.

A Darlington transistor pair, typically a KSP13, provides the necessary gain. Two transistors in cascade multiply their current gains, giving an overall gain in the thousands, so the microampere-scale current flowing through skin is enough to switch the output.

This is conductive sensing and is fundamentally different from the capacitive touch found in phones. Capacitive sensing detects a change in field and works through a plastic case; this module needs bare metal-to-skin contact. Gloves defeat it entirely.

The module provides both an analog output, which varies with contact quality and skin resistance, and a digital output from an LM393 comparator with a threshold set by the onboard potentiometer.

Components Needed

  • Arduino Uno
  • Metal Touch Sensor Module
  • Jumper Wires
  • Arduino Uno

Wiring to the Arduino Uno

Connect AO to A0 and DO to D2, with VCC on the 5 V rail and GND to ground. Either output alone is sufficient depending on whether you want proportional or threshold behaviour.

The sensing electrode is the small exposed wire — it must stay bare. Any coating, paint or conformal finish prevents conduction and stops the sensor working.

Sensitivity depends on how firmly the user touches and on skin moisture. Set the potentiometer with a dry finger making light contact, which is the worst case, so firmer or damper contact also triggers reliably.

Module pinArduino Uno pinFunction
A0 / AOA0Analog contact strength
D0 / DOD2Digital trip from the comparator
+ / VCC5VSupply
G / GNDGNDCommon ground

Example Code

Touch detection with hold-time measurement to distinguish taps from long presses. Upload it with the board set to Arduino Uno and open the Serial Monitor at 9600 baud.

Touch detection with hold-time measurement to distinguish taps from long presses
const int TOUCH_ANALOG  = A0;
const int TOUCH_DIGITAL = 2;
const unsigned long LONG_PRESS_MS = 800;

bool touching = false;
unsigned long touchStart = 0;

void setup() {
  Serial.begin(9600);
  pinMode(TOUCH_DIGITAL, INPUT);
}

void loop() {
  bool now = (digitalRead(TOUCH_DIGITAL) == HIGH);
  int strength = analogRead(TOUCH_ANALOG);

  if (now && !touching) {
    touching = true;
    touchStart = millis();
    Serial.print("touch start, strength=");
    Serial.println(strength);
  }
  else if (!now && touching) {
    touching = false;
    unsigned long held = millis() - touchStart;
    Serial.print(held > LONG_PRESS_MS ? "LONG press " : "short tap ");
    Serial.print(held);
    Serial.println(" ms");
  }
  delay(20);
}

Applications

A metal touch sensor turns up in a wide range of projects. These are the uses where it is the right choice rather than a compromise:

  • Touch-activated lamps and switches with no moving parts
  • Hidden controls behind a metal fascia
  • Interactive exhibits where visitors complete a circuit
  • Presence detection on handles and grips
  • Teaching transistor gain and the Darlington configuration

Working with the Arduino Uno

The Arduino Uno is built around the ATmega328P and runs on 5 V logic with 2 KB of SRAM and 32 KB of program flash. These details change how this circuit is wired and what the sketch can do, so they are worth stating plainly before you build.

The Uno runs at 5 V, so most hobby sensor modules connect directly with no level shifting.

With only 2 KB of SRAM, avoid large buffers and prefer the F() macro for constant strings.

The single hardware UART is shared with the USB connection, so heavy Serial printing competes with uploads.

Arduino Uno characteristicValueWhy it matters here
Logic voltage5 VMatches most hobby modules directly
ADC resolution10-bit (0–1023)Sets how finely an analog reading can be resolved
Analog inputsA0–A5 (six channels)Determines how many analog sensors can share the board
PWM outputsD3, D5, D6, D9, D10 and D11Needed for brightness, speed and tone control
I²C pinsA4 (SDA) and A5 (SCL)Fixed by hardware — wiring copied from another board may not match
Interrupt pinsD2 and D3 onlyRequired for counting fast or asynchronous events
Seriala single hardware UART shared with USBMonitor runs at 9600 baud by default

Troubleshooting

Most problems with this module fall into a handful of categories. Work through these before suspecting the part itself:

  • Nothing happens on touch — the electrode is coated, or the potentiometer is set too insensitive.
  • It triggers without contact — sensitivity is far too high, and the electrode is picking up mains hum. Back the pot off.
  • It works for one person but not another — skin resistance varies enormously. Set the threshold for the driest user.
  • It fails through gloves — expected. Conductive sensing needs bare skin; use a capacitive sensor such as the TTP223 instead.
  • Readings drift through the day — humidity changes skin conductivity. Re-check the threshold seasonally.
  • Code written for an ESP board gives odd analog values — the Arduino Uno uses a 10-bit ADC returning 0–1023; rescale any constant taken from a 12-bit example.
  • An I²C sensor is not found after copying wiring from another Arduino — on the Arduino Uno I²C is on A4 (SDA) and A5 (SCL).

Taking It Further on the Arduino Uno

Once the basic reading works, where you go next depends very much on which board you are using. These are the directions that suit the Arduino Uno specifically:

The Uno’s shield ecosystem is its real advantage. Once the circuit works on a breadboard, a prototyping shield turns it into something permanent that still stacks with a data-logging or Ethernet shield without rewiring.

Logging to an SD card via a shield is the natural next step, since the Uno has no onboard storage and no network. Timestamp each reading with a DS3231 real-time clock so the log survives power cuts with correct times.

Because SRAM is limited to 2 KB, keep logged strings short and write them out immediately rather than buffering. Building a long String in memory is the most common cause of an Uno sketch that runs for hours and then freezes.

Notes and Practical Limits

Because the sensing path runs through the user, keep the circuit battery-powered or properly isolated if the electrode is accessible. The currents involved are tiny, but good practice is to never place a person between a mains-derived supply and ground.

A TTP223 capacitive touch module is the better choice for most products: it works through a few millimetres of plastic, needs no exposed metal, and is unaffected by skin condition.