Trust is earned, not given

A different perspective

2021-01-24 · Projects

A WiFi Geiger counter on an ESP8266

A Geiger counter is the classic example of an event-driven device, and this project is the cleanest way I know to teach that idea: ESP12-GeigerCounter-SPI-New12864 reads pulses from a Geiger tube module, computes counts per minute over rolling windows, estimates the dose rate, and displays it with a safety message on a 128x64 LCD next to a WiFi-synced clock.

Why interrupts, not polling

A Geiger pulse is a few hundred microseconds wide and arrives irregularly — during a radiation spike, thousands per minute. If your loop is busy drawing the display when a pulse arrives, you miss it. The correct tool is a pin-change interrupt: the hardware increments a counter no matter what the software is doing; the loop reads that counter once per second and does the math. This is the same pattern behind every button, encoder and sensor that must not be missed.

Rolling windows and CPM

Counts-per-minute over exactly 60 seconds updates too slowly to feel alive. The sketch keeps three rolling windows (20s / 60s / 60s), displays a fast-reacting estimate and a stable one, and converts CPM to an approximate dose rate (µSv/h) with the tube's conversion factor. It also classifies the reading into plain-language safety levels and shows the nuclear icon from the GarfieldXBM pack when alerting.

Structure and setup

Repository: github.com/bobhuang1/ESP12-GeigerCounter-SPI-New12864