Skip to main content
Hardware & Sensors
← Return to Counter Tool

Arduino Touch Counter

Count supported sensor activations.

Live Counter

Tap, click or press Space to keep count.

0

Tap anywhere inside or press Space

CPS: 0.0•Peak: 0
Step:

How the Arduino Touch Counter Works

The Arduino Touch Counter counts activations from a touch sensor wired to an Arduino board, with the board sending each touch to the browser over USB serial.

  1. Wire the sensor: Connect a TTP223 module: VCC to 5 V, GND to GND and SIG to digital pin 2.
  2. Upload the sketch: Upload a sketch that prints TOUCH on each rising edge at 9,600 baud.
  3. Connect in the browser: Click Connect and pick the Arduino's serial port.
  4. Count touches: Each TOUCH message adds 1 to the browser counter.

Arduino Touch Counter Formula

The Arduino Touch Counter maximum message rate equals the baud rate divided by 10 bits per byte, divided by the bytes per message.

Max messages/s = Baud ÷ 10 ÷ Bytes per message
Baud
Serial speed in bits per second
10
8 data bits + 1 start bit + 1 stop bit
Bytes per message
Length of TOUCH plus a newline = 6 bytes

Example: At 9,600 baud, 9,600 ÷ 10 ÷ 6 = 160 TOUCH messages per second, far above human tapping speed.

Arduino Touch Counter Reference Table

The Arduino Touch Counter conversion table shows message capacity at common baud rates for a 6-byte message.

Baud rateBytes per secondMessages per secondTime per message (ms)
9,6009601606.25
19,2001,9203203.13
57,6005,7609601.04
115,20011,5201,9200.52

About the Arduino Touch Counter

An Arduino Touch Counter is a browser counter fed by touch events from an Arduino microcontroller. The board reads the sensor, and the browser handles display, logs and export.

Splitting the work keeps the sketch short: the Arduino detects edges and sends a message, while the browser stores data. Web Serial in Chrome and Edge lets a webpage read the board without extra software.

Ways to Use the Arduino Touch Counter

There are 5 main uses of the Arduino Touch Counter, including STEM classes and exhibit counters.

  • STEM classes: Students build a sensor counter in 1 lesson.
  • Exhibit counters: Makers count visitor touches on exhibits.
  • Game buttons: Makers build arcade-style tap games.
  • Prototyping: Designers test touch input on product prototypes.
  • Science fair projects: Students count reaction-time trials.

Tool Details

Category
Hardware & Sensors
Controls
Taps and keys
Input Support
Touch, Pen, Mouse, Keys
Offline Ready
On your device