You are on page 1of 17
DEVELOPING A MULTI-CHANNEL ANALYSER FOR RADIATION ENERGY MEASUREMENTS Author : Jithin B.P. Worked at : Inter
DEVELOPING A MULTI-CHANNEL ANALYSER
FOR RADIATION ENERGY MEASUREMENTS
Author : Jithin B.P.
Worked at : Inter University Accelerator Centre , New Delhi
Mentor: Dr. Sugathan P , Scientist
(Inter university accelerator centre)
Duration : June 15 - July 25 ,2011

Objective A multi-channel analyser(MCA) is basically used to segregate input voltage pulses

based on their amplitude and generate a histogram. The MCA is interfaced to a

computer via

USB and

a

Graphical User Interface is provided to display

the

spectrum.

Using an MCA for plotting energy spectra from radiation sources

When an alpha particle is incident on a detector , a pulse corresponding to its energy is generated. This pulse is passed through a preamplifier and a shaper and is given as input to the MCA. The MCA can now interpret these pulses based on their height and a corresponding energy spectrum can be plotted. These pulses typically last a couple of microseconds only .

Code all software and run tests on an MCA .

Software coded for this purpose:

firmware for the atmega32 which interfaces the hardware and recieves input

User end software on the PC which enables basic user controls and plots the data sent over by the hardware

additional codes used for troubleshooting etc.

Features:

Buffering and stretching of input voltage peak to enable sampling by an ADC.

11 bit ADC conversion(2096 channels) using the MCP3208 chip

reading and writing from an 8K static CMOS memory due to shortage of memory on the ATMEGA32( 2K )

38k BAUD serial interface to a PC running the user end software

User end software has the ability to intermittently poll data stored on the MCA and plot graphs

Starting from scratch

Starting from scratch Fig 1: Hand wired memory and ADC board with PMDK development board My

Fig 1: Hand wired memory and ADC board with PMDK development board

My hand wired circuit board that allowed me to code software for the MCA before the actual PCB with the pulse processor included was delivered.

This involved reading the voltage value at pin 1 of the ADC and incrementing the value stored in the corresponding memory location on the external memory chip

The ADC is operated in 11 bit mode , which essentially means that for a 0-5000mV input voltage , it will return a 0-2096 ( 11 bit ) value. A direct consequence is an approx 2.5 mV resolution.

In actual operation , A Hardware interrupt is triggered when a voltage pulse is detected, following which the peak value is read and the corresponding memory location is incremented.

Here's an example to clarify :

Assuming that 1V is present at the input of the ADC. Upon reading this value as measured by it onto the microcontroller , It returns (1000mV/5000mV)*2096 =

419

Following the voltage measurement , the microcontroller reads the 419 th memory location , adds 1 to it and writes it back onto that location. In effect , one could plot a histogram by reading the data on memory locations 0-2096 and see a peak at x-axis value 419.

Although , the constant presence of 1V on the input will not cause location 419 to be continuously incremented . The software is interrupt driven , and hence , only a pulse with some peak height will cause an increment at the location corresponding to its height.

Since each memory location is only one byte(max value = 255) , 256 pulses on the same channel will cause it to overflow. As a solution to this problem , four bytes each have been allocated to the ADC values . In a nutshell , such a move would mean that 2 raised to 32 pulses with the same height will have to be triggered in order to cause an overflow . And the corresponding radiation overdose , I assume , will not allow any user to witness it.

Here's a block diagram to roughly illustrate the working. Oscilloscope grabs will be featured subsequently.

Here's an example to clarify : Assuming that 1V is present at the input of the

Fig 2: Block diagram

Hardware further illustrated

One step further into the quagmire.

The MCP3208 Analog to digital convertor

Capable of 12 bit ADC conversion , this IC has 8 input channels and an SPI serial interface for relaying data onto a microcontroller or any other device capable of communicating similarly.

Hardware further illustrated One step further into the quagmire. The MCP3208 Analog to digital convertor Capable

Fig 3: ADC specs

connected pins on the microcontroller:

#define

SPICTL

PORTD

// CK=PD2, ADCS = PD3, DACS = PD4

