• 1
    Make connections

    Here is the list of connections between parts.

    The RadiationD module power and cpm output is on the P3 connector. You might also want to remove J1 jumper to make the module silent.

    Between P3 connector on RadiationD module and other parts:

    P3.VCC -> POWER.+5V
    P3.VIN -> ESP01.GPIO2

     Between ESP-01 and other parts:

    ESP01.VCC    -> POWER.+3.3V
    ESP01.CHPD   -> ESP01.VCC
    ESP01.GND    -> POWER.GND
    EPS01.GPIO02 -> P3.VIN

     Between CJMCU power supply module and other parts:

    POWER.+5V	-> P3.VCC
    POWER.+3.3V	-> ESP01.VCC
  • 2
    Customize firmware

    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.

    #include "wifipassword.h"
    //#define WIFIPASSWORD "12345secret"
    const char* myhostname = "esp01geiger";
    const char* ssid = "Springfield";
    const char* password =  WIFIPASSWORD;
    const char* mqttServer = "iotlocal.lan";
    const uint32_t mqttPort = 1883;

     "Springfield" and password defined in WIFIPASSWORD are my WiFi network parameters.

    I'm using broker running in my LAN available at iotlocal.lan address, listening on port 1883.

    "esp01geiger" is a friendly hostname to make it easier to recognize the device in Arduino IDE OTA (over-the-air) update and on my router summary page.

    For debug purposes there are some messages sent over the serial port.

    const char* mqttPrefix = "esphome"; 

    This is topic prefix under which all messages coming from sensors in my setup appear.

  • 3
    Compile and flash ESP-01

    You need Arduino IDE with following libraries installed:

    • ArduinoOTA - for updating firmware over-the-air
    • ArduinoJSON - for easy and reliable formatting of JSON objects
    • PubSubClient - for MQTT connectivity