Sciencemadness Discussion Board
Not logged in [Login ]
Go To Bottom

Printable Version  
Author: Subject: X-Ray Fluorescence Spectroscopy Using Affordable CCD/CMOS Detectors?
CRUSTY
Hazard to Others
***




Posts: 138
Registered: 5-6-2016
Location: Nearby
Member Is Offline

Mood: High-Order

[*] posted on 2-2-2023 at 06:51
X-Ray Fluorescence Spectroscopy Using Affordable CCD/CMOS Detectors?


I recently acquired a dental x-ray tube and built a power supply for it. The amplifier electronics required for photomultiplier tube and photodiode x-ray spectrometers are above my level of electronics experience so I sought another option to measure x-ray energy. I came across a paper that claims to do this using a very cheap CMOS image sensor. The paper is: Haro, M. S.; Bessia, F. A.; Pérez, M.; Blostein, J. J.; Balmaceda, D. F.; Berisso, M. G.; Lipovetzky, J. Soft X-Rays Spectroscopy with a Commercial CMOS Image Sensor at Room Temperature. Radiation Physics and Chemistry 2020, 167, 108354. DOI: 10.1016/j.radphyschem.2019.108354

I tried to reproduce their results using a CCD sensor from a webcam and got
some potentially interesting results. Disclaimer: DO NOT ATTEMPT WORK WITH X-RAYS OR HIGH VOLTAGE UNLESS YOU KNOW WHAT YOU'RE DOING! I have proper lead shielding, a Geiger counter, and a dosimeter badge, as well as lots of experience with X-ray equipment in a professional setting.

When x-rays strike a CCD sensor they produce bright spots. The charge imparted by each collision will typically spread out over a few pixels. Each cluster of energized pixels may have a different sum of values depending on the energy of the incident x-ray. We assume that the sum of these pixel values is proportional to the energy of the x-ray. By making a histogram of the sums of all x-ray spots over time, you can effectively make an x-ray energy spectrum given the right sensor.


A typical single frame during x-ray exposure


Histogram of spot energies after one minute of x-ray exposure

This spectrum closely resembles the energy spectrum of an x-ray tube with a tungsten target (like mine). I repeated this several times under different conditions and always got a bremsstrahlung-like curve with two peaks at lower energies. The log spectrum shows a straight slope on the right side of the curve which is also consistent with bremsstrahlung radiation. All three peaks stayed in exactly the same positions over all trials. Placing materials like copper foil between the tube and the sensor caused changes in peak shapes and intensities but no new peaks, so I suspect the weaker XRF lines (if present) are buried by the strong signal from the x-ray tube's target. This is all qualitative so I can't really be sure whether the spectral features are just a coincidence. I tried this with a cheaper CCD sensor but the low-energy end is too noisy to make out any features.

This could potentially be useful for low-cost elemental analysis if implemented properly. I don't know if anyone out there also has access to x-ray equipment but I'd really like to see if others can get similar results. If anyone is interested or looking to try this, I can post my python program I use to collect the data. I am going to try to buy the exact sensor used by Haro et. al to try to reproduce their results more directly. I'll post an update when I get the sensor or if I get any new results before then.

Other papers that use CMOS sensors for X-ray/gamma spectroscopy:
https://doi.org/10.1016/j.nimb.2011.09.007
https://doi.org/10.1109/NSSMIC.2009.5402242
https://doi.org/10.1063/1.5047934




"I've made a huge mistake"


Check out my YouTube channel ("spectrofreak") here: https://www.youtube.com/channel/UCnUlsCGK8d9UTjZA5DJ5a3A
View user's profile View All Posts By User
blogfast25
International Hazard
*****




Posts: 10562
Registered: 3-2-2008
Location: Neverland
Member Is Offline

Mood: No Mood

[*] posted on 2-2-2023 at 08:35


@CRUSTY:

Always good to see someone do something highly quantitative on SM! :):D




View user's profile View All Posts By User
Rainwater
National Hazard
****




Posts: 799
Registered: 22-12-2021
Member Is Offline

Mood: indisposition to activity

[*] posted on 2-2-2023 at 15:49


If you can get your hands on some old T12 light bulbs or an old cathoray tube tv,
you could improve detection by using
"back projection".
Should offer some protection to the camera as well.

What you want is the phosphorus compound coating the inside of the tube.
Its toxic but if your playing with xrays (jealous) you should be capable of staying safe.
I spent a few years at a recycling center that cleaning light bulbs for disposal,
They washed them in diluted sulfuric acid and sold it back to the bulb factory.




"You can't do that" - challenge accepted
View user's profile View All Posts By User
CRUSTY
Hazard to Others
***




Posts: 138
Registered: 5-6-2016
Location: Nearby
Member Is Offline

Mood: High-Order

[*] posted on 4-2-2023 at 11:43


What do you mean by "back projection"? This usually refers to the algorithm used to construct 2D slices in a CT scan. I have a few grams of CFL bulb phosphor on hand but I'm not sure I see how this would improve detection here.



"I've made a huge mistake"


Check out my YouTube channel ("spectrofreak") here: https://www.youtube.com/channel/UCnUlsCGK8d9UTjZA5DJ5a3A
View user's profile View All Posts By User
wg48temp9
National Hazard
****




Posts: 761
Registered: 30-12-2018
Location: not so United Kingdom
Member Is Offline


[*] posted on 5-2-2023 at 02:02


I was intrigued by the idea that a CCD sensor could detect x rays.

Here is the paper on the subject:
Attachment: haro2019.pdf (1.9MB)
This file has been downloaded 157 times

Apparently the sensor they used is available from Digikey for $30 (surface mount) but they have an evaluation board available but probably pushes the price to >$100.

However from the detection mechanism I think any silicon optical sensor will also work. I wonder if I can detect the x rays from an old color crt type TV using a simple silicon optical sensor.

PS: I thought of using one of the following sensors as I could cut the window off but could not find one that was cheap and readily available.

TO5photodiode.JPG - 14kB

Perhaps a small solar cell from a solar powered garden light would work, spray the front black to block light and expose the rear through the thin metal connects to the x rays. It would require seriously high gain amplification.

[Edited on 2/5/2023 by wg48temp9]




I am wg48 but not on my usual pc hence the temp handle.
Thank goodness for Fleming and the fungi.
Old codger' lives matters, wear a mask and help save them.
Be aware of demagoguery, keep your frontal lobes fully engaged.
I don't know who invented mRNA vaccines but they should get a fancy medal and I hope they made a shed load of money from it.
View user's profile View All Posts By User
CRUSTY
Hazard to Others
***




Posts: 138
Registered: 5-6-2016
Location: Nearby
Member Is Offline

Mood: High-Order

[*] posted on 6-2-2023 at 07:17


Quote: Originally posted by wg48temp9  

PS: I thought of using one of the following sensors as I could cut the window off but could not find one that was cheap and readily available.
[Edited on 2/5/2023 by wg48temp9]


If those are photodiodes, then yes you can. The BPW34 photodiode has been used for gamma ray counting when coupled with a transimpedance amplifier stage. One project used four of them in parallel to perform gamma spectroscopy, although the electronics for this are well beyond my understanding.




"I've made a huge mistake"


Check out my YouTube channel ("spectrofreak") here: https://www.youtube.com/channel/UCnUlsCGK8d9UTjZA5DJ5a3A
View user's profile View All Posts By User
wg48temp9
National Hazard
****




Posts: 761
Registered: 30-12-2018
Location: not so United Kingdom
Member Is Offline


[*] posted on 7-2-2023 at 12:03


Quote: Originally posted by CRUSTY  
Quote: Originally posted by wg48temp9  

PS: I thought of using one of the following sensors as I could cut the window off but could not find one that was cheap and readily available.
[Edited on 2/5/2023 by wg48temp9]


