Projects Research & Design Hub

Searching for Gold with X-Rays

Written by George R. Steber

Using a Common PIN Photodiode

A low-cost XRF analyzer can detect gold and other materials using Pin Photodiode. A PIN diode detector for X-ray detections is easy to build and can capture XRF spectra from gold.

  • How to build a low-cost XRF analyzer?

  • How to detect gold using Pin Photodiode?

  • What is X-ray fluorescence?

  • What are the XRF analyzer components?

  • Why does a PIN diode work for X-rays?

  • How to build a PIN diode detector for X-rays?

  • How to use a PIN diode detector for XRF?

  • Vishay BPW34 PIN diode

  • Am241 radiation sources

  • Amptek MCA8000A multichannel analyzer

  • Si-PIN diode

  • SDD (Silicon Drift detector)

  • Peakaboo XRF

  • Behringer UMC202HD

There are many ways to determine the elemental composition of materials. One of the most advanced techniques uses X-ray fluorescence (XRF), a well-established, non-destructive analytical technique using XRF analyzers. Such analyzers determine the chemistry of a sample by measuring the fluorescent (or secondary) X-rays emitted from a sample when it is excited by a primary X-ray source. Each of the elements in a sample produces a set of characteristic fluorescent X-rays (a fingerprint) that is unique for that specific element. Hence, XRF spectroscopy is an excellent technology for qualitative and quantitative analysis of material composition. Because of the technology employed, XRF analyzers are expensive. In this article, I present a method of developing a unique, low-cost XRF analyzer for gold, silver, copper, solder, and other materials using a common PIN photodiode.


This project started innocently enough. A friend asked if there was a way to tell if her earring was 24k gold. This seemed like a simple question. But upon further thought, it was not easily answered. Surely there must be gold analyzers around that would do the job. A quick search on the Web produced many results, the most interesting of which was only $12,758 from AliExpress! Its high cost indicated that it was probably intended for the most experienced goldsmiths or jewelers.

There are also low-cost gold testers. They require filing off a bit of the sample, etching with acid, or doing some kind of resistance test. Some even use specific gravity tests. While these devices may be accurate, the destructive aspect is not desirable.

Later, I learned that many other industrial devices using X-ray fluorescence (XRF) are available from companies such as Thermo Fisher and Amptek for analyzing a variety of metals and other materials. These offerings include some nicely designed bench-top and hand-held units. Some “used” units were in the thousand dollar range, but others were upwards of $20,000 and way beyond the budget.

My curiosity had now peaked about this subject. What was the technology behind these XRF analyzers, and what made them so expensive? These questions began a long path that involved learning about X-ray fluorescence, and X-ray detectors, examining current technology, reading many research papers, and finally designing a unique XRF unit using a PIN photodiode. This culminated with many experiments on a golden earring and many other materials.


When materials are exposed to short-wavelength X-rays, their component atoms may become ionized. Ionization consists of the ejection of one or more electrons from the atom and may occur if the atom is exposed to radiation with an energy greater than its ionization energy. Incident X-rays can be energetic enough to expel tightly held electrons from the inner orbitals of the atom (Figure 1).

Figure 1  Incident X-ray causing fluorescence of an atom
Figure 1
Incident X-ray causing fluorescence of an atom

Removal of an electron in this way makes the electronic structure of the atom unstable, and electrons in higher orbitals “fall” into the lower orbital to fill the hole left behind. In falling, energy is released in the form of a photon, the energy of which is equal to the energy difference between the two orbitals involved. Thus, the material emits radiation, which has energy characteristic of the atoms present. The term “fluorescence” is used when the absorption of radiation of a specific energy results in the re-emission of radiation of different energy (generally lower).

Each element has electronic orbitals of characteristic energy. As shown in Figure 1, following the removal of an inner electron by an energetic photon provided by a primary radiation source, an electron from an outer shell drops into its place. This can happen in a limited number of ways.

The main transitions are given names: a LàK transition is traditionally called Kα, a MàK transition is called Kβ, a MàL transition is called Lα, and so on. Each of these transitions yields a fluorescent photon with characteristic energy equal to the difference in energy of the initial and final orbital.

The amount of kinetic energy gained by electrons accelerating from rest through an electric potential difference is measured as “electronvolts” (eV). For example, if an X-ray of sufficient energy, say 16keV, hits a copper (Cu) atom and ejects a K shell electron, it may release a photon of 8.04778keV. This would be called a Kα1 transition, This photon energy is unique to Cu and can be detected.

Usually, fluorescent radiation is analyzed either by sorting the energies of the photons (energy-dispersive analysis, EDX) or by separating the wavelengths of the radiation (wavelength-dispersive analysis, WDX). Once sorted, the intensity of each characteristic radiation is directly related to the amount of each element in the material. EDX instruments have superior energy resolution and require no dispersion system, which allows the instrument to be smaller in size. They are the type discussed here.


The main components of an XRF system are shown in Figure 2. The primary X-ray source is positioned to irradiate the sample with appropriate X-ray energies. The resulting fluorescent X-rays are detected, and the signals are amplified and analyzed with a pulse height analyzer.

Three types of output can be generated by XRF instruments: an X-ray spectrum, a list of spectrum peak areas, and relative concentrations calculated via calibration data.

The raw output is displayed as a spectrum, with each peak uniquely representing a particular chemical element (Figure 3). Each peak is identified with the originating element by using software installed on the instrument or computer. In this spectrum, we can see the peaks for several elements, including strontium (Sr), an alkaline earth metal, and lead (Pb), both of which are found in rare earth ore. Sr has energies of Kα1= 14.165keV and Kβ1= 15.835keV. The height of the peaks indicates the abundance of the element.

Figure 2 Typical arrangement of an EDX XRF system
Figure 2
Typical arrangement of an EDX XRF system
Figure 3 Example of an energy spectrum from a EDX XRF system
Figure 3
Example of an energy spectrum from a EDX XRF system

I put together an X-ray detector for XRF from parts that were on hand from previous work with gamma-ray spectrometry experiments (Figure 4). The main parts are a CsI(Tl) scintillator crystal to detect radiation and a photo-multiplier tube to amplify the light pulses. The X-ray excitation consisted of four Americium (Am241) sources (from a smoke detector) arranged radially on a lead sheet around the opening of the CsI crystal. Am241 is a well-known low-level X-ray emitter and should work well in this application instead of an X-ray tube. An Amptek MCA8000A multi-channel analyzer received the pulses from the PMT, and the spectrum was displayed on a PC using Amptek software. The sample was placed in front of the setup where the Am241 X-ray source would hit it and generate fluorescent X-rays, which were picked up by the CsI scintillator.

Figure 4 The first version of my XRF system used a CsI crystal and PMT as a detector.
Figure 4
The first version of my XRF system used a CsI crystal and PMT as a detector.

Amazingly, this arrangement worked the first time. But the results were disappointing. First, there was enormous back scatter in the setup, which required the use of background removal in software. Second, the resolution was poor. Still, a coarse spectrum from a silver coin at around 23keV was obtained in a few minutes, and it matched the theory. But the actual spectrum peaks at 22keV and 24keV were smudged together, not nearly as sharp as the ones in Figure 3. Anything below 15keV was almost unusable.

Upon closer examination, the main problem was found in the X-ray detector. A scintillator like CsI cannot provide sharp Gaussian peaks in the spectrum. This was confirmed when an X-ray spectrum was obtained from a sample of Am241 placed in front of the scintillator, and none of the characteristic peaks of the X-rays emitted were distinguished. When a golden earring was used as the sample, the peaks from Cu, Zn, and Au, around 8-10keV, were all smudged together. Yes, there was a response, but it was not satisfying.


