Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geiger first test version #134

Merged
merged 7 commits into from
Jun 8, 2022
Merged

Conversation

roberbike
Copy link
Member

@roberbike roberbike commented Mar 16, 2022

First test version to add a cajone v1.1 radiation geiger sensor.
Calculation of radiation dose: 1 Sievert (Sv) = 100 Rem = 100,000 mR ==> 1 μSv = 0.1 mR
Doses is indicated in mR/hour.
Background radiation is 365 mR/year => 0.042 mR/hour
Max doses radiation workers 5000 mR/year => 0.57 mR/hour
we can use the number of tics/ 10 seconds to estimate the doses in mR/hour:
tics_per_10sec * TICFACTOR.

13:30:17.400 > == Sensor test setup ==
13:30:17.400 >
13:30:17.400 > -->[SETUP] Detecting sensors..
13:30:17.400 > -->[SLIB] new sample time        : 5
13:30:17.405 > -->[SLIB] temperature offset     : 0.00
13:30:17.405 > -->[SLIB] altitude offset        : 0.00
13:30:17.411 > -->[SLIB] sea level pressure     : 1013.25 hPa
13:30:17.416 > -->[SLIB] only i2c sensors       : false
13:30:23.978 > Geiger counter startup
13:30:23.983 > Geiger counter ready
13:30:23.983 > -->[SLIB] Sensors devices count  : 0 ()
13:30:24.524 > mili Rem
13:30:24.526 > 0.00
13:30:24.526 > tics
13:30:24.526 > 0
13:30:29.525 > mili Rem
13:30:29.526 > 0.10
13:30:29.526 > tics
13:30:29.526 > 2
13:30:34.524 > mili Rem
13:30:34.527 > 0.15
13:30:34.527 > tics
13:30:34.527 > 3
13:30:39.528 > mili Rem
13:30:39.528 > 0.05
13:30:39.528 > tics
13:30:39.528 > 1

TODO

  • add a basic example of use of this measurement
  • fix issues on ESP8266 platform
  • tested with all boards

@hpsaturn
Copy link
Member

Thanks for the PR! I updated the description section of the PR and added some TODO list.

@roberbike
Copy link
Member Author

Tested with wemos d1 mini (esp8266), devkit esp32 v1 and Ttgo T-display. The implementation is not complete yet. Esp32 need changues to get the same values that esp32.

@iw2lsi
Copy link
Contributor

iw2lsi commented May 27, 2022

Hi All,

yesterday I've tested the patch on a TTGO T-Display... below are some preliminary notes.

  1. PINTIC is on GPIO27, which (according to CanAir.IO schematics & code) is already used as sensor(s) enable
    -> moved to GPIO26

  2. TICFACTOR 0.05 (factor between number of tics/second --> mR/hr)

    -> to me it's not clear where this factor comes from... even considering the different units (tics/second vs CPM & mR/hr vs uSv/hr)...

    as far I know, CAJOE kit by default uses a Chinese J305 tube... looking at this project:

    https://www.hackster.io/ruslan-olkhovsky/diy-geiger-counter-with-sensorocean-a76d1a
    // Conversion Factor used for conversion from CPM to uSv/h units (J305 tube)
    #define CONV_FACTOR 0.008120370

    I'm getting different conversion factors...

  3. in function timerBegin() timer 0 is used... which seems already used somewhere else in CanAir.IO, as it stop firing few seconds after the boot process...

    by using timer1 instead of timer0 the 250ms timer seems to work fine

    eg: timer = timerBegin(1, 80, true);

  4. this is really strange: void IRAM_ATTR TicISR() is fired twice for every Cajoe Pulses...

    I've tested it with a logic analyzer in different configurations (PullUp, PullDown, rising-edge, falling-edge etc) and
    I'm always getting twice the pulses...

    I end up in configuring the interrupt to trigger whenever the pin changes value... as in this case getting twice the pulses is expected... and then I divide the pulses by 2.

    // attachInterrupt(PINTIC, TicISR, RISING); // counted twice (unexpected)
    // attachInterrupt(PINTIC, TicISR, FALLING);// counted twice (unexpected)
    attachInterrupt(PINTIC, TicISR, CHANGE); // counted twice (as expected)

    BTW: the problem is not new as by a simple search on Google (search for: attachInterrupt esp32 twice)

@hpsaturn hpsaturn changed the base branch from master to devel June 8, 2022 08:45
@hpsaturn hpsaturn changed the base branch from devel to geiger_sensor June 8, 2022 09:21
@hpsaturn hpsaturn merged commit 2cafc54 into kike-canaries:geiger_sensor Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants