Pomelo: Gamma Spectroscopy Module

A complete low-power gamma ray spectrometer that can be used by itself or integrated into other projects

Pomelo is a radiation detector for hobby-level gamma spectroscopy. I’m designing it according to the following requirements:

- Low cost. Target is below 150 Eur in components
- Commercial off-the-shelf scintillator and SiPM
- Low power. Ideally ~5mA while data taking, but realistically... best effort
- USB connectivity (CDC for dumping data to a terminal)
- UART for interfacing with an external MCU
- Energy range: 50 keV – 3 MeV
- Onboard histogramming and run control (spectrum readout, reset, timed measurements)
- List-mode data option
- Temperature compensation
- Coincidence measurements with two devices using dedicated hardware handshaking
- Software configurable energy threshold

This project is inspired by three awesome projects, two of them being open-source:
All-In-One Gamma-Ray Spectrometer https://hackaday.io/project/185211-all-in-one-gamma-ray-spectrometer
Cosmic Pi https://github.com/CosmicPi
Radiacode https://www.radiacode.com/products

Complete gamma spectroscopy module ready to be connected either to a laptop or an embedded system. It measures less than 130mm x 40mm x 30mm

This contains everything that’s needed for gamma spectroscopy and nothing more. It has the detector assembly (Pomelo Physics) with scintillator and silicon photomultiplier, as well as the accompanying electronics (Pomelo Core) with bias supply, analog front end, and digital electronics.

Its USB and UART connectivity allow it to interface to lots of things, like a laptop, an Arduino, or a Raspberry Pi. It integrates a level shifter on the UART lines so it can talk to both 3.3V as well as 5V systems. I have used it during development to perform measurements with radioactive sources:

I made an Arduino-compatible board that contains supporting circuitry to make a complete hand-held instrument based on the Pomelo Core and Physics. It has buttons and a screen, battery, and lots of wireless connectivity:

I'm also using Pomelo to experiment with visualizing gamma spectra in a more intuitive way, shown as colors on an LED strip:

Pomelo Physics

Pomelo Physics is the detector assembly, containing:

Pomelo Core

Pomelo Core contains all the associated electronics:

  • Digitally controlled SiPM bias supply ~32V - ~48V
  • Digitally controlled threshold
  • Low power analog front-end
  • ARM Cortex-M0+ microcontroller, Microchip ATSAML21G18B
  • UART connectivity with integrated level shifter
  • 10 unused GPIO pins for further expansion


Spectra for various radioactive sources taken with Pomelo

The energy resolutions at different energies are:

  • <30% @ 59.5 keV
  • <11% @ 511 keV
  • <7% above 1274.5 keV

This is the original description when I started the project in January 2024

This is very much a work in progress and most of the requirements are not satisfied yet. But thanks to excellent documentation done by NuclearPhoenix on the All-In-One Gamma-Ray Spectrometer and the Cosmic Pi project I have a proof of concept working.

Pomelo hardware and gamma spectra taken with Cs137 and Na22

Current version of the hardware includes:

  • 4mm x 4mm x 10mm GAGG(Ce) scintillator crystal with light reflector and 3D printed “dark” box
  • 4mm x 4mm Broadcom AFBR-S4N44P014M Silicon photomultiplier (SiPM) with optical grease coupling to scintillator
  • MAX1932 SiPM bias supply
  • Shaper to decrease bandwidth of SiPM pulses
  • Peak detector circuit
  • ATSAML21E18B MCU that performs triggering, pulse height measurement, and peak detector reset