Industrial XRF analyzers use a wide variety of detectors. They include Si-PIN diode, silicon drift detector (SDD), Si-Li special silicon diode, CdTe, and HPGe (high purity germanium). Even proportional counters and gas-filled detectors (Ne, Ar, Xe) are sometimes used. The most accurate is the HPGe detector found in research labs, but it requires LN2 cooling and is not common. A comprehensive discussion of X-ray detectors is given in Amptek’s excellent review paper on XRF Instrumentation [1].

Many industrial systems use a Si-PIN diode or SDD. A typical SDD has better performance over a PIN—better ultimate energy resolution, and they can count more X-rays in a given time; however, a PIN detector has the major advantage of being less expensive and is a good fit in XRF systems.

There has been much research on PIN diodes. A project by Cremat, Inc. used a Hamamatsu model S1223 photodiode and a low noise charge amplifier to detect X-rays from an Am241 source [2]. However, the five known peaks in the Am241 spectrum were not clearly resolved, except the one at 60keV.

I built several X-ray detectors using a BPW34 PIN photodiode and some low noise, op-amp circuits, but the results were no better than the one from an Am241 source [2]. The noise was the limiting factor. Commercial units were cooled to -30°C to get better noise performance. Was that the problem?

F. J. Ramírez reported using an OPF420 PIN diode to measure X-rays [3]. The resulting spectrum of Am241 was very good, with clearly distinguishable peaks. He concluded that a PIN diode can be used at room temperature with good performance for X-ray spectroscopy because its leakage current is small. But it requires a low input capacitance and low noise preamplifier as a read-out circuit. His circuit had an interesting variation—he used a novel, forward-biased FET charge amplifier (FBFA) to get minimum noise with the PIN diode. A simplified circuit illustrating the concept is shown in Figure 5.

Figure 5 Basic idea of charge preamp with input FET and forward-biased gate
Figure 5
Basic idea of charge preamp with input FET and forward-biased gate

Normally a charge amplifier has a large resistor in the feedback loop, which controls the gain. But here, the FBFA configuration without a feedback resistor had a well-defined operating point and continuously discharging feedback capacitor Cf. This capacitor was discharged through the input field-effect transistor biased with the gate in forward mode. Because of this, a tiny feedback capacitor could be used, which gave tremendous gain. Ramírez used a 0.045pF capacitor.

It turns out that Ramírez’s circuit was based on one by Giuseppe Bertuccio and originally disclosed by US patent in 1994 [4]. It is described as a novel, charge-sensitive preamplifier (CSP), which has no resistor in parallel with the feedback capacitor. No resetting circuit is required to discharge the feedback capacitor.

I began experiments using variations of the Bertuccio circuit and obtained promising results. More will be said about this circuit later on. But first, why does a PIN diode work for X-rays?


As previously noted, SDD, Si-PIN, and Si-Li detectors are often used for X-ray analysis, with Si-Li giving the best resolution—typically 180eV over the energy range 1-100keV. But Si-PIN diodes have nice advantages with respect to size and cost and are often used in industrial analyzers. As shown in Figure 6, a PIN diode (p-type, intrinsic, n-type diode) has a wide region of intrinsic semiconductor material (undoped) contained between a p-type semiconductor and an n-type semiconductor.
The main advantage of a PIN diode is that the depletion region exists almost completely within the intrinsic region, which has a nearly constant width regardless of disturbances applied to the diode. The intrinsic region can be made as large as desired, by increasing the area in which the pair of p-n gaps are constructed.

Figure 6 General layout and operation of a PIN photodiode
Figure 6
General layout and operation of a PIN photodiode

Generation of charge carriers within the intrinsic region is due to incident radiation, E. Carriers are produced in PIN photodiodes from light as well as by charged particles, gamma radiation, cosmic rays, or X radiation.

As an ionizing particle enters the sensitive window area of the photodiode, it produces in its passage many electron-hole pairs, which are collected by the cathode-anode of the diode and produce the photocurrent signal that is subsequently captured.

The number N of electron-hole pairs generated is related to the incident energy E as:

