kriswiner / AS7265X

18-channel, 40-nm FWHM spectrometer
19 stars 17 forks source link

Unit Conversion #5

Open p0wl opened 5 years ago

p0wl commented 5 years ago

Hey Kris,

thanks for your work, we have read a lot about your project and it was very inspiring to see your solution. Hope it is selling good on tindie!

We have an AS7265x spectrometer running, but we struggle with understanding the unit (& converting it). According to the datasheet, the unit is counts/(μW/cm2), but we cannot find more information on what counts are and how to convert it to a unit that represents light intensity.

We would love to be able to convert the counts/(μW/cm²) value to something like μmol * m⁻² * s⁻¹ which is used for light recipes for plants for example.

Do you know what the counts are and how to convert the measurements from the spectrometer in other units?

Thanks in advance!

kriswiner commented 5 years ago

Hi Paul,

I really have no idea. I don;t know anything more than you from reading the data sheet. The spectrometer is made up of three modules, perhaps these conversions are buried in the data sheets for these. They do list response for the AS72651 as 35 counts/uW/cm^2 for a ~1500 uW/cm^2 broad band source. I interpret this to mean that if you are measuring a broadband source (like the Sun) and the channel is reading 35 counts this means there is incident 1 uW/cm^2 of light in that channel band. Any conversion like this will be somewhat crude but is good enough for a ballpark. In the end, best practice is to use your own known source to calibrate the specific sensor you are using.

Ambient light sensors like the VEML6040 (RGBW) and BH1749 (RGB & IR) do list conversion factors to get the channels counts into uW/cm^2 and total lux for the green channel. I am not sure if you need 18 channels in your application, maybe three or four would do?

And I would recommend asking AMS directly (they have been somewhat responsive to my questions in the past) for an answer. Sorry I couldn't help more.

Kris

On Wed, Feb 20, 2019 at 3:54 AM Paul Mölders notifications@github.com wrote:

Hey Kris,

thanks for your work, we have read a lot about your project and it was very inspiring to see your solution. Hope it is selling good on tindie!

We have an AS7265x spectrometer running, but we struggle with understanding the unit (& converting it). According to the datasheet, the unit is counts/(μW/cm2), but we cannot find more information on what counts are and how to convert it to a unit that represents light intensity.

We would love to be able to convert the counts/(μW/cm²) value to something like μmol m⁻² s⁻¹ which is used for light recipes for plants for example.

Do you know what the counts are and how to convert the measurements from the spectrometer in other units?

Thanks in advance!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/AS7265X/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkPT5DoP4NQOk6xCGuMlttk1gudWks5vPTeBgaJpZM4bFDId .

p0wl commented 5 years ago

Hey Kris,

thanks for the fast response. We are now in contact with AMS and we got a Uprtek device to have a reference measurement. Comparing the spectral curves from both devices, the AS7265x has a very different curve, but we are now able to calculate the offsets using multiple measurements.

If we know more about the unit conversion from AMS, I will post it here.

Thanks again!

kriswiner commented 5 years ago

Thanks Paul, I am looking forward to learning what you find out.

On Tue, Mar 5, 2019 at 1:05 AM Paul Mölders notifications@github.com wrote:

Hey Kris,

thanks for the fast response. We are now in contact with AMS and we got a Uprtek device to have a reference measurement. Comparing the spectral curves from both devices, the AS7265x has a very different curve, but we are now able to calculate the offsets using multiple measurements.

If we know more about the unit conversion from AMS, I will post it here.

Thanks again!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/AS7265X/issues/5#issuecomment-469598478, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qjPNNbxnJxqNrh0lKKgKLyvlMJnjks5vTjNKgaJpZM4bFDId .

strontiumpku commented 4 years ago

Hi Paul and Kris,

I was looking for the conversion of reads to absolute values as well and ran into this thread. Do you happen to find solutions now, if I may ask?

Thanks! Yusi

Hey Kris,

thanks for the fast response. We are now in contact with AMS and we got a Uprtek device to have a reference measurement. Comparing the spectral curves from both devices, the AS7265x has a very different curve, but we are now able to calculate the offsets using multiple measurements.

If we know more about the unit conversion from AMS, I will post it here.

Thanks again!

victorrb1 commented 3 years ago

Hey All,

I am also struggling with the conversion, and was wondering whether you already solved it.. i would love to hear it from you!