#define

CLK

(1 << PD2)

#define

ADCS

(1 << PD3)

#define

DACS

(1 << PD4)

#define

ADCKLO

DACS

// ADCS and CLK low

 

#define

ADCKHI

DACS+CLK

// ADCS low and Clock hi

#define

CSHI

DACS+ADCS+CLK

// Both CS and Clock hi

#define

DACKLO

ADCS

// DACS and CLK low

 

#define

DACKHI

ADCS+CLK

// DACS low and Clock hi

#define

SPIWR

PORTB

#define

SPIRD

PINB

#define

OUTHI

2+1+DISMEM

// PB1 HI and pullup of PB0 //Mask for memory controls

#define

OUTLO

1+DISMEM

// PB1 LO pullup of PB0

//Mask for memory controls

The HM6264 8K CMOS static RAM

The HM6264 8K CMOS static RAM This IC allows for 8 kilobytes of storage locations ,

This IC allows for 8 kilobytes of storage locations , each of which can be referenced and modified by means of a 13-bit address code and an 8-bit data buffer.Fig 4: Memory IC specifications

MEMORY READ /WRITE FUNCTIONS

The HM6264 8K CMOS static RAM This IC allows for 8 kilobytes of storage locations ,

Oscilloscope grabs for different events during operation

A precision pulse generator and a preamplifier were used for the following test data.

from Interrupt triggered(CH1) to clear pulse(CH2) sent

Oscilloscope grabs for different events during operation A precision pulse generator and a preamplifier were used
Oscilloscope grabs for different events during operation A precision pulse generator and a preamplifier were used

Fig 5: Interrupt on DRDY vs CLR signal

As soon as the falling edge on CH1 is detected , the voltage is read from the ADC and a CLEAR pulse sent in order to reset and prepare for the next pulse.

Stretching the peak to enable sampling by the Analog to Digital Converter

• Stretching the peak to enable sampling by the Analog to Digital Converter Fig 6: Peak

Fig 6: Peak holding

The peak voltage of the input pulse is buffered and stored in a capacitor till the ADC reads the value and a CLEAR pulse is detected.

• Stretching the peak to enable sampling by the Analog to Digital Converter Fig 6: Peak

If an actual alpha source had been used , the peak height would correspond to the energy of the particle that generated the pulse.

Fig 7: DRDY and CLR pins

• Interrupt on DRDY vs S tretched peak voltage Fig 8 • interrupt on DRDY vs
Interrupt on DRDY vs S tretched peak voltage
Fig 8
interrupt on DRDY vs input pulse
• Interrupt on DRDY vs S tretched peak voltage Fig 8 • interrupt on DRDY vs

Fig 9

The pulse generator used for test runs and reliability tests.

The pulse generator used for test runs and reliability tests. Fig 10: pulse generator and preamplifier

Fig 10: pulse generator and preamplifier

A BNC model PB-5 pulse generator was later used for testing the scaling reliability (Fig 13 ) of the ADC when pulses with heights as fixed multiples were polled for given time intervals.

Reliability tests

Reliability tests Fig 11: Precision tests For approx. 1.5 million pulses from the pulse generator triggered

Fig 11: Precision tests

For approx. 1.5 million pulses from the pulse generator triggered on channel 968 , the peak spread over only three channels . Indicating a precision of around 10 mV for this large a number of pulses from the pulse generator.

Testing precision of the Analog to Digital Converter.

Testing precision of the Analog to Digital Converter. Data shown : Fig 12 38- ADC value

Data shown :

Fig 12

38- ADC value for input voltage [ 185mV ] This voltage was measured at pin 3 of the comparator chip while testing. 149488 – number of interrupts triggered for that partiular value [i.e. ,as many square waves were received ] 240,71,2,0 – the four bytes that store the above mentioned value. 149488 = 240 + 71<<8 + 2<<16 + 0<<24 ( bit wise shifting ) = [00001111,01000111,00000010,00000000]

Improving the efficiency at the software level .