N=E/w, where w is the energy needed to create an electron-hole pair. For silicon diodes, w = 3.6eV. For example, if E = 10keV, it will produce 2,777 electrons. The total charge Q generated in the detector by the interaction is: Q=Ne, where e is the electron charge. Hence we have Q=eE/w.

An important conclusion from this discussion is that the generated charge in the detector is directly proportional to the energy of the radiation. Because the signal generated in the detector is small, the noise of the measuring system has to be considered with great care. The total noise in the measuring system is reflected in the value of resolution measured in the energy spectrum obtained in a multichannel analyzer. So, the interaction of the particle in the sensitive area of the photodiode depends mainly on the particle energy. But the maximum value of the energy that one particle can deposit in the detector is limited by the thickness of the active zone. PIN diodes such as the OPF420 or BPW34 have about 300μm of active thickness.

The efficiency of PIN diodes is adequate for measurements of X-rays in the range of 1-100keV (Figure 7) for a PIN diode 300μm thick. Note that efficiency drops off rapidly at 10keV, and is below 5% at 60keV. Hence, to get a true picture of the energy intensity, energy compensation is often used in XRF software.

Figure 7 Efficiency of a PIN photodiode with 300µm thickness
Figure 7
Efficiency of a PIN photodiode with 300µm thickness

This trek was finally coming to an end. The FBFA circuit described earlier held the most promise of making a room-temperature XRF analyzer. But building this XRF device was not easy. The unit I finally built using copper shielding is shown in (Figure 8). It consisted of a rectangular box made out of double-sided copper PCB, which housed a smaller, light-tight plastic box for the circuit. (Note that the PIN photodiode must be protected from light as well as electrical noise.) There was a small compartment inside for the radiation source and for testing small objects. Low-noise power supplies were used, along with surge and noise suppressors.

A solderless breadboard was used for the circuit, which permitted quick changing of parts. During construction, great attention was paid to component spacing, particularly the input FET and PIN diode, which were isolated from the main circuit elements.

It’s important to reverse bias of the PIN diode to reduce its capacitance. Voltages in the 50V to 65V range will yield lower values and reduce the noise. After many trials, the circuit in Figure 9 worked. It includes pulse shaping to improve the signal-to-noise ratio. The output pulse was fed to an MCA connected to a laptop.

A critical part is the feedback capacitor Cf. It needs to be on the order of 0.1pF. This is a very small capacitor, indeed! I made it by using a tiny piece of two-sided copper PCB with wires soldered on opposite sides. The PCB was milled away to reduce the capacitance, and then periodically measured with a DE-5000 LCR meter at 100kHz. It was a long, painstaking process.

A Vishay BPW34 PIN diode and the Am241 radiation sources used in the project are shown in Figure 10. The photo shows an early version with the diode in the opening in the center, surrounded by radiation sources.

Figure 8 XRF enclosure on the work bench with one cover removed
Figure 8
XRF enclosure on the work bench with one cover removed
Figure 9 XRF circuit using a PIN photodiode such as the BPW34
Figure 9
XRF circuit using a PIN photodiode such as the BPW34
Figure 9 XRF circuit using a PIN photodiode such as the BPW34
Figure 9
XRF circuit using a PIN photodiode such as the BPW34

I ran into some problems during the construction. The input 2N4416 FET failed in an unusual way. Although it still operated, its noise level increased dramatically. This problem was only found when a substitute was used. Also, one of the BPW34 photodiodes failed and became very noisy. It was being run above the specified maximum reverse voltage. The replacement has been working for weeks, though, without problems. Because of these issues, screening parts for the lowest noise became a necessary chore.


Up to this point, an Amptek MCA8000A multichannel analyzer had been used to collect data for the spectra. It was upgraded to use a USB port, rather than the RS232 serial port. Amptek provides free software for this unit. This MCA is accurate and works well, but the software is basic and does not have element identification or advanced data filtering.