If those are photodiodes, then yes you can. The BPW34 photodiode has been used for gamma ray counting when coupled with a transimpedance amplifier stage. One project used four of them in parallel to perform gamma spectroscopy, although the electronics for this are well beyond my understanding.


The BPW34 is available from AliExpress about £6 for ten of them but I will have an almost a two month wait for them.

A circut using them as a gamma ray detecter is shown in https://www.electronics-lab.com/bpw34-gamma-ray-detector/

The circuit is:
gamdetector.JPG - 41kB
The front end uses just two high gain transistors with typical current gains of 270.

The BPW34 is encapsulated in plastic which I assume I will have to remove to detect soft X rays. The youtuber applied science shows how to decap ICs:
https://www.youtube.com/watch?v=mT1FStxAVz4&t=23s
With ten to try with hopefully I will get one to work after decapping.

Your test using a webcam CCD sensor: was it USB webcam and if you displayed single frames could you see the detection spots. What was the make and model?




I am wg48 but not on my usual pc hence the temp handle.
Thank goodness for Fleming and the fungi.
Old codger' lives matters, wear a mask and help save them.
Be aware of demagoguery, keep your frontal lobes fully engaged.
I don't know who invented mRNA vaccines but they should get a fancy medal and I hope they made a shed load of money from it.
View user's profile View All Posts By User
wg48temp9
National Hazard
****




Posts: 761
Registered: 30-12-2018
Location: not so United Kingdom
Member Is Offline


[*] posted on 8-2-2023 at 09:31


I was watching a youtube video about a DIY x ray generator.
See:https://www.youtube.com/watch?v=1gq6Mj49X_8

The youtubers made videos off the experiments. I noticed when the room lighting was low and when the camera faced the x ray beam there were white spots in the image which I assume is detection of x rays. The x rays were generated by about 50kV (my estimate) and apparently traveled thru the camera lens and filters before reaching the camera sensor to generate a sufficiently large signal to register as a white spot. I assume the x rays are hard and not the soft x rays that color crt would generate but it does give me an indication of how a web cam will work with the gain at max.

Below a snip from the video showing the white spots:
xray-spots.JPG - 20kB




I am wg48 but not on my usual pc hence the temp handle.
Thank goodness for Fleming and the fungi.
Old codger' lives matters, wear a mask and help save them.
Be aware of demagoguery, keep your frontal lobes fully engaged.
I don't know who invented mRNA vaccines but they should get a fancy medal and I hope they made a shed load of money from it.
View user's profile View All Posts By User
CRUSTY
Hazard to Others
***




Posts: 138
Registered: 5-6-2016
Location: Nearby
Member Is Offline

Mood: High-Order

[*] posted on 16-2-2023 at 08:13
Update 2


UPDATE 2

I have continued work on my XRF spectroscopy project using CCD/CMOS image sensors. Major changes since the last post:

  1. Switched to an OmniVision OV5647 camera (one of the "raspberry pi camera" modules). I modified the camera module to be as sensitive to x-rays as possible by removing the lens, IR filter, and the glass cover on the sensor (the last of which was absurdly difficult to do). Using this camera coupled with a Raspberry Pi Zero W affords me much more control over the image data I record, most importantly giving me the ability to record uncompressed YUV420 image data from the sensor. Switching to uncompressed data had a dramatic effect on the spectra produced.
  2. Improved my video processing algorithm. Clipped peaks and peaks below a noise threshold are now rejected. Added the option to record only single-pixel events as done in a couple of the papers I linked above.
  3. Switched from 640x480 to 1920x1080 resolution. I also disabled auto gain control, auto white balance, and denoising, and fixed the framerate at 30 fps.
  4. Potted the camera board and cable in rubber. This was done to protect the camera from electrical discharges near the x-ray tube and to eliminate distortion of the image data due to accumulation of static charge on the camera board.


