I'm refering to this git hub driver for Si1133 : https://siliconlabs.github.io/Gecko_SDK_Doc/efm32pg12/html/si1133_8c_source.html
And this design guide :
I don't understand the relationship with the SI1133_calcEvalPoly() functions using these coefs :
The example code provides a fixed point calculation for UV index. If your platform supports floating point calculation, you can simply use the equation in the application note to calculate UV index.
In terms of UV calibration, it's recommended to take multiple measurements at different UV index levels after the optical design is finalized in your system. You should log the UV raw data from the sensor as well as the UV index reading from a UV meter. Then fit the result to a second order polynomial equation like the one in the application note. If you want to save time and don't care too much about the accuracy, you can also use the default equation, but apply a scale factor to adjust the result.
Thanks Tony for your quick answer !
I follow your suggest an used floating point, but cannot figure out what's the equivalent 'm' and 'k' to the code sample (poly coefs). See measures at the end, even the sign of the poly seems to indicate that this is not equivalent to 'm=0.00391'.
I understand the 'k' factor which has to be calibrated with the final setup which may be different from the "theorical setup". But what about 'm' factor ?
I saw in this post (https://community.silabs.com/t5/Optical-RH-Temp-Sensor/SI1133-UV-Index-calculation-with-multiple-samples/m-p/197473) that you suggested another 'm' value. How to define this value, was not clear for me on attached post ?
Note that I'm using a setup close to "7. Good Performance, Less Compact Assembly", with DECIM_RATE=3, ADCMUX=24, HSIG=0, SW_GAIN=7, HW_GAIN=2, 24BIT_OUT and POSTSHIFT=0.
Thanks for your help !
Here's some measurement I made on ambient light (UVi with 'm' and 'k' and poly with calcEvalPoly)
m = 0.00391
k = 0.0104
poly coefs :
UV : DEBUG raw -49, UVi -0.411966, poly 0.404541
UV : DEBUG raw -12, UVi -0.118944, poly 0.093994
UV : DEBUG raw 65, UVi 0.847805, poly 0.525146
UV : DEBUG raw 4, UVi 0.042251, poly 0.031250
UV : DEBUG raw 14, UVi 0.153570, poly 0.109131
UV : DEBUG raw 40, UVi 0.481062, poly 0.325928
UV : DEBUG raw -3, UVi -0.030834, poly 0.023682
The default k&m in the application note assumes that you apply the diffuser in the optical design. The poly coefficients you found in GIT HUB example is used for the case without the diffuser.
Attached is an example code with the coefficients for m = 0.00391 and k = 0.0104. You should also follow the configuration in the example code as well. If you use a different configuration, you MUST calibrate both k&m. Like I said before, you can take multiple measurements and fit the result to a poly equation. That's how you can get both k&m.