TroubleshootingArduino

Using Multiple SEN0463 Geiger Counters

userHead nluogameno 2023-01-25 03:02:31 194 Views2 Replies

I am using DFRobot's Gravity Geiger counter for a project. I'd like to use two of them 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 code provided on the Geiger Counter project wiki, what should I edit to make two Geiger sensors work at the same time.

2023-01-28 15:07:26

Hi nluogameno,

Thanks for your message.

I think it is possible to read two Geiger counters at the same time. 

As the picture shows, the reason why the Geiger counter is connected to D3  is that the data can only be read by external interrupt pins, which means that you can connect the device to any external interrupt pins on your board, and it will work. 

This means that to read two Geiger counters at the same time, you can connect two data pins of the counters to two different external interrupt pins, for example, D2 and D3, on Arduino UNO. Then you can read them at the same time by creating two objects in your code and printing them.

The following code is for your reference. Hopes it can help you solve the problem.

 

#include <DFRobot_Geiger.h>

#if defined ESP32

#define detect_pin1 D3

#define detect_pin2 D2

#else

#define detect_pin1 3

#define detect_pin2 2

#endif

DFRobot_Geiger  geiger1(detect_pin1);

DFRobot_Geiger  geiger2(detect_pin2);

void setup()

{  

Serial.begin(115200);  //Start counting, enable external interrupt

 geiger1.start();

 geiger2.start();

}

void loop() 

{  

 delay(3000);  

 Serial.println(geiger1.getCPM());

 Serial.println(geiger2.getCPM());

 Serial.println(geiger1.getnSvh());

 Serial.println(geiger2.getnSvh());  

}

userHeadPic Tonny12138
2023-01-25 07:05:47

Thanks for this interesting information!

userHeadPic Marceltr