Free sound-card MCAs such as Theremino and PRA offer more filtering options. Also, Peakaboo XRF is a free program for element identification with extensive data filtering. Using a sound-card MCA requires a high sampling rate—above the typical 48kHz sampling of most cards.

Fortunately, there is a USB unit, Behringer UMC202HD that can be run at 384kHz. Yes, this is well below the Amptek unit (Amptek rate is 100MHz) and adds some noise to the spectrum, but it allowed me to experiment with the above programs. I obtained many XRF spectra using all three MCAs. The accuracy of the sound-card MCAs was a pleasant surprise, but the noise was added to the Gaussian peaks, which had the unhelpful effect of widening them.

One of the very first spectra was from an Am241 X-ray source (Figure 11). It is an accurate spectrum, comparing favorably to any that I found on the Web. Note that, because of the low intensity of the X-ray source, however, it takes a long time to build up a spectrum—in this case 1,200 seconds. Resolution enhancement was used to clarify the peaks.

Figure 11  Am241 X-ray spectrum obtained by the X-ray detector
Figure 11
Am241 X-ray spectrum obtained by the X-ray detector

All the major peaks are visible. Only 110 counts are in the main peak at 13.9keV. The peak at 10.6keV is unknown and is probably due to material in the PIN diode. The peak at 59.6keV is low because the efficiency of the BPW34 is only a few percent at that energy (Figure 7).


The samples of gold obtained for XRF testing included my friend’s earring (which was the impetus for this project), some gold flakes from the Yukon, and gold plating on PCB fingers (Figure 12). Using the radiation source and detector shown in Figure 10, fluorescent photons were captured with the MCA and laptop.


Advertise Here

Figure 12 Gold samples used in the study: Gold earring (left), gold flakes, and PCB fingers
Figure 12
Gold samples used in the study: Gold earring (left), gold flakes, and PCB fingers

The earring produced the XRF spectrum shown in Figure 13. Gold jewelry is generally an alloy of gold mixed with copper and zinc. Gold with a purity of 24k is essentially 99% gold, whereas 14k gold is about 58% gold.

The gold earring’s XRF spectrum is amazing because the element peaks Cu, Zn, and Au could be seen with only a few counts in each channel of the MCA. The main Cu peak had only 34 counts. Since the count rate is only 1-2 photons per second, long-term stability is important.

There were two distinct peaks for Au. The first one at 9.71keV was from the Lα1 transition, and the second one at 11.44keV was the Lβ1. The gold percentage, taking into account the efficiency of the BPW34, is about 14k.

Resolution enhancement with filters can be used on the spectrum data to narrow the Gaussian peaks. This has been done here using an IIR algorithm in Theremino. The Theremino MCA also has a deconvolution algorithm to analyze elements. Peaks are more sharply delineated using this function. This is a very powerful function, but can often give wrong results if used improperly. In this case, the results were very good. An example with the gold earring is shown in Figure 14. Similar results were obtained with free Peakaboo software.

Figure 13 XRF spectrum of gold earring: Copper (Cu), zinc (Zn), and gold (Au) peaks are clearly visible
Figure 13
XRF spectrum of gold earring: Copper (Cu), zinc (Zn), and gold (Au) peaks are clearly visible
Figure 14 XRF spectrum of gold earring superimposed on normal spectrum using deconvolution. Copper (Cu), zinc (Zn), and gold (Au) peaks have very narrow widths.
Figure 14
XRF spectrum of gold earring superimposed on normal spectrum using deconvolution. Copper (Cu), zinc (Zn), and gold (Au) peaks have very narrow widths.
Figure 15 XRF spectrum of US silver quarter showing silver (Ag) and Copper (Cu) peaks.
Figure 15
XRF spectrum of US silver quarter showing silver (Ag) and Copper (Cu) peaks.

The United States Mint made silver quarters from 1796 until 1964. An XRF spectrum for a Washington quarter (90% silver, 10% copper) is shown in Figure 15. The spectrum is well defined and shows both main peaks of silver, with about 34 fluorescent photons in the main peak. The first silver peak at 22.16keV was the Kα1 transition, and the second one at 24.94keV was from the Kβ1. There was also a peak for Cu, and an unidentified peak, probably from some back scatter.