Energy resolution is 14.3% @ 662 keV and 12.4% @ 1274.5 keV.


  • Pomelo Core use cases

    mihai.cuciuc06/01/2024 at 09:44 0 comments

    I updated the project description to include use cases for the Pomelo. One is a complete hand-held instrument with battery, user interface, and lots of connectivity, and others are physics experiments that are enabled by the Pomelo:

  • Pomelo Core v1

    mihai.cuciuc05/23/2024 at 04:54 0 comments

    This contains all the functionality to do gamma spectroscopy and nothing more

    I'm planning on producing something that looks more similar to other gamma detectors, like the excellent products that are already out there: the Radiacode, the Kromek Sigma25, or the CapeScint CsI-MacroPixel-MCA. To shift towards that I merged the digital and analog electronics into a single PCB, removing the battery and charging circuit, as these are not core to the functionality of the detector. The detector now consists of two parts:

    Pomelo Physics:

    • CsI(Tl) scintillator, 3cm^3
    • Silicon photomultiplier
    • 3D printed dark box to house scintillator and keep stray light away from SiPM
    • Temperature sensor

    Pomelo Core:

    • Digitally controlled SiPM bias supply ~32V - ~48V
    • Low power analog front-end
    • Microchip SAML21 (ARM Cortex-M0+) microcontroller
    • USB connectivity
    • UART connectivity with integrated level shifter

    Pomelo Physics. Scintillator and SiPM detachable module

    Back of Pomelo Core PCB

  • Scintillator potting

    mihai.cuciuc05/13/2024 at 04:48 0 comments

    CsI(Tl) scintillators are slightly hygroscopic – they absorb some moisture and this affects their crystal structure, worsening their performances. However, the magnitude of this worsening is very small as shown by this paper and this paper.

    In any case, my plan is to limit the amount of moisture that can reach the scintillator by adding silicone in between the Teflon-wrapped scintillator and the 3D printed detector case that serves as a dark box. Using a somewhat rubbery silicone will also work to provide some cozy mechanical support for the scintillator. The resulting internal structure of the detector assembly should look like the following diagram:

    Detector assembly structure. The scintillator is attached to the SiPM (not shown) that is soldered to the PCB. I plan on filling the gap between scintillator and dark box with silicone

    Room-temperature vulcanizing silicone curing test

    As I’m using a one-component RTV silicone I wanted to make sure that curing still happens inside the 3D printed box, as the exposure to outside air is quite limited in that case. To test this I printed a fake “scintillator” block that I wrapped in Teflon and I made a few test runs that I could then break and look inside for how the curing went.

    Test pieces for testing potting and curing. No expensive components (SiPM or CsI(Tl) crystals) were hurt in these tests

    Loading some silicone into the dark box and then squishing the assembly in

    Having assembled these units I let them cure for ~1 week. I then broke a few and extracted the plastic fake “scintillator” and its Teflon wrapping to find this very nicely cured shell around the scintillator block.

    Broken test assembly. The silicone cured nicely everywhere, but I did not manage to get it completely centred

    One thing I did not consider is that the fake "scintillator" I 3D printed with ~30% infill was full of air. While it was covered in Teflon, I'm not sure this was an air-tight barrier, so some of the curing might have happened because of that empty space. In any case I assume that it will still cure just through the shell, even if it will take longer.

    With this test successful I went on to pot an actual scintillator and see how this affects its performance.

    Detector performance after curing

    I potted a real detector and took Na-22 spectra before and afterwards to obtain the following spectra.

    Na-22 spectrum and resolution for the 511 keV gamma line before silicone potting (red) and after potting (blue)

    The peaks are shifted a little to the left after potting, so the pulse height is somewhat lower, suggesting that light collection is not as good as before potting. This is also indicated by the slight worsening of the energy resolution. While there is some loss in light that gets collected on the SiPM, the added resilience of the detector assembly is worth it.

  • Digital temperature compensation

    mihai.cuciuc05/09/2024 at 05:13 0 comments

    The gain of silicon photomultipliers (SiPMs) increases with applied voltage and decreases with temperature. Hamamatsu has an informative write-up on this topic.

    This presents an opportunity to compensate for temperature changes by tuning the bias voltage, with some circuits doing this directly in hardware, by having a thermistor in the voltage feedback loop of the bias supply. An example of this is in Figure 8 in the MAX1932 datasheet.

    I decided to go with a digital temperature sensor and tweak the bias voltage in firmware. The temperature sensor is placed directly underneath the SiPM on the detector PCB to get a reading as close as possible to the sensor.

    A TMP126 chip in the middle of the detector PCB provides very accurate temperature readings. The SiPM is directly underneath it, on the other side of the PCB.

    I ran a few tests to see how temperature and bias voltage influence the spectra from a Na-22 source, with the following animated results.

    Increasing temperature of the SiPM decreases its gain, so the gamma peaks shift to lower values in the spectrum. This can really mess up the long-term stability of the detector and make gamma peaks disappear into blobs. Temperature is in degrees Celsius.

    Higher bias voltage increases the SiPM gain.

    From this data I derived a voltage compensation coefficient and managed to keep the gain fairly stable, with a loop that runs every 5 seconds and updates the bias voltage. While it’s not great, it’s much better than without it.

    Relative gain shift with fixed bias voltage (orange) and with a varying bias voltage calculated from the temperature value.

    The difference that this makes is in keeping an overall better energy resolution for the system at varying temperatures.

    Left plot has data taken between 29 and 40 degrees Celsius, without temperature compensation loop running. Plot on the right is taken between 24 and 40 degrees Celsius, but with the temperature compensation enabled and results in a better energy resolution.

  • ADC calibration

    mihai.cuciuc04/30/2024 at 05:15 0 comments

    Plot on the left shows Na-22 source spectrum without ADC calibration applied, with a zoom on on the 1274 keV peak. Plot on the right has ADC calibration applied.

    Missing codes

    The 12-bit ADC in the SAML21 is great for most jobs. It can read voltages from tons of sources, has on-chip voltage references that it can use, and is reasonably accurate. But the ADC is quite stubborn in skipping some codes quite a lot. To test this, I generated some voltages with the DAC and took 100 measurements of them with the ADC. Most measurements look like the plot on the left in the following figure, with the measurements spread nicely around a center value. But in the middle of the ADC range is the worst culprit, with its plot on the right.

    On the left is a histogram of some fixed voltage measurement with the ADC with a nice reasonable spread. On the right is a histogram of another fixed voltage, this time in the middle of the 12 bit ADC range. Four consecutive ADC codes are missing.

    Mapping out the ADC response

    With much higher statistics you do get some counts in those codes eventually. But it’s not just those 4 codes in the middle that are underrepresented. I wanted to get a map of all underrepresented codes, but I did not trust that the DAC is perfect and didn’t want to mix the two imperfections. I decided to use a very slow ramp generator to swing across the ADC range while taking as many readings as possible. That should ideally produce a flat histogram. I also wanted my ramp generator to be simple enough to integrate on the PCB as part of a “self calibration” tool. I ended up with a very simple op-amp integrator.

    Ramp generator for checking the ADC underrepresented codes. It can be completely disabled from the MCU to save power.

    Taking a LOT of ADC data using the ramp generator produces the following histogram which shows the underrepresented bins. As I’m truncating my readings to 10 bits, now the troublesome middle of the ADC range is at bin 512.

    Histogram of the ramp generator readings showing periodic underrepresented codes in the ADC.

    Correcting for missing codes

    This structure gets imprinted on the gamma spectra I gather and make them look unpretty. Realistically it’s not a huge problem, as the detector resolution is low enough that these structures can safely be ignored. It’s still obvious where the gamma peaks are even if there’s a gap right in the middle of one, as can be seen in the first plot at the beginning of this log. But I still want it fixed.

    My first thought was to run some smoothing on the spectrum, with a moving average window. That did not work great as the dips were still visible, and it also started worsening the energy resolution of the measured peaks. Not cool.

    Then I tried multiplying the gamma spectrum with the inverse of the calibration histogram. This did make the spectrum look pretty, but I did not like the thought of presenting an altered version of the histogram that the one I store in memory. Plus, since it involved integer division you could present a histogram that has a different integral than the total number of pulses you measured. Also not cool.

    I wanted a solution that would work on an event-by-event basis -- whenever I have a measurement, place it in an appropriate bin such that the end result is a pretty histogram.

    Calibrating the ADC - donor and acceptor bins

    Whenever I get a gamma reading from the ADC I want to be able to quickly decide if I should place it in its corresponding histogram bin, or to give it away to one of the neighbouring bins to smooth out the resulting spectrum. Physics-wise this is not such a big deal -- each bin is ~2.5 keV, whereas the detector resolution is ~60 keV. So “misplacing” a reading a few bins left or right is ok.

    For the rest of this section let's assume I just got a gamma ray measurement, and the ADC reading is 509.

    I look in the calibration histogram at 9 bins centered on the one corresponding to the measurement, shown in the following plot.

    A slice of...

    看更多 »

  • Analog PCB update with new bias supply

    mihai.cuciuc04/27/2024 at 08:13 0 comments

    Assembled Pomelo (top), as well as its components: detector (bottom), analog board (left), and digital board (right)

    I integrated the new SiPM bias supply into the analog board. With this new version (v3) together with the 3cm^3 CsI(Tl) scintillator the results are pretty good:

    • 2.6mA @ 3.3V in background conditions
    • 4.3mA @ 3.3V with a 44 kBq Na-22 source on the detector
    • <10% energy resolution @ 662 keV

    The old version (v2) of the board with the same detector had the following:

    • 6.3mA @ 3.3V in background conditions
    • 7.6mA @ 3.3V with a 44 kBq Na-22 source on the detector
    • <10% energy resolution @ 662 keV

    Cs-137 and Na-22 spectra taken with the v3 board and 3cm^3 CsI(Tl) scintillator. Threshold was set very high, but it can be set below 60 keV

    This updated PCB implements the new low power bias power supply and adds a ramp generator for calibrating the ADC. More details on ADC calibration in a following log.

  • Lower power SiPM bias supply

    mihai.cuciuc04/21/2024 at 09:59 0 comments

    Two PCBs to test different SiPM bias supplies. Left one is MAX1932 board, right one is a lower power version -- but it is a little worse and not as plug-and-play. This log entry describes its design and performances.

    The MAX1932 is an excellent chip for biasing SiPMs, but I couldn’t get it to be low power enough for my application. It draws 4.35 mA from the 3.3V line while generating 41V for the SiPM. When switched off, it still draws 0.45 mA. As I’m targeting very low power consumption, I need better, even if I do end up paying with lower performance and increased circuit complexity. I designed a two-stage supply – a boost converter that generates some high voltage with very loose requirements on regulation, followed by a linear regulator that supplies the exact bias voltage needed by the SiPM.

    Stage 1 – Boost converter

    I was amazed by the performance of the Compact, low-power Geiger counter developed by BleakyTexwith an incredible attention to detail. He is using a custom boost converter to get to ~100V, and then a voltage multiplier to get to the ~400V that his Geiger tube uses. I decided to shamelessly steal his boost converter design, without the voltage multiplier. As I use a linear regulator afterwards, I don’t really care what the output voltage of the boost converter is. It's ok as long as it’s higher than the highest voltage I’ll need, and lower than what would fry the linear regulator. These loose requirements really help lowering the average power draw, as I can let the boost converter run to ~60V and switch it off until the input to the linear regulator drops below ~50V.

    I don’t trust my math skills to do a similar analysis to the one BleakyTex did, but I did run a toy simulation in PSpice for TI.

    PSPpice for TI simulation schematic for the boost converter. Red probe measures input current, green probe measures the output voltage. R2 is a load to draw ~35 uA, to account for LDO, feedback networks, and SiPM.

    In the simulation R6 and C4 form a filter such that I can measure the average current being drawn by the converter. Transistor Q1 does the switching at 33 kHz. To simulate what happens when the converter is running or stopped, Q2 sometimes pulls the base of Q1 to GND, thus stopping the converter.. This happens for 200 ms every 700 ms. L2, R9 and C5 smooth the output. The simulation results are in the following plot.

    Top green plot is output voltage, steadily increasing over 5 seconds to ~70V. Bottom red plot is current drawn from the 3.3V supply, settling below 1.5 mA when the boost converter is running.

    This voltage is fed to a linear regulator to supply the SiPM bias voltage.

    Stage 2 – Linear regulator

    I chose the LT3014B LDO as it can take up to 80V on its input and draws less than 10 uA. Its output can go as high as 60V which is great because the Broadcom SiPMs I use need somewhere between 32V and 48V. The only problem is that I want to tune the bias voltage on the SiPM from software, and this LDO’s output is fixed by a resistive divider:

    However, if I give the ADJ pin a little nudge with a DAC I can make the feedback loop settle at a different Vout:

    This circuit has Vout = Iadj*R2 + 1.22V*R2/R1 – (Vdac -1.22V)*R2/Rdac. Choosing R1 = 180k, R2 = 5.6M, Rdac = 750k I get:

    • Vout = 48V for Vdac = 0V
    • Vout = 33.4V for Vdac = 2V

    Putting it together

    To make the boost converter run I use a 32 kHz output from the MCU, as it runs off an oscillator that has to run all the time anyway for timekeeping. This signal is gated by a comparator that keeps the output voltage within some reasonable limits. Using a single comparator with hysteresis keeps the part count as low as possible. The power supply design ends up looking like this:

    Low power SiPM bias supply. The boost converter requires a 32 kHz square wave input and keeps its output swinging around 50 - 60V. The linear regulator's output voltage can be adjusted by a voltage input at the Vdac node.

    The TLV7031 is a very low power comparator. Resistor R11 implements hysteresis to allow the input...

    看更多 »

  • Analog board

    mihai.cuciuc04/17/2024 at 05:23 0 comments

    I integrated the analog front-end and the MAX1932 power supply into one single plug-in analog board that the detector can then be plugged into. I used this together with the 10mm x 10mm x 30mm CsI(Tl) crystal to form a system with the following performances:

    • Energy resolution @ 662 keV: less than 9.5%
    • Current draw @ 12CPS: 6.5mA
    • Current draw @ 2300CPS: 7.7mA

    Analog front-end

    This is the circuit simulated in the Analog Front End log entry. It has two RC stages, a fast decompensated op-amp with low current requirements, another RC stage, and then it goes to the peak detector. The first op-amp of the peak detector is an OPA357 that draws quite a lot of current. The second one, a voltage follower, is a low power part, as it can take all the time in the world until the ADC is ready to digitize the signal. To save power, the peak detector op-amps are only enabled when there’s a signal to be measured, thus saving a lot of power. The OPA357 needs to respond very quickly to an incoming enable signal, and the datasheet provides a turn-on time of 100ns. PSpice for TI simulations showed that there are several hundred ns available.


    The threshold for measurement is set by the MCU through its DAC, setting the minimum pulse amplitude to trigger a measurement. A fast, low-power comparator (TLV3201) supplies this trigger signal that gets sent to the peak detector op-amps enable pins to switch them on, and also to the MCU to wake it up and start a measurement. To keep the peak detector active for as long as needed by the MCU, the trigger signal goes through an S/R latch that is only reset by software. As the low-power S/R latch used (MC14043) quotes propagation delays as long as 350ns at 5V, there is a fast bypass for this signal with a diode-OR between the latch output and the incoming trigger signal.

    Validating the simulations

    The board has multiple analog test points that make it easy to trace the functionality of the device and check against PSpice for TI simulations, with an example in the figure below.

    Ch1: SiPM output
    Ch2: Shaper output. It is sent directly to trigger comparator. It goes through another RC filter before being sent to the peak detector
    Ch3: Trigger comparator output
    Ch4: Peak detector enable. This is diode-ORed between trigger comparator output and the output of an S/R latch that is set by the trigger comparator. This ensures fast propagation of the signal to enable the peak detector (S/R latch propagation delay is several hundred ns) and also that the peak detector won’t switch off unless told so by software
    Ch5: Peak detector output. This signal goes to ADC
    Ch6: Peak detector reset. This signal clears the peak detector capacitor. While it’s set the peak detector is also disabled through the S/R latch.

    The entire measurement takes ~85us, but I tracked some of the time spent in the interrupt handler mechanism which has to check every external interrupt line. I could hack a way around this to bring the measurement to ~45us.

  • CsI(Tl) scintillator, 3cm^3

    mihai.cuciuc04/16/2024 at 04:34 0 comments

    CsI(Tl) is a commonly used scintillator with good energy resolution because it has a very large light yield, around 54 photons per keV. It is slightly hygroscopic but not enough to cause serious concern for testing. I have 10mm x 10mm x 30mm CsI(Tl) crystals that I wrapped in Teflon and used clear 3M VHB tape for coupling them to the SiPMs. A black 3D printed housing for the crystal acts both as mechanical protection but also as a light shield.

    Directly underneath the SiPM on the PCB there is a high accuracy SPI temperature sensor (TMP126). The SiPM gain depends on temperature and can be compensated for by adjusting the bias voltage. However, this functionality is not implemented in firmware yet.

  • Digital board

    mihai.cuciuc02/20/2024 at 05:58 0 comments

    For the digital section I went with the Atm… erm, Microchip ATSAML21E18B as I already had a previous project centered around it. It’s capable of low power operation and is packed with both analog and digital peripherals that make it quite versatile. It’s got USB and I adapted this UF2 bootloader to run on my board which makes development a lot easier.


    • Most of the pins broken out to headers
    • On-board Li-Ion battery charger - Microchip MCP73832. It can be disabled for use with non-rechargeable batteries
    • Power jumper. Can be used to measure current on the 3V3 line
    • Type-C port with TVS diode protection
    • User LED and button
    • Reset button & circuitry
    • Header close to MCU for pins connected to the internal opamps


