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

Touch Sensor Counter

Count signals from connected sensors.

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 Touch Sensor Counter Works

Count a sensor signal each time it changes from no touch to touch. Set a clear rule for when a new touch starts and ends.

  1. Connect the sensor: Plug in the microcontroller board and pick its port in the browser prompt.
  2. Set the message format: Choose the signal the board sends per touch, such as the text TOUCH or the byte 1.
  3. Touch the sensor: Each activation the board reports adds 1 to the count.
  4. Log and export: Save timestamps for each activation and export them.

Touch Sensor Counter Formula

The total is the number of valid touch signals. Remove false or repeat signals using the test rules you set.

Count += 1 when State(t) = 1 AND State(t − 1) = 0
State(t)
Sensor reading now: 1 for touched, 0 for not touched
State(t − 1)
Previous reading

Example: The readings 0, 0, 1, 1, 1, 0, 1, 0 contain 2 changes from 0 to 1, so the count is 2.

Touch Sensor Counter Reference Table

This table compares sensor signals and the events that can count as a touch.

ConnectionBrowser APITypical boardsBrowser support
USB serialWeb SerialArduino Uno, ESP32, Raspberry Pi PicoChrome, Edge, Opera (desktop)
USB directWebUSBBoards with WebUSB firmwareChrome, Edge
Bluetooth Low EnergyWeb BluetoothESP32, nRF52, micro:bitChrome, Edge (desktop and Android)
Keyboard emulationKeyboard eventsArduino Leonardo, Pro MicroAll browsers

About the Touch Sensor Counter

A touch sensor count records when a sensor detects contact. One long hold should not count as many new touches.

Check the signal before and after each touch. Noise can cause false changes. A short stable period can help you tell a real touch from a stray signal.

Ways to Use the Touch Sensor Counter

Use sensor counts for device tests, touch switches and control panels. Here are five examples.

  • Interactive exhibits: Museums count touches on exhibit buttons.
  • Maker projects: Makers display sensor counts in a browser.
  • STEM lessons: Students wire a sensor and watch the count rise.
  • Door touch pads: Teams count presses on a touch-to-open pad.
  • Product testing: Engineers count presses during endurance tests.

Tool Details

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