ANALOGbeginner

Piezo-Ceramic Sensor

A 22 mm piezo disc on a TinkerBlock board that needs no supply: two wires, GND and SIGNAL. A tap makes a hump on SIGNAL that rises in about a millisecond and drains in about a tenth of a second, taller for a harder tap. It senses change, not weight, and nothing on the board holds SIGNAL below 3.3 V.

Comes in this kit — not sold separately

Specifications

TypeA piezo disc on a TinkerBlock board with no supply of its own. A tap or a knock reads as a voltage on SIGNAL that grows with how hard it was
DiscXHXDZ-22045 piezo disc, Ø22 × 4.5 mm in a black plastic case, on a black and a red lead soldered to the board
SIGNAL0 V at rest. After a tap, a hump: up in about 1 ms, down to a third in about 0.1 s. Read it with analogRead
SensesChange, not weight: a tap reads, a steady press drains back to 0 V within a fraction of a second
Circuit1 MΩ that drains the disc, an SS14 Schottky that stops only the negative half, and 1 kΩ into 100 nF on SIGNAL
LimitNothing on the board holds SIGNAL below 3.3 V. Finger taps read a volt or two; a hard blow can pass a 3.3 V pin's limit, so add a Schottky from SIGNAL to 3V3 for those
SupplyNone. There is no VCC pin: both middle pins are printed NC and connected to nothing
Pins to wire2 of the 4: GND and SIGNAL
Header4-pin right-angle male, 2.54 mm pitch: GND, NC, NC, SIGNAL, with GND on the square pad
Board22.4 × 30.4 mm, two 4.8 mm mounting holes 16 mm apart; the disc hangs off one end on its leads. The front prints ANALOG, the back DETECTS VIBRATIONS
In the box1 × TK59 block with its disc soldered on. It also ships inside the TinkerBlock kits

What it does

It tells your board that something was tapped or knocked, and roughly how hard. The black disc is a piezo element: bend it and it makes a small charge of its own. The board turns each tap into a smooth hump of voltage on SIGNAL, taller for a harder tap, and drains it back to 0 V in about a tenth of a second.

Drag to turn it
The TK59. The sensor is the black disc; the board shapes what it makes. Turn it over for the back.

That is the difference from the TK28 knock sensor, whose spring switch can only say that a knock happened. This one says how hard, which is enough to tell a deliberate knock from a door closing.

Nothing on the block is powered. There is no chip, no LED and no VCC pin: just the disc, a 1 MΩ that drains it, an SS14 diode that stops it swinging below 0 V, and a 1 kΩ into a 100 nF that smooths each tap into a hump.

The page this replaces said to wire VCC to 3.3 V or 5 V (both middle pins are connected to nothing), that the module's clamp makes it safe for any pin (it clamps only the negative half), and that the TK37 buzzer is the same element run backwards (the TK37 is a magnetic buzzer).

Two things to know before wiring

  • Two wires. GND and SIGNAL. Both middle pins are NC, and there is no supply to connect.
  • It senses change, not weight. A tap reads; a steady press drains back to 0 V while your finger is still down.

Wiring, in four lines

  1. GND to your board's GND.
  2. SIGNAL to an analog pin: GPIO 4 on an ESP32-S3, GPIO 34 on an ESP32, A0 on an Uno, GP26 on a Pico.
  3. NC and NC to nothing: they are connected to nothing on the board.
  4. No supply wire.

Then read it with analogRead, as often as the board allows, and keep the highest reading in each 20 ms.

Where to start

The handbook below is nine short articles, each with a working figure. The first reading is the whole build in two wires and a short sketch, and a tap switch counts each tap once.

For how it works, read a disc that makes voltage and four parts, one hump. Before you hit it hard on a 3.3 V board, read how high it goes. If it reads nothing, when it reads nothing.

When it doesn’t work

Where does VCC go?
Nowhere: the block has no VCC pin. The header prints GND, NC, NC, SIGNAL, and both NC pins are connected to nothing. The disc makes its own voltage, and nothing else on the board needs power. The pad printed VCC beside the red wire is the disc's own node, not a supply.
One tap reads as several.
A tap is a hump that takes a tenth of a second or more to drain, so a sketch that counts readings over a level counts it once per reading. Count a rise instead, then ignore everything for about 150 ms; the handbook's tap switch does exactly that.
The readings are tiny.
Tap the disc itself, on its face. It answers to being bent, and a tap on the table beside it bends it very little. Fixed flat to a surface with tape or glue, it picks up knocks on that surface far better than lying loose.
Can it weigh something, or sense a steady push?
No. A press makes a charge once, and the board drains it in a fraction of a second, so a steady weight reads 0 V. Use a load cell or a force sensor for that.
Is it safe on a 3.3 V board?
For taps, in practice yes: the 100 nF keeps them to a volt or two. But the board's only diode stops the negative half, so a hard blow can take SIGNAL past a 3.3 V pin's limit, with only the 1 kΩ limiting the current. For a drum pad or anything struck hard, add a Schottky diode from SIGNAL to 3V3.
Is this the same part as the TK37 passive buzzer?
No. The TK37 is a magnetic buzzer, a coil. This disc is a piezo element, sold by its maker as a buzzer too, but nothing on this board drives it: it only listens.

The piezo sensor handbook

9 articles · about 45 minutes

This page is the reference: what the part is, what it is made of, and the questions people arrive already asking. The handbook is the walk — the same part in the order somebody actually meets it.

The board

2 articles

Two wires, not three: GND and SIGNAL, with both middle pins connected to nothing. A disc on two leads, and four small parts that shape what it makes.

How it works

3 articles

A disc that makes its own voltage when it bends, four parts that turn its ringing into one smooth hump, and what stands between a hard blow and your pin.

Reading it

2 articles

Two wires and analogRead, and why a reading every 100 ms tells you less than it seems to.

Using it

2 articles

A tap switch that counts a tap once, even on the tail of the last one, and the short list of reasons it reads nothing.

Lessons using TK59

Each one is a working build, not a snippet.

Edit this page — content/modules/piezo-sensor.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

Piezo-Ceramic Sensor

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum →