I am using DFRobot's Gravity Geiger Counter for a project that includes a few Adafruit sensors. I'd like to use two of the Geiger Counters at the same time. One will be used as a control to see what regular radiation levels are, and the other will be covered with a material to block radiation. I'd like to compare readings from both to see how well the material is working at blocking radiation.
I feel like it is probably a simple solution to read from both sensors at the same time, but I'm not sure what I need to change in the sketch to make this work. Also, I imagine that I'd have to plug each sensor into a separate pin on the Arduino. The default pin to use is D3. Based on the following code from DFRobot, what should I edit to make two Geiger sensors work at the same time. I'll then add the edited code to my larger project code that includes the Adafruit sensors.
Code: Select all
#include <DFRobot_Geiger.h>
#if defined ESP32
#define detect_pin D3
#else
#define detect_pin 3
#endif
/*!
u/brief Constructor
u/param pin External interrupt pin
*/
DFRobot_Geiger geiger(detect_pin);
void setup()
{
Serial.begin(115200);
//Start counting, enable external interrupt
geiger.start();
}
void loop() {
//Start counting, enable external interrupt
//geiger.start();
delay(3000);
//Pause the count, turn off the external interrupt trigger, the CPM and radiation intensity values remain in the state before the pause
//geiger.pause();
//Get the current CPM, if it has been paused, the CPM is the last value before the pause
//Predict CPM by falling edge pulse within 3 seconds, the error is ±3CPM
Serial.println(geiger.getCPM());
//Get the current nSv/h, if it has been paused, nSv/h is the last value before the pause
Serial.println(geiger.getnSvh());
//Get the current μSv/h, if it has been paused, the μSv/h is the last value before the pause
Serial.println(geiger.getuSvh());
}