Geiger Counter
-
Here is the update for mysensors 2.0
// #define SKETCH_NAME "Geiger Sensor" #define SKETCH_MAJOR_VER "2" #define SKETCH_MINOR_VER "0" // Enable and select radio type attached #define MY_RADIO_NRF24 #define MY_RF24_CHANNEL 13 #define MY_RF24_BASE_RADIO_ID ((uint64_t)0xF8A813FC09CL) // #define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!) #define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway) #define CHILD_ID 1 // Id of the sensor child #define LOG_PERIOD 60000 //Logging period in milliseconds, recommended value 15000-60000. #define MAX_PERIOD 60000 //Maximum logging period unsigned long counts; //variable for GM Tube events unsigned long cpm; //variable for CPM unsigned int multiplier; //variable for calculation CPM in this sketch unsigned long previousMillis; //variable for time measurement unsigned long timeReceived = 0; unsigned long timeRequested = 0; // Enable debug prints to serial monitor #define MY_DEBUG #include <SPI.h> #include <MySensors.h> MyMessage msg(CHILD_ID, V_VAR1); void setup() { wdt_enable(WDTO_8S); // Geiger initialise counts = 0; cpm = 0; multiplier = MAX_PERIOD / LOG_PERIOD; //calculating multiplier, depend on your log period pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the geiger sensor digital pin as input digitalWrite(DIGITAL_INPUT_SENSOR, HIGH); // turn on internal pullup resistors, solder C-INT on the PCB attachInterrupt(1, tube_impulse, FALLING); //define external interrupts wdt_reset(); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo(SKETCH_NAME, SKETCH_MAJOR_VER "." SKETCH_MINOR_VER); wdt_reset(); wait(500); present(CHILD_ID, S_ARDUINO_NODE); wdt_reset(); wait(500); } void loop() { wdt_reset(); unsigned long currentMillis = millis(); if (currentMillis - previousMillis >= LOG_PERIOD) { cpm = counts * multiplier; send(msg.set(cpm)); counts = 0; previousMillis = currentMillis; } } void tube_impulse() { //procedure for capturing events from Geiger Kit counts++; }@Hek
What do you think about a sensor type geiger counter with cpm and microsievert? V_VAR1 for cpm ist not cool :cool: -
Haha, not cool. :D What? Radioactivity is always cool!
Well, we still use VAR_1 for pulses in EnergyMeterPulseSensor, which probably is a bit more commonly used. A generic V_PULSECOUNT perhaps..On the EnergyMeterPulseSensor is it only used for saving a state in case of power failure. Is it the same use-case here?
-
@hek
counts per minute:
https://en.wikipedia.org/wiki/Counts_per_minuteA generic V_PULSECOUNT would be fine.
The microsievert is the interesting physical unit you can derive from the cpm. The calculation is depending from the tube you use.
http://cs.stanford.edu/people/nick/geiger/
In my case:
usv = cpm * 0.0057;What about a type S_RADIOACTIVITY?
Here the natural radioactivity in my garage:

The sum of the doses you get over time is the interesting number:
https://en.wikipedia.org/wiki/Sievert -
S_RADIOACTIVITY sounds like useful new device type.
When reading up a bit more. Wouldn't it be better to send in radiation level (uSv/hr) as V_LEVEL. We try to re-use V_LEVEL between device-types for SI-levels of any kind.
I have started this a new issue here to discuss it further:
https://github.com/mysensors/MySensors/issues/567 -
Excellent - thank you guys. I have been looking for an addition to my weather station.
I think I'll place an order for this one: http://www.ebay.co.uk/itm/182166337823?_trksid=p2060353.m1438.l2649&ssPageName=STRK%3AMEBIDX%3AIT
This is 100% Japanese built Arduino based Geiger counter. -
It's just a matter on agreeing on what types/data to send. Please post your input in the issue.
@hek The logging software is reporting is as follows every minute:
CPS, 2, CPM, 15, uSv/hr, 0.08, SLOW
(Please see http://mightyohm.com/blog/2012/02/tutorial-geiger-counter-data-logging/)Therefore, there are four parameters here and I propose to use the following:
- CPS --> ???
- CPM --> ???
- uSv/hr --> S_RADIOACTIVITY (V_LEVEL)
- SLOW/FAST -> S_INFO (V_TEXT)
-
We can keep it simple - CPM and uSv/hr are the two typically reported.
Even more simple - knowing CPM we can figure out uSv/hr@alexsh1
Calculation of uSv/hr based on CPM is dependent of the tube. If we do not implement the calculation in the sketch, it must be done in the controller. -
@alexsh1
Calculation of uSv/hr based on CPM is dependent of the tube. If we do not implement the calculation in the sketch, it must be done in the controller.@FotoFieber my understanding is that all meters are calibrated to either Cs137 or Co60, which is more likely down to the tube. However, I do not understand why we care about the conversion. My geiger meter reports both uSv/hr and CPM and a number of other meters reports exactly the same. If there is any conversion required, it has to be done in the sketch IMHO.
-
It's just a matter on agreeing on what types/data to send. Please post your input in the issue.
-
Here is the update for mysensors 2.0
// #define SKETCH_NAME "Geiger Sensor" #define SKETCH_MAJOR_VER "2" #define SKETCH_MINOR_VER "0" // Enable and select radio type attached #define MY_RADIO_NRF24 #define MY_RF24_CHANNEL 13 #define MY_RF24_BASE_RADIO_ID ((uint64_t)0xF8A813FC09CL) // #define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!) #define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway) #define CHILD_ID 1 // Id of the sensor child #define LOG_PERIOD 60000 //Logging period in milliseconds, recommended value 15000-60000. #define MAX_PERIOD 60000 //Maximum logging period unsigned long counts; //variable for GM Tube events unsigned long cpm; //variable for CPM unsigned int multiplier; //variable for calculation CPM in this sketch unsigned long previousMillis; //variable for time measurement unsigned long timeReceived = 0; unsigned long timeRequested = 0; // Enable debug prints to serial monitor #define MY_DEBUG #include <SPI.h> #include <MySensors.h> MyMessage msg(CHILD_ID, V_VAR1); void setup() { wdt_enable(WDTO_8S); // Geiger initialise counts = 0; cpm = 0; multiplier = MAX_PERIOD / LOG_PERIOD; //calculating multiplier, depend on your log period pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the geiger sensor digital pin as input digitalWrite(DIGITAL_INPUT_SENSOR, HIGH); // turn on internal pullup resistors, solder C-INT on the PCB attachInterrupt(1, tube_impulse, FALLING); //define external interrupts wdt_reset(); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo(SKETCH_NAME, SKETCH_MAJOR_VER "." SKETCH_MINOR_VER); wdt_reset(); wait(500); present(CHILD_ID, S_ARDUINO_NODE); wdt_reset(); wait(500); } void loop() { wdt_reset(); unsigned long currentMillis = millis(); if (currentMillis - previousMillis >= LOG_PERIOD) { cpm = counts * multiplier; send(msg.set(cpm)); counts = 0; previousMillis = currentMillis; } } void tube_impulse() { //procedure for capturing events from Geiger Kit counts++; }@Hek
What do you think about a sensor type geiger counter with cpm and microsievert? V_VAR1 for cpm ist not cool :cool:@FotoFieber Cannot use MyMessage msg(CHILD_ID, V_VAR1); as this is not supported by Domoticz.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login