piezo sensor/Using it/09. When it reads nothing
Using it · 09 of 9

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

When it reads nothing
What you see
SIGNAL sits at 0 V between taps, so 0 is right until you tap. If a tap never moves it: SIGNAL is on the bottom pin, farthest from the square pad, not on an NC beside it; PIEZO_PIN names the pin you wired; and both of the disc's thin leads are still soldered to their pads.

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

  1. GND, on the square pad. Without it the reading drifts with nothing touching the disc.
  2. SIGNAL, the pin farthest from the square pad, on the pin the sketch reads. The two pins between are NC and go nowhere.
  3. 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.
  4. Where you tap. The disc itself, on its face, firmly.
  5. 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.
  6. 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

It worked, and now one tap reads nothing.

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.

Taps on the table do not register.

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.

It reads fine on an Uno and tops out on an ESP32.

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.

Where this goes next

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

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 →