On the hardware side, this project shows how to integrate a generic G-M counter module with cheap ESP-01 WiFi and power modules.
Provided software does unit conversion from tube-dependent cpm signal (clicks per minute) into µSv/h (microsieverts per hour) unit and passes that information to predefined MQTT broker.
From there the information can be integrated into home automation frameworks such as Home Assistant.
Files
wemos-geiger.ino
Arduino IDE sketch. Requires ArduinoJSON, ArduinoOTA and PubSubClient libraries.
The code that I provided simply counts clicks from the GPIO2 and once per minute sends JSON message to predefined MQTT broker.
/// Geiger counter#define RECEIVER_PIN 2 // 4=GPIO4=D2 any interrupt able pin (Wemos) // 2=GPIO2 on ESP-01/// Geiger tube parameters#define TUBE_NAME "j305"#define TUBE_FACTOR 0.00812///
TUBE_NAME will appear in the message topic.
TUBE_FACTOR is necessary to convert CPM into uSv/h. This depends on actual tube used. My module had Chinese J305 tube and for that model value 0.00812 is the conversion factor.