When it reads nothing
The block has no light and nothing powered, so the only test is a reading: the first sketch on the Serial Plotter. Most faults are one of six, and each has one place to look: the SIGNAL wire, the GND wire, how the sketch counts, where you tap, the ESP32's range, and MicroPython's.
Start with the first sketch
Pick what you see. There is no LED to tell you whether the disc did anything, so everything starts from the first reading sketch and the Serial Plotter: a flat line at 0 that spikes when you tap is a working block.
The order to check
- GND, on the square pad. Without it the reading drifts with nothing touching the disc.
- SIGNAL, the pin farthest from the square pad, on the pin the sketch reads. The two pins between are NC and go nowhere.
- The disc's leads, where they are soldered at the board's edge. Black to the pad printed GND, red to the pad printed VCC.
- Where you tap. The disc itself, on its face, firmly.
- How the sketch reads. No
delay()between readings, and a tap counted as a rise with a pause after it, as in a tap switch. - The board's range. An ESP32 tops out near 3.1 V; in MicroPython, set
adc.atten(ADC.ATTN_11DB)first or it tops out near 1 V.
There is no VCC wire to check. The block has no VCC pin, and a wire from the middle pins to 3V3 or 5V changes nothing: they are connected to nothing.
When it does not work
Look at the disc's two leads where they meet the pads at the edge of the board. They are thin, and a disc that has been picked up by its wires can break one at the joint. Resolder it: black to the pad printed GND, red to the pad printed VCC.
The disc answers to being bent, and a table barely bends it: the designers' own note on the schematic says it reacts only when the disc itself is struck. Fix the disc flat to the surface you want to sense, with tape or glue on its back, or tap the disc.
An Uno reads up to 5 V, an ESP32 up to about 3.1 V. A tap that reads 3.5 V on the Uno is past the ESP32's full scale. Tap more lightly, or treat the ESP32's top reading as at least this hard; for hard blows add a Schottky diode from SIGNAL to 3V3.
The TK28: a spring switch that says a knock happened, but not how hard.
The Knock Sensor →Edit this page — content/books/piezo-sensor/when-it-reads-nothing.mdx
Questions about this product
See what other owners have asked, and read their solutions.
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.