DIY PIC18 MCA Module for Gamma Spectroscopy 1024 Channels 10bit ADC w/SD logs
Gamma Viewer 1.00 - DIY Multi Channel Analyzer for Gamma Spectroscopy
The module is assembled miniature Multi-Channel Analyzer (MCA) board based on PIC18 microcontroller. It allows to view and collect gamma spectum instantly without a computer and safe spectra on micro SD card. The MCA uses internal 10bit ADC of the microcontroller.
The board has analog circuit that translate PMT pulses into signal that 10bit ADC can sample in better way. The spectrum is displayed on 128x64 LCD and stored on micro SD card for further analyzing with BecqMonitor2011 software.
- Application: Amateur Gamma Ray Spectroscopy Project
- ADC: 10bit 1024 channels PIC18
- Energy Range: 10keV - 3000keV
- Linear / Logarithmic Scale Display
- CPS (counts per seconds) Counter for optimal measurement control
- Calibration Engineering Menu
- micro SD card socket
- Power Supply Voltage: 5V-12V DC
- Display: 128x64 LCD 2.8" with Backlight
- Require Input Signal Amplitude: 20mV-3000mV
- Require Input Pulse Duration with exponential fall: 30uS-50uS
- Require Input Pulse Raise time: 2uS-10uS
- Recommended count rate for spectra < 1000 CPS
- Working Modes: MCA / Scintillation counter / UART-USB
- Module size: 71mm x 55mm x 20mm
- Shipping Weight: 180gr
- UPC Number: 634154871195
- SKU: RH-M-MCA-18
The purchase include printed electrical diagram of a recommneded pulse pre-amplifier that you can assemble by yourself. However you also can buy the assembled pre-amplifier in bundle purchase with the MCA.
Signal amplitude and timings have to meet the requirements: amplitude 20mV-3000mV, total pulse decay duration with exponential fall 50uS-100uS, rising edge time 2uS-10uS. See yellow color channel record on the scope video:
The green color record channel in scope video above is ADC input test point TP3. The yellow color record on TP1 are PMT pulses coming from external pre-amplifier. You may need 2-channel oscilloscope to check test points TP1 and TP3.
NEW! Since 1.06 firmware it can be used as UART-USB live data spectrometer. All you need is updated firmware and CP2102 USB-TTL module. Current version of the PC software is the beta version, you are welcome to send me an email if you see any bug. The software require Microsoft .NET Framework 4.5.2 installed on your computer.
CP2102 module is wired with RX and GND pins to the MCA module as shown in the diagram. In the UART mode the button on processor pin RB6 is not active because the pin is used for the data transfer.
To activate UART mode in the MCA module navigate to the Menu -> Mode -> UAT
To exit from UART mode press button on RB7
DOWNLOAD Firmware 1.05 (if you want to keep the old version)
What is required hardware calibration for the module?
The analog circuit and software will need minor calibrating for a particular tube, so it's better to have an oscilloscope and some previous experience to deal with PMT tubes in spectroscopy subject. With correct setup you can get FWHM resolution <7%
Before you start with the MCA, I suggest to validate that pulse shape output from your PMT pre-amplifier is under recommended requirements. The pulse rise time can be 2us-10us, fall time <=50us, overall pulses amplitude maximum 3000mV (VREF). Small DC offset of 30mV-50mV is recommended on the output. With your purchase I send printed diagram of recommended amplifier, so you can assemble one to get recommended pulse shape.
Connect the amplifier to MCA module and test TP1 has 5mV~50mV DC bias coming from pulse amplifier output.
Test TP4 and set voltage on it with small blue potentiometer. The TP4 need to be 10mV-40mV above the TP1 value. For example TP4 = TP1 + 20mV = 50mV The correct value for your setup depend on tube type, high voltage noise and lowest energy pulse amplitude.
TP2 is voltage reference point for PIC18 ADC. The circuit uses default filtered 3.3V, but the PCB allows to solder VREF IC LM4040 sot-23 or one with same pinout. If you add VREF IC then you will need to change one 0603 resistor on the module. The modification is on your own soldering skills. If you change VREF from 3.3V to any other value between 1.2V-3.0V then be sure your pulse amplifier dynamic range is limited up to your new VREF value. Supplying 3300mV pulses into ADC with VREF of 2500mV is prohibited! Not sure if you need new VREF? Just use default setup.
Connect second oscilloscope input to TP3. On TP3 you can view pulses that are coming to ADC (green line readings in the video above). Check that rising edges of simultaneous pulses are synchronized. If get bumps or slopes on ADC input reading then your pulse amplifier need timing adjustments. Again, see video to validate the correct shape of signals.
All further setup is only to find correct and best high voltage value on tube for better resolution. Probably TP4 re-adjustment may require for lowest energy range. It trial and error process, no one can say what is exact values you need here with PMT you connect. You can spend all day collecting spectra, comparing it and re-adjusting the settings again. Be preparing for spending hours on it.
Along with finding best HV settings you need to set up the software. It’s time now to describe menu options. Long press on left button will open the menu. It has following items:
DUMP to SD – will write spectrum to SD on demand. Require only if you want to safe the data before waiting spectrum collection is ended.
RESTART – restart new spectrum, all previous data of current collected spectrum will be erased.
RETURN – exit from menu without making and changes.
SET MAX CNT – set maximum counts in one channel. You can set from 1000 up to 30000 counts in one channel. The value will stop spectrum measurement when number is reached in particular channel and will trigger auto-dumping to SD.
SET MAX TIME – set maximum time of spectrum measurement in seconds. You can set from 100 up to 7200. The value will stop spectrum measurement when number is reached and will trigger auto-dumping to SD.
The first reached value between MAX CNT or MAX TIME will trigger auto-dumping spectrum to SD.
DC OFFSET (no longer used in 1.06 or newer firmware) – this what you read on TP1, but in ADC units! By default it set to recommended 0 (zero). If your DC offset in amplifier is higher than 100mV it suggested to try that function for better display view of spectrum. How to calculate ADC unit? Use VREF/1024. For example 3300/1024 = 3.22; Then 100mV/ 3.22 = 31 ADC units. So you can set DC OFFSET = 31 Beware, wrong settings here may lead to software instability! That’s way be careful and not increase that value in large steps.
MODE - togge working modes: MCA, Scintillation Counter or UART logger (since 1.06 firmware)
SET MIN CH – this is minimal channel number you want to view on spectrum. It works to filter out PMT noise on energy below 20keV. Trial and error method. Default is 10.
SET MAX CH – same as previous function, but form the top side of spectrum. If dynamic range of the amplifier gather all highest energies above 1700keV into one big bump on the spectrum right side then you can cut-off it with that filter.
SET MIN CH and SET MAX CH functions where updated in firmware 1.03. Previously it was used only to filter out noise channels on top/end of a spectra. Now it also allows to select a specific region and ignore all peaks beyond. On SD file, all filtered channels will be saved with zero value.
Be careful not to overlap minimum and maximum channels, otherwise the MCA will not capture any spectra.
REMOVE NOISE CPS - when enabled, allows to show on LCD only relevant CPS counts in range of minimum / maximum channels. When disabled, all CPS events are counted for LCD. This function can be useful when you debug the noise level of your system or want to estimate full spectra CPS vs. activity for selected region. Available in firmware 1.03.
LCD ZOOM RANGE - added LCD zoom. You can set number of channels to display on LCD from 128 to 1024. Available in firmware 1.03.
LCD FIRST CH - Related to LCD zoom, you can set the first channel for LCD zoom range. LCD zoom settings has no influence on SD data file. As before, the log. file will contain all 1024 channels. Available in firmware 1.03.
SAVE&RESET – you need to make software reset if any of functions above where changed to get it works.
During spectra measurement you can switch between linear or logarithmic scale by pressing right button shortly.
After dumping to SD make long press on right button to restart new measurement.
What you get on SD? Use SD card formatted with FAT or FAT16. FAT32 is not supported. The data is saved in CSV format file. That file can be opened with BecqMonitor2011 software on computer. You need to perform 3-point energy calibration of BecqMonitor2011 before you check resolution at 662keV. Use Cs-137 with K-40 to find channels number for 32keV, 662keV and 1461keV.
The software of MCA module can automatically create up to 256 CSV files on SD card. The time stamp of files is not updated in current version. Beware, the software currently uses HEX format for file name order! It mean the first file has name SPECTR00.CSV, the tenth file has name SPECTR0A.CSV, the last file has name SPECTRFF.CSV If you have experience with computer or microcontroller programming then you probably know about hex numbers, anyway here is example screenshot:
SCINTILLATION mode for searching with NaI(Tl) / CsI probe. Available in firmware 1.03a
In firmware 1.03a we have added scintillation mode for the MCA module. The mode allows you to use your NaI(Tl) probe for searching of low contaminated areas. First time you activate the scintillation mode the software will run 5 minutes calibration to calculate average and standard deviation for your probe.
Menu Functions related to Scintillation mode:
SCINT MODE – activate scintillation mode, restart applied by auto.
BEEP FREQ.HZ – set for sounder clicker frequency.
DEALAY N-pulses – the module will click on every N particle detected.
CONFIDENCE SIGMA – set 2 for fast searching or 3 for more accurate search but slower response of alert.
CALIBRATE SD – will trigger 5 minute scintillation re-calibration on the next restart.
AVERAGING SEC – 2 or 3 seconds to average CPS results. Use 2 for faster search.
Take note, some MCA menu settings for acquisition spectrum is not active in scintillation mode! Switch back to spectrum mode by setting SCINT MODE to OFF.