Arduino Touch Counter
Count supported sensor activations.
Tap, click or press Space to keep count.
Tap anywhere inside or press Space
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.
- Wire the sensor: Connect a TTP223 module: VCC to 5 V, GND to GND and SIG to digital pin 2.
- Upload the sketch: Upload a sketch that prints TOUCH on each rising edge at 9,600 baud.
- Connect in the browser: Click Connect and pick the Arduino's serial port.
- 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.
- 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 rate | Bytes per second | Messages per second | Time per message (ms) |
|---|---|---|---|
| 9,600 | 960 | 160 | 6.25 |
| 19,200 | 1,920 | 320 | 3.13 |
| 57,600 | 5,760 | 960 | 1.04 |
| 115,200 | 11,520 | 1,920 | 0.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