Or, you can assemble one using more base electronic components, which is the most economic and difficult option.

Regardless, for less than the price of a higher-end Geiger counter, you can assemble something capable of gamma spectroscopy.

Why use analog input for this? Aren't microcontrollers better at this kind of thing?

Yes. They are, as their ADCs are superior to a sound codec's.

Analog input is used for several reasons

1. Compatibility. There are no standards for USB realtime spectra acquisition interfaces.

2. Licensing. Any device connected via the dock connector must have a licensed encryption chip from Apple's "Made-for-IPod" program. (this also applies to non-headset Bluetooth devices)

While quite possible to acquire spectra data in this manner (I've actually implemented it before), each licensed accessory would have to be supported individually.

Can I use Gamma Spectroscopy mode with a Geiger counter anyway?

Yes, though it is not recommended.

Advantages

Additional DSP filter:

Baseline (ripple) filter

Disadvantages

RMS Window is forced to 1

Delay windows must be set using "base delay"

Some DSP filters in Geiger counter settings are unavailable

Hysteresis Filter, Ultrafast Rates, Auto-Adjust, Enable AGC

Acknowledgements

Counting clicks is one thing, but accurately detecting their peak amplitude is a more complex topic. The DSP I am doing is in no small way inspired by the programs PRA and FitzPeaks by Marek Dolleiser and Jim Fitzgerald, respectively. The current algorithm owes a great deal to PRA and Marek Dolleiser in particular, who played a direct role in providing key information during development.

Not only do these two programs do gamma spectroscopy better than Geiger Bot, they have more importantly proven that gamma spectroscopy acquisition from a relatively low resolution 44 kHz line input is possible with novel DSP techniques.

If Geiger Bot's gamma spectroscopy isn't producing useful results for you -- either due to the software implementation or hardware limitations of the maximum sampling frequency, I recommend trying these programs.

Finally, I would like to thank Shintaro Funabasama for providing key test data and feedback that enabled me to begin developing this feature in the first place, and Steven Sesselmann and Marek Dolleiser for assistance with the pulse shape matching.

"Before attempting to create something new, it is vital to have a good appreciation of everything that already exists in this field." - Mikhail Kalashnikov

1. Histogram

The histogram is the accumulated gamma spectra for display and isotope identification. It will not function until training is complete. (note the energy calibration is incorrect in this screenshot)

2. Pulse Shape Training Screen

You must train the pulse shape of your scintillation counter with at least 512 samples, as indicated by a progress bar at the top.

The blue line is the trained average shape. The red is the newest input sample.

Pulse shape training does NOT affect the count rate.

The numbers at the bottom in green are the value of each sample. (largely irrelevant)

[T] is the threshold, in percent, to which new samples are compared to the trained sample. ie, 50% threshold on a value of 1.0 must match 0.5 - 1.5.

[n] is the number of samples trained. This is also shown in the bar at the top, though the bar maxes out at 512.

Histogram (Gamma Spectroscopy) Controls

Button controls: (1.7.0+)

Button

Effect

+

Increase resolution (-bin factor)

-

Decrease resolution (+bin factor)

~

Access pulse shape training screen

(size arrows)

Maximize / minimize histogram window

Gestures:

Direction

Fingers

Effect

← or →

1

Graph Trace - show keV/bin

↑ Up

2

Zoom In

↓ Down

2

Zoom Out

← Left

2

Pan Right

→ Right

2

Pan Left

Any

3

Change Y-Scale (LIN, LOG, SQRT)

In general, the only gestures of practical use are trace and changing the y-scale

4. When you have > 512 samples and are satisfied with the shape, turn training mode off.

5. Pulse shape recognition is now active. With training mode off, the red line will graph any input samples that match the shape at the specific tolerance, so you can monitor what it's doing.

NOTES:

1. The volume threshold I found the best for training was 2000 in testing. This may need to be changed based upon your equipment.

2. I found background levels produced better shape training than exposure to a source. Again, this may vary for you.

3. If the volume threshold is 10K it is automatically temporarily switched to 2K during training so the default value is useful.

4. The shape tolerance seems to need to be much higher than in PRA; I don't know if this is due to my implementation or the hardware itself.

5. I did not have good luck getting a clean input signal when the AC adapter was connected, perhaps due to audio input from the dock connector or changes in the line impedance. You may need to verify your input is unchanged after connecting it to an external power source, or operate it on battery.

OTHER OPTIONS:

1. Use Max As Amplitude: Instead of performing a dot product calculation similar to PRA, this simply uses the highest input buffer value for the sample. It is likely less accurate than the dot product, however it will give consistent results independent of the shape trained. Basically, it lets you avoid continually recalibrating the energy - bin correlation but at the expense of some accuracy.

2. Sample Size: In emulation of PRA the default sample size is 16. Here, you can customize that, as 16 is likely a bit excessive for a 44.1kHz input rate. I did not have good results with my equipment below 10.

3. Tolerance: This slider controls how exact each sample has to match the reference shape. I got the best results at 75%. The numeric value is shown at the bottom of the screen as [T]. The lower the value, the tighter the tolerance, and more strict the filtering. If you turn this below 50% and your hardware setup is similar to mine you will have difficulty matching samples.

TROUBLESHOOTING:

NO PEAK SHAPES RECOGNIZED AFTER TRAINING:

1. Go back to the training screen after having trained 512+ samples, but don't turn training mode back on. Instead, just watch the graph.

2. Every time a successful shape match is performed, the red line will be updated to that.

3. If you are seeing no matches, crank the shape tolerance to 100% (all the way to the right)

4. If you still aren't seeing any matches, re-train the shape. Make sure you are not near an active source.

5. If retraining is not successful, make sure your volume threshold is 2k. If you've tried that already, try changing it somewhat. When I set the volume threshold too high, few to none of the samples would match the training.

TOO MANY PEAKS ACCUMULATING IN FIRST BIN:

1. Check the normal audio graph screen and make sure the input volume is ok (ie, varying between min and max, roughly)

2. Check the volume threshold setting. This happened for me with a setting of 500 or below. You will have to re-train after changing the volume threshold to correct this (if that was the cause).

This affects both scintillation count rate and energy spectra training.

During pulse shape training, this is the threshold after which the shape is considered to occur.

Baseline Correction (optional)

This is to mitigate the effects of ripple in some scintillation probe HV power supplies

If enabled, this tracks the average of the last 5 samples below the volume threshold

This average is subtracted from the peak amplitude before it is binned

This ONLY affects count rate (1.5.7+)

Base Delay

Base delay is similar to the Geiger counter setting "delay windows". (1.5.7+)

Its sole purpose now is to prevent multiple false counts (1.5.7+)

It only affects count rate, not the energy spectra (1.5.7+)

Maximum Conversion Samples

N/A, removed

AUTO-DISABLED WITHGAMMA SPECTROSCOPY

Auto Adjust

Ultrafast Rates

Enable AGC

Hysteresis Filter

RMS Window

Delay Windows

Clickify

Default and Recommended Starting Settings for Gamma Spectroscopy

SHARED GEIGER COUNTER SETTINGS

Rec. Value

Default

Notes

Conversion Factor, CPS/mR/h

2917

22

You must later manually enter the correct value (2917 CPS/mR/h is for a Ludlum 44-2 1"x1" NaI probe) Count rate only.

Volume Threshold

2000

10000

Must be low enough to catch low-energy peaks

SCINTILLATION COUNTER SETTINGS

Value

Default

Notes

Gamma Spectroscopy Enabled

ON

OFF

MUST BE ENABLED

Min Channel

0*

0

Optional. Minimum display channel for histogram. Should be set to be about the same as the volume threshold.

Max Channel

32767*

32767

Optional. Maximum display channel for histogram. Should be set to be barely above the highest peak amplitude from a high-energy gamma photon.

Input Polarity

Both*

Both

Optional. You must manually determine the correct value. "Both" can be used, but may cause double counts sometimes. Count rate only

Base Delay

10*

10

Equivalent to "delay windows". Count rate only

LUT

R. HC*

R. HC

Optional. The spectra is colored between 0 and 2000 keV with a false-color lookup table palette (LUT). This is to make the spectra more intuitive to determine position in.

*default setting value

CALIBRATION INFO:

Total channels (bins)

32768 (fixed)

Input amplitude to channel ratio(after absolute value)

1:1 (fixed)

Input amplitude range (16-bit signed integer)

-32767 ... 32767 (fixed)

Input amplitude range peak-peak (volts)*

-0.447 ... +0.447

Input line level, nominal (volts RMS)*

0.316

Input line level, nominal (dBV)*

-10 dBV

Channel to keV formula (linear)

keV = channel / m + b

*(line-level specs from Wikipedia. Untested but assumed correct.)

ABOUT CHANNELS AND SPECTROSCOPY:

Normally, MCAs use 256 - 4096 channels for input.

These are usually mapped to a certain range of input amplitudes.

Geiger Bot uses 32768 channels

These are NOT mapped to a certain range and are fixed

Geiger Bot resamples the raw input channels to a dynamic number of display channels

By default, that is one per pixel, or 640 channels on a retina display

Advantages

Allows for a streamlined process in the normal steps of calibrating input to bins, and then bins to energy.

Zooming the spectogram in shows truly more detail, rather than just larger pixels

There is little performance difference vs. 4k channels in testing, due to the use of SIMD code (version 1.5.4+)

Configuring and calibrating the display and energy range does not require clearing all input bins

Disadvantages

Because of the very high detail plot, more data collection is required to obtain a smooth appearance

The resolution of the input is not truly as high as the resolution of the bins

CALIBRATION STEPS:

The purpose of calibration is to map the channels of input amplitude to the energies of gamma radiation which they represent. If you do not do this, the energy (keV) value will not be accurate or meaningful. Even without calibration, the shape of the spectrogram may have some value to a trained observer by itself.

Another purpose of calibration is to verify that the relationship between amplitude and gamma energy is roughly linear, and that neither low-energy nor high-energy gammas are being cut out of the input. This is of significant concern for interpreting the shape of a spectrogram correctly.

First, set the recommended starting settings for gamma spectroscopy as noted above.

To check to see what Geiger Bot calculated for calibration in the form y = mx + b, including RMS error% of the model, check the console after closing settings.

At this point only 3 calibration points are supported, and only a first-order linear regression is available, but this may change in the future.

NOTE: If you re-train a sample shape the current calibration will to some extent be invalidated as it is dependent upon the trained shape

Interpreting the Spectra

Generally, this is a simple matter of visually determining the peaks, and tracing them to find their energy. This will give you some idea if you're looking at natural background radiation, or possibly something else entirely. It will take much longer to get an accurate energy spectra gathered, compared to count rate alone.

It is easier to distinguish between things when you have some idea going in of what the possible isotopes involved are. There are many odd isotopes you will find in reference tables that can be misleading that you will probably never encounter. So it helps to look for natural background peaks first, and then common industrial and medical isotopes, and long-lived fission products.

Another thing to note is that the peak for an isotope is due to either the phenomena of pair production or the photoelectric effect. But what you will also detect simultaneously for the same isotope is Compton scattering. Visually, the Compton scattering will appear as a shorter, concave set of a wider range of values in bins lower in energy than the pair production / photoelectric peak. Note this will happen for every peak on the spectra, so you will have multiple sets of Compton scattering values accumulating. This is why the spectra always has a large, irrelevant hump at the beginning of it. (which DSP artifacts also add to)