Got the enclosed Sketch from “thegeekgroup”. It will gather the data that I need.
How do I send this data from one Arduino Uno/Xbee (series 1) hooked to the Geiger Counter to another Arduino Uno/Xbee (series 1) hooked to the computer.
I know how to hook things up and put the data in a .txt file but am not smart enough to write the additional code for either Arduino/Xbee.
Any help would be very much appreciated.
//CPS Sketch
int count = 0;
void setup() {
Serial.begin(9600);
pinMode(2, INPUT);
digitalWrite(2, HIGH);
attachInterrupt(0, count_isr, FALLING);
}
void loop(){
int i;
delay(1000);
i = count;
count= 0;
Serial.println(i);
Are you sure. This bit can potentially miss counts:-
i = count;
count= 0;
Serial.println(i);
If a count occurs between the first and second lines you will miss it. Why not just keep on sending the accumulation of counts and subtract the previous sample from it at the other end or even at the arduino.
and put the data in a .txt file
Just change the file type to .csv for a spread sheet.
Why are you using a second arduino you can connect the xbee direct to the PC through a USB / serial bridge.
Only getting about 4 CPS background out of the GM tube and it has a fairly short dead time. So missed counts due to dead time won’t be much of a problem.
Hope the counts on the spread sheet are close to the digital meter on the counter. I do not plan to apply a dead time correction.
Will let you know how the code changes you suggested work. Might be tomorrow.
Found PLX-DAQ and it works great with Excel over Xbee with the test Sketch below.
//Arduino PLX Test
int val = 0;
int val1 = 0;
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
//int val = 0;
Serial.println("CLEARDATA");
}