-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lux measurements #7
Comments
I'd also like to have a simple to use lux method in this library. I've read a lot about gains, the 'high range' mode, etc... but it is very complicated. This library already hard codes those values, so it seems like it would be easy for the author to know those values and make a straight forward lux method from the above formula. |
@scientistnobee , @machadolab , I code for Tasmota here on github and will rewrite the driver for the SI chip. Based on the veml6070 (there is a driver too) we can learn a lot from the data sheets. Ok we don't provide real scientistic readings and sensors here. All this here is to learn. At the end i have 3 questions:
|
I'm not sure if you guys are aware, but there is a driver that does all of these complicated measurements for this hardware here: https://github.com/HGrabas/SI1145 Although the UV reading is broken. I have forked the code and tried to fix it, but I didn't do a very good job. Anyway, it might be worth it to actually fix it than re-invent the wheel with this basic one. |
Hi, if I understood correctly, the lux measurements are carried out in this library by reading the visible photodiode values. I mean by the following line uv.readVisible. This in turn is just reading the register 0x22 which is assigned to SI1145_REG_ALSVISDATA0.
Now my question is that in the pdf file given here (https://www.silabs.com/documents/public/application-notes/AN498.pdf ) Visible photodiode values are given by the following equation (page 36):
ALS_VIS_DATA=256*ALS_VIS_DATA1+ALS_VIS_DATA0
That means we need to read registers 0x22 and 0x23. That is just the visible Photodiode value. Furthermore, the Lux will be calculated by using the following equation (AN523 section 6):
Lux level = [ [(ALS visible reading) - (ALS visible dark reading)] x (ALS visible coefficient) + [ (ALSIR reading) - (ALS IR dark reading)] x (ALS IR coefficient) ] x gain correction
So according to that we require to read the IR photodiode values as well. i.e. 0x24 and 0x25.
Did you do these calucations anywhere else in the library. If so, am I missing anything here? Please let me know. TIA.
The text was updated successfully, but these errors were encountered: