Count rate meter addon/scaler for Scintillation detector using an Arduino UNO ?

I have been looking over a sketch for an ATMega328 based Geiger counter that employed the use of an internal timer. I tried running the sketch on my UNO and discovered that inputting pulses from a ratemeter with a scintillation detector about a little over 50% of my pulses were being missed. Pulses are being pulled from a MC14538B Multivibrator (pin9). The speed of these pulses is on the order 17-18uSec each. According to the documentation I should be able to count these pulses. My idea is to modernize an ratemeter/survey meter and pull in pulses and display them on an LCD screen. I'm looking at a simple user settable timer. CPS/CPM/ and a serial output. This sketch needs to be able to see ~6,000,000 CPM accurately.

Not sure what is wrong. I've tried frequency counters and I get sporadic ranging all over the place with them. weird. A pic version of this project sees these pulses without any problems.

Not enough information. Show a scope screenshot of the pulses, and post a schematic diagram of the relevant circuitry.

I don’t have a scope to have a look at the signals. I was just trying to get the output from the Survey meter to the arduino to count/rate totalize over time. I am finding that many sketch can’t utilize the internal timers and as such case a pulse pileup ( end up seeing higher pulse rates as one long pulse rather than shorter ones) . They can’t see much beyond 5,000-6000CPS.

Sorry I posted this topic late at night/early morning so I missed a tonne of additional information.
I am looking at totalizing over time (1sec/1minute/4minutes/hour…etc) pulses that are coming from the MC14538B chip on a Bicron M survey meter. The pulses coming from the chip are being pulled from pin 9 (which is unused in the survey meter. Pulses are on the order of magnitude 17-18uSec in pulse width. (end to end).

I’ve included the information on the survey meter (have a look at pp.6 and 10 , the datasheet on the MC14538B pp.2 and 5. p.2 shows pin 9 / Q is an inverted pulse.

I found a sketch from Geiger Kit (John Giametti) that includes the correct hardware timer but it’s very complicated. I’m only looking to do count rate, on both a 1602 LCD screen and out on 9600Baud serial. I don’t need the dosage.
I need to find a way to modify this sketch and keep the sampling rate as high as possible.
I need real time processing of counts.

datasheet MC14538B.pdf (290 KB)

GeigerKit_v12.ino (35.6 KB)

If you can't can't read all the pulses at high pulse rates, then you could always feed them into a binary counter/divider such as the MC14040 12 - bit binary counter, and divide the pulses by 2, 4, 8, 16, . . . . . 1024, 2048, or 4096.

You can select the division ratio by choosing which output you use, then just multiply your count by the division ratio. If you need to have a fixed width pulse then you could use one of the counter outputs to trigger another MC14538B monostable. You could even use a wider pulse width after division, without risk of pulses merging.

I'd like to avoid using other ICs to do this project. I have been told that it is more than possible to read the pulses with the internal hardware timer on the Arduino UNO. The problem is that most sketches don't make use of this and as such are limited as to how fast they can keep up with the input pulses.

In theory one should be able to get a 4uS response time. That's plenty fast for what I need.

Bottom line is I need to find a way of accessing the internal hardware timers and simply pull pulses from the correct pins. Apparently there are 2 internal timers on an ATMega238.

I’ve tried frequency counters and I get sporadic ranging all over the place with them.

I have been told that it is more than possible to read the pulses with the internal hardware timer on the Arduino UNO. The problem is that most sketches don’t make use of this and as such are limited as to how fast they can keep up with the input pulses.

What have you tried?

FreqCount.h uses the external clock source as input FreqCount Library, for Measuring Frequencies in the 1 kHz to 5 MHz Range

Nick Gammon also has some elegant examples of counters which use the external clock source here
https://www.gammon.com.au/timers

Here’s a simplified version which does not handle rollovers or turn off other interrupts, or control the measurement period from a second timer, but it might give you some ideas.

//frequency counter using Timer1 counter without overflow count
//TCNT1 16 bit max value = 65,534
//20ms sample period gives frequency counter to a bit over 3.2 mhz

unsigned int dwell = 20000; // dwell in microseconds for counter
unsigned long final_counts;
unsigned long start_time;
unsigned long measured_time;

void setup()
{
  Serial.begin(115200);
  TCCR1A = 0; //initialize Timer1
  TCCR1B = 0;
  TCNT1 = 0;

  pinMode( 5, INPUT_PULLUP); //external source pin for timer1
}

void loop()
{
    start_time = micros();
    TCNT1 = 0;//initialize counter
    // External clock source on Timer1, pin (D5). Clock on rising edge.
    // Setting bits starts timer
    TCCR1B =  bit (CS10) | bit (CS11) | bit (CS12); //external clock source pin D5 rising edge

    while (micros() - start_time < dwell) {} // do nothing but wait and count during dwell time

    TCCR1B = 0; //stop counter
    final_counts = TCNT1; //frequency limited by unsigned int TCNT1 without rollover counts

    measured_time = micros() - start_time;

    Serial.print(measured_time); // report resulting counts
    Serial.print("\t\t");
    Serial.println(50 * final_counts); //20ms sample in Hz
  }