Go Down

Topic: HELP!Geiger Counter Model: NGMC-V1 codes (Read 919 times) previous topic - next topic

013422

Apr 07, 2017, 12:15 am Last Edit: Apr 07, 2017, 12:38 am by 013422
Hey Guys,



For our Project we are making a rocket, I'm in charge of the payload part of it. So we got Arduino uno and the NGMC-V1 Geiger counter and realized we didn't know what we were getting into too. we need a code to work with our project but we don't have any luck trying to find one anywhere.
We don't much about Arduino or the codes and need help.
Does anyone know where we can find one?

KeithRB

Use the search button for the forum, you might find some useful stuff.

013422

I did but couldn't find anything to help or really understand it

jremington

#3
Apr 07, 2017, 12:57 am Last Edit: Apr 07, 2017, 02:33 am by jremington
The Geiger counter outputs pulses on the INT pin, so you need to count those pulses for a period of time, usually for 1 minute, to get counts per minute.

This forum thread had code in reply #1, which had a couple of errors that I tried to fix and some junk that I removed. I don't have a way to test it.

Connect INT on the Geiger counter to D2 on the Arduino.
Connect the grounds. Power the Geiger counter with 5V as described on eBay.

Code: [Select]

#define LOG_PERIOD 60000UL     //unsigned long logging period in milliseconds, recommended 15000-60000.
volatile unsigned long counts=0;     //variable to count GM Tube events  *** don't forget "volatile" ***
unsigned long previousMillis=0;      //variable for time measurement

void tube_impulse() {              //procedure for capturing events from Geiger Kit
  counts++;
}

void setup() {                                              //setup procedure
  Serial.begin(9600);                                    // start serial monitor
  Serial.println("Geiger counter");
  pinMode(2, INPUT_PULLUP);                        // set pin INT0 input for capturing GM Tube events
  attachInterrupt(0, tube_impulse, FALLING);  //define external interrupts
}

void loop() {                                              //main cycle
   unsigned long currentMillis;
   currentMillis = millis();

  if (currentMillis - previousMillis > LOG_PERIOD) {
    previousMillis = currentMillis;
    Serial.println(counts);      // send counts data to serial monitor every LOG_PERIOD milliseconds
    counts = 0;
  }
}


Note: if this is going into a rocket, and you want it to actually WORK in that rocket, you will need to solder all connections.  NO jumpers or breadboards.


013422


013422

The code you gave me, was successfully uploaded on sketch, but I do not know how to get the data off of it into the computer.

jremington

#6
Apr 11, 2017, 09:23 pm Last Edit: Apr 11, 2017, 09:26 pm by jremington
That program prints out counts accumulated every 60 seconds. To see the data you have to connect the Arduino to a computer running a terminal program, or Arduino Serial Monitor.

Try using the same computer as you did for uploading.

If all this is unfamiliar to you, start with the simple examples that come with the Arduino IDE (the software development package) and learn how Arduino works.

Go Up