Touch Sensor Counter
Count signals from connected sensors.
Tap, click or press Space to keep count.
Tap anywhere inside or press Space
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.
- Connect the sensor: Plug in the microcontroller board and pick its port in the browser prompt.
- Set the message format: Choose the signal the board sends per touch, such as the text TOUCH or the byte 1.
- Touch the sensor: Each activation the board reports adds 1 to the count.
- 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.
- 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.
| Connection | Browser API | Typical boards | Browser support |
|---|---|---|---|
| USB serial | Web Serial | Arduino Uno, ESP32, Raspberry Pi Pico | Chrome, Edge, Opera (desktop) |
| USB direct | WebUSB | Boards with WebUSB firmware | Chrome, Edge |
| Bluetooth Low Energy | Web Bluetooth | ESP32, nRF52, micro:bit | Chrome, Edge (desktop and Android) |
| Keyboard emulation | Keyboard events | Arduino Leonardo, Pro Micro | All 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