View all 14 project logs

Enjoy this project?



Dan Maloney 撰寫 06/04/2024 at 23:39 point

Fantastic project, love the lesson in scintillation counting. Wrote this up for the blog, should publish soon. Great work!

  您確定嗎? |

peter jansen 撰寫 04/17/2024 at 05:01 point

Super interesting!  How small do you think you could ultimately make the sensor and accompanying electronics?  

  您確定嗎? |

mihai.cuciuc 撰寫 04/17/2024 at 05:04 point

Thanks! I'm aiming to fit everything on a 5cm x 10cm PCB, with the height given by the detector laid on its side, so about 2.5cm.

  您確定嗎? |

peter jansen 撰寫 04/17/2024 at 23:34 point

Since the Radiation Watch Type 5 has been retired, I was hoping you'd say something along it's size so that it could be a close mechanical replacement :) ( https://www.sparkfun.com/products/retired/14209 ).  I've tried to get it to do similar things to what you're doing, by measuring pulse width instead of height/AOC (only a correlate of energy) -- it'd be wonderful to have a proper solution in a small form factor to put on hand-held devices!

  您確定嗎? |

mihai.cuciuc 撰寫 04/18/2024 at 05:39 point

Oooh, I see -- the Radiation Watch Type 5 was indeed pretty cool -- I'll think about what could be done in similar size constraints.

Meanwhile, I suggest you take a look at the Semeatech Mini Gamma Sensor ( https://semeatech.com/Products/Radiation%20Detection/Mini%20Gamma%20Sensor.html ). It's super small, draws very little power, and has decent performance above 300 keV. I played around with them a little so let me know if you want some spectra.

  您確定嗎? |

Mitchell de Vries 撰寫 02/14/2024 at 22:46 point

Those spectra are looking nice and clean, you're inspiring me to restart my radiation detecting projects! Did you have much issue sourcing suitable calibration sources? Also, I'm guessing you'll be implementing calibration?

  您確定嗎? |

mihai.cuciuc 撰寫 02/15/2024 at 06:14 point

Thanks! I'm glad to hear my toying around is inspiring!

I have a gamma spectroscopy lab at work, so we have quite a few radioactive sources I could use for calibration. Yup, right now I do energy calibration offline, and it's pretty linear, with a very small quadratic term that is fairly common with SiPMs. The plan is to store calibration constants on the device.

But I also had good success calibrating it without lab sources, using commercial Th-232 welding rods (WTh20), a smoke detector Am-241 source (but they don't sell those in the EU any more), and K-40 from salt substitute. This last one requires some patience though :)

  您確定嗎? |

Muth 撰寫 01/18/2024 at 15:01 point

This is highly interesting ! May I ask if you have advises to source scintillators and SiPM ?

Thanks !

  您確定嗎? |

mihai.cuciuc 撰寫 01/19/2024 at 06:02 point


Sure, I got the SiPM from Farnell: https://ro.farnell.com/broadcom/afbr-s4n44p014m/silicon-photomultiplier-1-ch-420nm/dp/4236230

I chose them because they're fairly inexpensive and seem to be quite new (i.e. not going to be EoL soon).

As for the scintillators, I have them from OST-Photonics: https://www.ost-photonics.com/product-category/scintillation-crystal-2/

  您確定嗎? |

Muth 撰寫 01/23/2024 at 15:38 point

Thanks you very much !

  您確定嗎? |

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates