nmrr 2 лет назад
Родитель
Сommit
1670c6b566
7 измененных файлов с 16 добавлено и 8 удалено
  1. 8 4
      README.md
  2. BIN
      flipper_geiger.fap
  3. 1 1
      flipper_geiger/application.fam
  4. 7 3
      flipper_geiger/flipper_geiger.c
  5. BIN
      img/flipper1.png
  6. BIN
      img/flipper12.png
  7. BIN
      img/flipper13.png

+ 8 - 4
README.md

@@ -7,7 +7,7 @@ You need a **geiger counter** board to run this application. This board can be u
 
 You also need jumper wires to connect the board on the **Flipper Zero**.
 
-**Note 1 :** this board uses a **J305** geiger tube. According this [website](https://www.rhelectronics.store/j305-glassy-geiger-muller-tube-nuclear-radiation-sensor) gamma conversion factor is **0.0081** for this tube. This value has been declared in the header of the source file so you can change it easily if needed. Incorrect conversion factor will give false measurements when **μSv/h** / **mSv/y** is selected.
+**Note 1 :** this board uses a **J305** geiger tube. According this [website](https://www.rhelectronics.store/j305-glassy-geiger-muller-tube-nuclear-radiation-sensor) gamma conversion factor is **0.0081** for this tube. This value has been declared in the header of the source file so you can change it easily if needed. Incorrect conversion factor will give false measurements when **Sv** or **Rad** is selected.
 
 **Note 2 :** **J305** geiger tube is only sensible to **beta** and **gamma** rays. **Alpha** rays cannot be detected. 
 
@@ -54,7 +54,7 @@ The program will automatically be launched after compilation
 
 **A4** GPIO can be connected on **A7** GPIO to test this application without using a geiger tube. **A4** GPIO is generating a signal whose frequency changes every second.
 
-Press **Ok** button to clear the graph, press **Left/Right** to choose unit (cpm, μSv/h, mSv/y), press **Back** button to quit
+Press **Ok** button to clear the graph, press **Left/Right** to choose unit (cpm, μSv/h, mSv/y, Rad/h, mRad/h, uRad/h), press **Back** button to quit
 
 If you don't want to build this application, just simply copy **flipper_geiger.fap** on your **Flipper Zero**
 
@@ -64,11 +64,11 @@ Ambient radioactivity (descendants of radon gas are detected, not radon itself)
 
 <img src="https://github.com/nmrr/flipperzero-geigercounter/blob/main/img/flipper2.png" width=25% height=25%> <img src="https://github.com/nmrr/flipperzero-geigercounter/blob/main/img/flipper8.png" width=25% height=25%> <img src="https://github.com/nmrr/flipperzero-geigercounter/blob/main/img/flipper9.png" width=25% height=25%>
 
-**Note :** measures in **μSv/h** / **mSv/y** are not precise
+**Note :** measures in **Sv** or **Rad** are not precise
 
 Measure of uranium ore piece inside a lead container :
 
-<img src="https://github.com/nmrr/flipperzero-geigercounter/blob/main/img/flipper3.png" width=25% height=25%>
+<img src="https://github.com/nmrr/flipperzero-geigercounter/blob/main/img/flipper3.png" width=25% height=25%> <img src="https://github.com/nmrr/flipperzero-geigercounter/blob/main/img/flipper12.png" width=25% height=25%> <img src="https://github.com/nmrr/flipperzero-geigercounter/blob/main/img/flipper13.png" width=25% height=25%>
 
 Measure of uranium ore piece (the most radioactive part) in contact with the geiger tube :
 
@@ -96,6 +96,10 @@ Measure of americium 241 button from a smoke detector :
 
 ## Changelog
 
+* 2023-04-11
+  * More usable/unusable sources
+  * Rad unit has been added
+
 * 2023-03-01
   * Usable/unusable sources have been added
 

BIN
flipper_geiger.fap


+ 1 - 1
flipper_geiger/application.fam

@@ -1,6 +1,6 @@
 App(
     appid="flipper_geiger",
-    name="Geiger counter",
+    name="Geiger Counter",
     apptype=FlipperAppType.EXTERNAL,
     entry_point="flipper_geiger_app",
     cdefines=["APP_GEIGER"],

+ 7 - 3
flipper_geiger/flipper_geiger.c

@@ -47,7 +47,11 @@ static void draw_callback(Canvas* canvas, void* ctx)
     char buffer[32];
     if (displayStruct.data == 0) snprintf(buffer, sizeof(buffer), "%ld cps - %ld cpm", displayStruct.cps, displayStruct.cpm);
     else if (displayStruct.data == 1) snprintf(buffer, sizeof(buffer), "%ld cps - %.2f uSv/h", displayStruct.cps, ((double)displayStruct.cpm*(double)CONVERSION_FACTOR));
-    else snprintf(buffer, sizeof(buffer), "%ld cps - %.2f mSv/y", displayStruct.cps, (((double)displayStruct.cpm*(double)CONVERSION_FACTOR))*(double)8.76);
+    else if (displayStruct.data == 2) snprintf(buffer, sizeof(buffer), "%ld cps - %.2f mSv/y", displayStruct.cps, (((double)displayStruct.cpm*(double)CONVERSION_FACTOR))*(double)8.76);
+    else if (displayStruct.data == 3) snprintf(buffer, sizeof(buffer), "%ld cps - %.4f Rad/h", displayStruct.cps, ((double)displayStruct.cpm*(double)CONVERSION_FACTOR)/(double)10000);
+    else if (displayStruct.data == 4) snprintf(buffer, sizeof(buffer), "%ld cps - %.2f mR/h", displayStruct.cps, ((double)displayStruct.cpm*(double)CONVERSION_FACTOR)/(double)10);
+    else snprintf(buffer, sizeof(buffer), "%ld cps - %.2f uR/h", displayStruct.cps, ((double)displayStruct.cpm*(double)CONVERSION_FACTOR)*(double)100);
+
 
     for (int i=0;i<SCREEN_SIZE_X;i+=2)
     {
@@ -156,7 +160,7 @@ int32_t flipper_geiger_app()
                     mutexStruct* geigerMutex = (mutexStruct*)acquire_mutex_block(&state_mutex);
 
                     if (geigerMutex->data != 0) geigerMutex->data--;
-                    else geigerMutex->data = 2;
+                    else geigerMutex->data = 5;
 
                     screenRefresh = 1;
                     release_mutex(&state_mutex, geigerMutex);
@@ -165,7 +169,7 @@ int32_t flipper_geiger_app()
                 {
                     mutexStruct* geigerMutex = (mutexStruct*)acquire_mutex_block(&state_mutex);
 
-                    if (geigerMutex->data != 2) geigerMutex->data++;
+                    if (geigerMutex->data != 5) geigerMutex->data++;
                     else geigerMutex->data = 0;
 
                     screenRefresh = 1;

BIN
img/flipper1.png


BIN
img/flipper12.png


BIN
img/flipper13.png