Kind regards,

Victor Burger

p0wl commented 3 years ago

Sadly, we did not find a good way to do it, other than using a reference device and just calculating the offset.

victorrb1 commented 3 years ago

Alright, thanks for your message!

strontiumpku commented 3 years ago

Hi all,

I wrote a mail to ask AMS. The answer I've got so far is you need a reference device to calibrate. Below is their response. FYI.

Best, Yusi

------ Quote ------

The or irradiance responsivity is based on so many conditions like gain, integration time, light source, temperature etc. You can see irradiance in the datasheet for each channel based on the particular setup and parameters. So, the count can be different in your case.

But you can do calibration to get target values or desired values.

‘Counts; means each channel digital value.

Raw values or counts are directly from ADCs (ATDATA) and AS7265x is pre-calibrated means the calibration values are based on the specific diffused light source and a particular setup during production which is mentioned in the datasheet. Calibration values or counts can get with ATCDATA. If you fulfill all conditions then only you will get the exact calibration values as mentioned in the datasheet. But you can calibrate the sensor and the calibration process is very easy, just to multiply with the scaler value.

For example, channel G raw value or count is showing 2000 for a particular setup (your setup) but the reference is showing 1000. That means the scaler value will be 0.5 (ATSCLx = xx).

Therefore, 2000(Raw value) * 0.5 = 1000(calibrated value)

As your setup or application is different, you need a reference device (for example spectrometer) to set the correct scaler value for each channel to get the expected value which is calibrated value from the raw value.

victorrb1 notifications@github.com 于2020年10月15日周四 下午2:26写道:

Alright, thanks for your message!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/AS7265X/issues/5#issuecomment-708928079, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOV6BLQZOMKLOL62JLB2C3TSK2IX3ANCNFSM4GYUGIOQ .

victorrb1 commented 3 years ago

Hi all, I wrote a mail to ask AMS. The answer I've got so far is you need a reference device to calibrate. Below is their response. FYI. Best, Yusi ------ Quote ------ The or irradiance responsivity is based on so many conditions like gain, integration time, light source, temperature etc. You can see irradiance in the datasheet for each channel based on the particular setup and parameters. So, the count can be different in your case. But you can do calibration to get target values or desired values. ‘Counts; means each channel digital value. Raw values or counts are directly from ADCs (ATDATA) and AS7265x is pre-calibrated means the calibration values are based on the specific diffused light source and a particular setup during production which is mentioned in the datasheet. Calibration values or counts can get with ATCDATA. If you fulfill all conditions then only you will get the exact calibration values as mentioned in the datasheet. But you can calibrate the sensor and the calibration process is very easy, just to multiply with the scaler value. For example, channel G raw value or count is showing 2000 for a particular setup (your setup) but the reference is showing 1000. That means the scaler value will be 0.5 (ATSCLx = xx). Therefore, 2000(Raw value) * 0.5 = 1000(calibrated value) As your setup or application is different, you need a reference device (for example spectrometer) to set the correct scaler value for each channel to get the expected value which is calibrated value from the raw value. victorrb1 notifications@github.com 于2020年10月15日周四 下午2:26写道: Alright, thanks for your message! — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#5 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOV6BLQZOMKLOL62JLB2C3TSK2IX3ANCNFSM4GYUGIOQ .

Dear,

Thank your for your message. I already have had measurements with a reference device, the so-called JETI Specbos. This sensor gives me a spectral irradiance output, *W/(m2nm)**. I doubt whether I can, as was mentioned in your reply, just multiply the counts/uW/cm2 value of one of the 18 spectral bands with a factor to get the actual value of my Specbos.

I'd like to hear what you think of this specific conversion.

Kind regards,

Victor Burger

victorrb1 commented 3 years ago