Till this point , the user end software kept reading data after a fixed time interval once the 'start' button was pressed . This results in a lot of input pulses being ignored while the data is being transmitted by the hardware. Reading 8000 bytes of data over a BAUD rate of 38400 takes roughly 1.6 seconds. This wastes much data.

Solution : Provide an 'update' button which polls data only once when it is clicked. For the remaining time , a counter showing the total number of pulses elapsed following the last UPDATE is shown on the user's GUI. This involves sending only 2 bytes every second . Based on this dynamic data made available, the user can decide whether or not to run another UPDATE.

Improving the efficiency at the software level . Till this point , the user end software

Fig 13

It may also be observed here ,that the ADC conversion is non linear , and hence inaccurate for voltages below 800mv. This can be seen in the unequal spacing of the peaks in the region upto channel 400. muliples of 0.5 volts were polled for fixed time intervals

TESTING WITH A GAMMA SOURCE

Source used : Cobalt-60

Co-60 is a radioactive isotope of Cobalt with a half life of around 5.17 years . It decays to give Nickel-60 and the activated Nickel nucleus emits two gamma rays of energies 1.17 and 1.33 MeV.

Detector Used : Sodium Iodide scintillation crystal attached to a photomultiplier tube and a preamplifier included in the unit. [Bicron electronics – IL-496]

The signal was amplified and given to the MCA.

TESTING WITH A GAMMA SOURCE Source used : Cobalt-60 Co-60 is a radioactive isotope of Cobalt

Two peaks at roughly 4017mV and 4554mV were obtained from the Cobalt source . Since scale factor was not calculated, I cannot scale these voltage values into MeV readings. What I can do is verify that the ratio of energies of these peaks is the same as that of the known values as mentioned in Wikipedia. Therefore,

(4017/1.17)*1.33 = 4566.3

A Fair assumption that the peaks are indeed from Co-60

The source was placed around ten cms from the detector and a rate of approximately 4600 pulses/S were observed.

Source codes and other relevant files attached Hardware

echo_11bit.c – Final ,fully functional firmware running on the MCA .

Echo.c – development stage

memory_read_write.c – test R/W from 8K memory chip via serial port.

Software

rs232echo.py - used to read and display data on the console. Mainly for development and troubleshooting stages.

rad_mca.py – development stage

rad_mca5.py – Final GUI available to the user . Continuous polling disabled.

X-axis zoom and MCA pausing implemented. pmdk_uart.c – communication library used in the initial stages . Relevant

communication code copied later. Compiling and uploading firmware AVR-GCC and UISP used in batch files compile.sh and upload.sh

Acknowledgements

I am grateful to Dr. V.V.V Satyanarayana for all his help and support on the intricacies of the hardware throughout the period of this project and all the help during the testing phases.

  • I also appreciate all the effort put in by my mentor Dr. Sugathan

References

  • 1. Datasheets for Atmega32, HM6264 and MCP3208 from their respective manufacturers' websites.

FINAL GUI

4. <a href=http://en.wikipedia.org/wiki/Cobalt-60 FINAL GUI Fig 14 Click on a peak to center it ,and scroll up to zoom[x-axis scales accordingly] NOTE: This peak is not gaussian fitted, merely smoothened by the Tkinter canvas object plotting library. The 'rate' button opens a secondary graph which plots the rate at which pulses are input in the last two seconds. It samples every 100 ms. The hardware gathers pulses only if 'record pulses' button is selected. " id="pdf-obj-15-10" src="pdf-obj-15-10.jpg">

Fig 14

Click on a peak to center it ,and scroll up to zoom[x-axis scales accordingly] NOTE: This peak is not gaussian fitted, merely smoothened by the Tkinter canvas object plotting library.

The 'rate' button opens a secondary graph which plots the rate at which pulses are input in the last two seconds. It samples every 100 ms.

The hardware gathers pulses only if 'record pulses' button is selected.

Compile.sh and upload.sh scripts to run the source code on the ATMEGA32 microcontroller

Compile.sh and upload.sh scripts to run the source code on the ATMEGA32 microcontroller AVR-GCC compiles the

AVR-GCC compiles the program into a hex file which is then uploaded into the chip via the parallel port by UISP uploader.