🧲

Hall Tachometer

Stick a magnet on and the numbers appear

Page 33 of 36 MCP / API open OTA updates

Page 33 takes a switch-type hall sensor (linear hall parts do not work here) with the signal line on GPIO41. Every edge records a timestamp and the last 48 edges are buffered; RPM is computed from the median of the last six periods, so a single glitch cannot throw the reading off.

Angle comes from accumulated pulses: pulses ÷ PPR × 360°. After two seconds without an edge the page declares a stop and zeroes the reading instead of freezing on the last value. PPR (pulses per revolution) = magnets × 2 — one magnet rising and falling counts as two pulses, and getting this wrong doubles or halves every reading.

Screen

On-screen interface

A recreation of this page on the 2.41-inch AMOLED display (600 × 450). Actual interaction and layout follow the latest firmware.

Hall Tachometer Switch type · pin 41
Speed1280rpm
Angle214° · pulses 1024
Interval23.4 ms (median of 6)
Pulses/rev2 · 1 magnet per turn
StatusSpinning · pulse just seen
48 edges buffered · stops after 2 s idle
Screen · Page 33
May differ from the actual interface; the screen of the real device is the final reference.
Highlights

Key capabilities

🧲

Switch hall input

Digital edge trigger — a single signal wire is enough.

⏱

Median filtering

Median of the last six periods ignores jitter spikes.

🔢

Configurable PPR

magnets × 2, so a new mechanical setup needs no code change.

🛑

Auto stop

No edge for two seconds zeroes the reading instead of showing stale data.

Specifications

Technical specs

Signal pinGPIO41 (GPIO40 is the OLED reset and must stay free)
PPRPulses per revolution = magnets × 2
Formula60,000,000 ÷ (period µs × PPR)
Sampling48-edge ring, median of the last 6 periods
Use Cases

Typical scenarios

Motor RPM

One magnet on a fan or motor and the RPM shows up on screen.

Linear speed

With the wheel diameter you get belt or wheel speed from RPM.

Commands

Related commands

page 33  Open the hall page
hall  Show RPM, angle and pulse count
hall ppr 4  Set pulses per revolution (two magnets)
hall deb 2  Set the debounce threshold
hall sim 1200  Inject pulses at 1200 RPM (no hardware needed)
hall reset  Clear pulses and angle

Read the full API & command reference →

⚠ Boundaries & notes
  • Switch-type (digital output) hall sensors only — linear hall output cannot be read.
  • GPIO40 is the display reset line; the command rejects it outright.
  • Simulation injects pulses per frame; at 30–80 Hz loop rates high RPM reads low — use a real sensor for measurements.

Other feature pages