Hi all, I wrote a mail to ask AMS. The answer I've got so far is you need a reference device to calibrate. Below is their response. FYI. Best, Yusi ------ Quote ------ The or irradiance responsivity is based on so many conditions like gain, integration time, light source, temperature etc. You can see irradiance in the datasheet for each channel based on the particular setup and parameters. So, the count can be different in your case. But you can do calibration to get target values or desired values. ‘Counts; means each channel digital value. Raw values or counts are directly from ADCs (ATDATA) and AS7265x is pre-calibrated means the calibration values are based on the specific diffused light source and a particular setup during production which is mentioned in the datasheet. Calibration values or counts can get with ATCDATA. If you fulfill all conditions then only you will get the exact calibration values as mentioned in the datasheet. But you can calibrate the sensor and the calibration process is very easy, just to multiply with the scaler value. For example, channel G raw value or count is showing 2000 for a particular setup (your setup) but the reference is showing 1000. That means the scaler value will be 0.5 (ATSCLx = xx). Therefore, 2000(Raw value) * 0.5 = 1000(calibrated value) As your setup or application is different, you need a reference device (for example spectrometer) to set the correct scaler value for each channel to get the expected value which is calibrated value from the raw value. victorrb1 notifications@github.com 于2020年10月15日周四 下午2:26写道: Alright, thanks for your message! — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#5 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOV6BLQZOMKLOL62JLB2C3TSK2IX3ANCNFSM4GYUGIOQ .

Moreover, could you provide me the email address of the AMS department you have had contact with? I feel like my emails on the Enquiry page don't end up being answered.. ;-)

strontiumpku commented 3 years ago

Hi Victor,

I wrote to this address, sensors (A T) ams.com, and it seemed they were monitoring this mailbox.

I'm not familiar with the equipment you mentioned in your thread. But based on the unit W/(m2*nm), my understanding is it seems to be normalized by wavelength so the measurement now stands for the QUANTITY of the photons, rather than the ENERGY of the photons measured by the AS7265x with the unit uW/cm2. To calibrate, you might need monochromatic light sources which wavelengths match the peak wavelength of the 18 channels of the AS7265x. Measure the monochromatic lights using the two devices respectively and you will be able to calculate the measurement with the same unit uW/cm2 (value from JETI multiplying the wavelength), and thus the scale factor for each channel. If my understanding of your JETI device is correct, I'm quite sure this approach would work - but apparently it's not so feasible as we need to prepare 18 channels of monochromatic lights.

Oh and you might want to test some of the channels first to check if the scale factors are the same, which implies the response of each channel is fine tuned by the manufacturer so we could use one scale factor for all channels.

I've got no idea if there's any easier way to do the calibration. Please let me know if anyone has an alternative idea. Thanks.

victorrb1 commented 3 years ago

Hey strontiumpku,

thanks for your elaborated reply. I was about to say that I discovered a way to convert the spectral irradiance to the counts/irradiance of the AMS, but after reading your reply, I noticed that I might have overlooked something. Could you (or another expert who is reading this ;)) check whether the conversion written down below is correct? Here it comes: gaussiangraph The AMS's output is a response of 18 spectral bands in counts/microWatt/cm2. A few of the spectral bands are shown in the graph above (this are so-called Gaussian distributions with FWHM 20 nm. So, for instance, it says "Band A(410 nm): 650 counts/uW/cm2". The JETI output is in *W/(m2nm), measured per nanometer. So, to be able to determine the scale factor between the two, I first have to convert it to irradiance:** After doing a measurement with both the AMS and the JETi SpecBos on the same light source, with having an equal distance to the light source. I have raw and precalibrated data out of the AMS (and apply the steps underneath to the raw data):

  1. weigh a normalized Gaussian FWHM 20 nm distribution over the particular part of interest of the JETI spectral output. So, not only the wavelengths of the JETI for the 18 spectral bands of the AMS (in the figure 410 nm, 435, 460 nm etc.), but all the wavelengths underneath the Gaussian distribution.
  2. After weighing each wavelength's value of the particular band (say, 380 nm till 440 for the 410 spectral band), I have to (and this is the part I am uncertain about) multiply each of that weighed JETI spectral irradiance value against the specific wavelength (380 nm till 440)
  3. Sum all of the 60 weighed irradiance values
  4. Divide the sum by the concerned counts/uW/cm2 spectral band value (the one of 410 nm in this case), and I've got the scaling factor for one particular band.
  5. Do this for all the 18 bands.

Step 2 and 3 about multiplying each value with its specific wavelength is what I got out of your previous reply and still uncertain about.

Do you think applying above steps on the precalibrated data is a better idea? I think not necessarily, because it is calibrated with a particular light source and factory settings. I apply my own initial settings (maximal gain and integration time). Moreover, as another question: is it correct that the determined scaling factor should be independent of the light source? That is what I eventually want, in any case. I want to use the AMS sensor as a wearable device, measuring light and linking it to the blue part of the spectrum, where the melanopsin-photosensitive cell is active.