I still have not been able to get results like those in the papers, however the overall spectral shape is much closer to what they observed and I am seeing a few noteworthy peaks now. The greatest issue currently is that I have not yet observed significant spectral changes when placing a sample such as a piece of steel between the sensor and x-ray tube. Ideally I should be seeing XRF peaks appear when I do this but they are either buried in the noise or not present at all. My experimental work is also very slow-paced because 1. I am trying to limit my x-ray exposure and 2. the raw video files from each acquisition are huge (500 MB for a 30-second recording) and take ages to transfer over wifi off of my Raspberry Pi.

xrfAllVals.png - 74kB
Linear (top) and log (bottom) energy spectra of a 30-second exposure with a piece of copper foil between the sensor and the x-ray tube.

Notice that the spectrum now shows an exponential decay in the baseline with respect to energy, and the previous "bremsstrahlung-like" curve is gone. This is good, as the papers I am basing this on also showed an exponential spectral curve. There is a peak at x=152 that is present in every spectrum regardless of the resolution of the image data or whether I discard multi-pixel x-ray detections. Either this is a genuine tungsten K-line from the x-ray tube or it is some sort of quirk with the camera sensor. I am skeptical as to whether it is actually a real peak because it is exactly one unit wide, whereas I'd expect to see slightly a broadened peak if it were genuine. Interestingly, the x=152 peak is also due almost entirely to single-pixel x-ray detections. My bit depth is 8 bits which means a max single-pixel value of 255, so the peak is probably NOT an artifact of bit depth. I cannot figure out any other explanation for this peak, so I'm open to suggestions if anyone has any.

The peaks at x= ~1100 and ~1400 are unique to spectra based on 1920x1080 data, and I am hoping this is a sign that higher resolution = less potential for overlapping x-ray detections = lower spectral noise. I still need to test more samples in front of the sensor but so far these peaks show little variation from sample to sample. The noise is pretty high in these shorter acquisitions (30 seconds), so I will have so do some more data collection before I attempt any peak assignments.

Feedback, suggestions, and questions are more than welcome!




"I've made a huge mistake"


Check out my YouTube channel ("spectrofreak") here: https://www.youtube.com/channel/UCnUlsCGK8d9UTjZA5DJ5a3A
View user's profile View All Posts By User
Twospoons
International Hazard
*****




Posts: 1281
Registered: 26-7-2004
Location: Middle Earth
Member Is Offline

Mood: A trace of hope...

[*] posted on 16-2-2023 at 12:14


What spectrum do you get if you turn the xrays off (dark image)? That would show up fixed pattern noise, along with the noise floor of the sensor.



Helicopter: "helico" -> spiral, "pter" -> with wings
View user's profile View All Posts By User
CRUSTY
Hazard to Others
***




Posts: 138
Registered: 5-6-2016
Location: Nearby
Member Is Offline

Mood: High-Order

[*] posted on 16-2-2023 at 15:02


Quote: Originally posted by Twospoons  
What spectrum do you get if you turn the xrays off (dark image)? That would show up fixed pattern noise, along with the noise floor of the sensor.


I get so few points I can't even plot a meaningful spectrum when I do this. The noise floor is very low on this sensor and my program rejects any detection events with amplitudes less than 4 times the noise floor, so non-x-ray pixels only very rarely make it into the final spectrum.

[Edited on 17-2-2023 by CRUSTY]




"I've made a huge mistake"


Check out my YouTube channel ("spectrofreak") here: https://www.youtube.com/channel/UCnUlsCGK8d9UTjZA5DJ5a3A
View user's profile View All Posts By User
Metallophile
Hazard to Self
**




Posts: 82
Registered: 23-3-2018
Member Is Offline

Mood: No Mood

[*] posted on 17-2-2023 at 07:07


Do you detect anything if you position the sensor off to the side, to avoid the X-ray beam, and look only for fluorescence from the sample?
View user's profile View All Posts By User
Texium
Administrator
Thread Moved
30-11-2023 at 10:55

  Go To Top