Figure 16 Silver quarter and 60/40 solder samples used in the study.
Figure 16
Silver quarter and 60/40 solder samples used in the study.

Classic 60/40 electrical solder (Figure 16) is 60% tin (Sn) and 40% lead (Pb), shown in the spectrum in Figure 17. Because of the lower efficiency of the PIN above 10keV, the Sn peak is lower, making it look less abundant. It’s possible to correct the spectrum for the energy efficiency in software to obtain better abundance estimates. It took about 3,000 seconds to obtain the data, gathering only about 35 photon counts in the main peak.

Figure 17 XRF spectrum of 60/40 solder. The lead (Pb) peaks at 10.55keV (Lα1) and 12.61keV (Lβ1) and tin (Sn) peaks are visible. Not energy corrected.
Figure 17
XRF spectrum of 60/40 solder. The lead (Pb) peaks at 10.55keV (Lα1) and 12.61keV (Lβ1) and tin (Sn) peaks are visible. Not energy corrected.

More gold and gold-plated objects were tested (spectra not shown). The gold fingers on the PCB (Figure 12) had nicely visible peaks, like those for the gold earring. However, “gold plated” objects such as society pins did not have enough gold on the surface to generate a peak in the spectrum—or maybe gold was not present at all. Gold flakes from the Yukon (Figure 12) had nice peaks. Because they were 24k gold, no Cu was present. For fun, I tested a Pepto Bismol stomach reliever tablet, because its spectrum was reported to look like lead. Indeed, sharp peaks very similar to lead were found, probably because of bismuth in the tablet (spectrum not shown).


I achieved my goal of building a room-temperature PIN diode XRF analyzer for verifying gold. Although it was an arduous project, the results were satisfying and much better than expected.

I hope you enjoyed reading about it. The unit is capable of analyzing many other materials. But time is not boundless, and that was not my objective. In closing, I wish to thank Professor Lynne D. Reynolds for the gracious use of her 14k gold earring. She’s a real sweetheart, if there ever was one! 

[1] Amptek, Inc., “XRF Instrumentation – Introduction to spectrometer”
[2] Cremat Inc., “Femtojoule Detection”,
[3] F. J. Ramírez, “X-Ray Spectroscopy with PIN diodes,” September 2006,
[4] Giuseppe Bertuccio, US Patent 5,347,231


Keep up-to-date with our FREE Weekly Newsletter!

Don't miss out on upcoming issues of Circuit Cellar.

Note: We’ve made the Dec 2022 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

Would you like to write for Circuit Cellar? We are always accepting articles/posts from the technical community. Get in touch with us and let's discuss your ideas.

Sponsor this Article
Professor of Electrical Engineering and Computer Science at University of Wisconsin-Milwaukee | + posts

George R. Steber, Ph.D., is Emeritus Professor of Electrical Engineering and Computer Science at the University of Wisconsin-Milwaukee. He is now semi-retired, having worked over 35 years. George is a life member of ARRL and IEEE and is a professional engineer. He has also worked for NASA and the USAF.

George recently penned an article on the hidden story behind “The Discovery of Radio Waves” in the January/February 2019 issue of Nuts and Volts magazine. He also wrote a science-oriented article on “Dark Energy and the Expanding Universe” in the March/April 2019 issue of Nuts and Volts.

George still lectures occasionally on science and engineering topics at the University. He is currently involved in cosmic ray research and, is developing methods to study them on a global basis. When not dodging protons, pions and muons, he enjoys amateur radio, racquet sports, astronomy and jazz. You may reach him at with “Curve Tracer” in subject line and email mode set to text.

Supporting Companies

Upcoming Events

Copyright © KCK Media Corp.
All Rights Reserved

Copyright © 2024 KCK Media Corp.

Searching for Gold with X-Rays

by George R. Steber time to read: 16 min