It would be great if you could reply to this message. I am eager to your response.

Kind regards,

Victor Burger

Hi Victor,

I wrote to this address, sensors (A T) ams.com, and it seemed they were monitoring this mailbox.

I'm not familiar with the equipment you mentioned in your thread. But based on the unit W/(m2*nm), my understanding is it seems to be normalized by wavelength so the measurement now stands for the QUANTITY of the photons, rather than the ENERGY of the photons measured by the AS7265x with the unit uW/cm2. To calibrate, you might need monochromatic light sources which wavelengths match the peak wavelength of the 18 channels of the AS7265x. Measure the monochromatic lights using the two devices respectively and you will be able to calculate the measurement with the same unit uW/cm2 (value from JETI multiplying the wavelength), and thus the scale factor for each channel. If my understanding of your JETI device is correct, I'm quite sure this approach would work - but apparently it's not so feasible as we need to prepare 18 channels of monochromatic lights.

Oh and you might want to test some of the channels first to check if the scale factors are the same, which implies the response of each channel is fine tuned by the manufacturer so we could use one scale factor for all channels.

I've got no idea if there's any easier way to do the calibration. Please let me know if anyone has an alternative idea. Thanks.

victorrb1 commented 3 years ago

I just realised I should not multiply it by the particular wavelenght, but with the difference between two following wavelengths: which is 1 nm. So nevermind!

strontiumpku commented 3 years ago

Hi victorrb1, Sorry for the misleading information about the unit of the JETI output. I searched the JETI website and found this document: https://www.jeti.com/files/content/support/downloads/technical%20notes/TN03%20Some%20detailed%20information%20about%20JETIs%20spectroradiometric%20equipment.pdf

This doc said the JETI output of W/m2/nm was the spectral irradiance, which was irradiance per nanometer, or irradiance of a slice in the spectrum with width=1nm, NOT irradiance divided by wavelength. Based on the definition of the measures, I agree with your approach to weigh the Gaussian distribution of each AS7265x channel over the JETI output and then calculate the scale factors. And you don't have to multiply any wavelength but could directly add all the weighed spectral irradiance values together.

I also agree with you that the scale factor only depends on the settings of gain and integration time, and is independent of the light source.

Congrats to your findings. I think it's valuable information to other new developers using the AMS sensor.

Best, Yusi

I just realised I should not multiply it by the particular wavelenght, but with the difference between two following wavelengths: which is 1 nm. So nevermind!

victorrb1 commented 3 years ago

Hi victorrb1, Sorry for the misleading information about the unit of the JETI output. I searched the JETI website and found this document: https://www.jeti.com/files/content/support/downloads/technical%20notes/TN03%20Some%20detailed%20information%20about%20JETIs%20spectroradiometric%20equipment.pdf

This doc said the JETI output of W/m2/nm was the spectral irradiance, which was irradiance per nanometer, or irradiance of a slice in the spectrum with width=1nm, NOT irradiance divided by wavelength. Based on the definition of the measures, I agree with your approach to weigh the Gaussian distribution of each AS7265x channel over the JETI output and then calculate the scale factors. And you don't have to multiply any wavelength but could directly add all the weighed spectral irradiance values together.

I also agree with you that the scale factor only depends on the settings of gain and integration time, and is independent of the light source.

Congrats to your findings. I think it's valuable information to other new developers using the AMS sensor.

Best, Yusi

I just realised I should not multiply it by the particular wavelenght, but with the difference between two following wavelengths: which is 1 nm. So nevermind!

Hi Yusi,

thanks for the reply.

Further investigation showed me that somewhat higher gain and integration time made the scale factors more consistent. This may be interesting for those who are tinkering with achieving the right settings, whatever those may be.

What I also found out, is that the scale factors do differ for different light sources. This, however, is not an indication of this inaccuracy of the sensor per se, but might be an indication of uncertainty in the measurement procedure/measurement environment or other uncertainties.

Victor Burger

coder-ari commented 6 months ago

Can anyone please explain, how to do the conversion of the output of the Spectral Triad Sensor to PPFD? I am a novice...

latonita commented 6 months ago

@victorrb1 Hi. I wonder if you have any of your calculations/code still available. Trying to do similar for AS7343. Thanks