Skip to content

CPM not counted on (certain) ESP32 Model (D1 Mini, ESP32-WROOM-32) #5

@Kedalux

Description

@Kedalux

Note: I already fixed the issue myself, but this is for users experiencing the same issue and for the staff to understand why this happens (Because i don't)
Also i've closed my duplicated issue in the wrong repo (ggreg20-v3-homeassistant-esphome-example) since it fits better here.

So i've bought two GGreg_V3 Sensors to monitor background radiation.

I use the following ESP32 Model: https://wiki.csgalileo.org/_media/projects/internetofthings/d1_mini_esp32_-_pinout.pdf
The Chip itself is labelled ESP32-WROOM-32.

I flashed the Chip using the Home-Assistant Add-On ESPHome and the Configuration from here.

Everything went smoothly until i discovered that CPM is only "counted" immediatly when the GGreg board is being connected/being turned on. I guess this has something to do with the issue.
pulse_counter always shows 0 otherwise, so radiation over time is calculated wrong too.

I could verify this because the board is beeping around 22 times a minute and always reports 0, unless connected/disconnected while the ESP is on.

If the "OUT" Pin is connected to the wrong GPIO CPM tends to be in the thousands. I discovered this playing around with my ESP.

The only thing needed to fix this is changing the yaml configuration:
The following values of the two lines need to be swapped:

rising_edge: INCREMENT
falling_edge: DISABLE # GGreg20_V3 uses Active-Low logic

Before failing_edge was INCREMENT and rising_edge DISABLE.

With this configuration the CPM counting works as expected, i verified this by counting the beeps and comparing it to the transmissioned stats.

I don't know why this happens, i don't know if it's the specific model, that treats GPIO Pins differently (Your Example is for Generic ESP32).

I did specify the correct model in ESPHome to be sure the Pinout is correct. I also checked for hardware defects with multiple ESPs from the same model and the second GGreg_V3 Board i ordered.
I also double-checked with different GPIO Pins, but the behaviour is always the same.

Maybe someone could look into it and change the readme with a note.

Merry Christmas Guys!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions