Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Add lux calculations to the LTR-329ALS sensor class #97

Open
amcewen opened this issue Apr 6, 2019 · 5 comments
Open

Add lux calculations to the LTR-329ALS sensor class #97

amcewen opened this issue Apr 6, 2019 · 5 comments

Comments

@amcewen
Copy link

amcewen commented Apr 6, 2019

The light sensor on the pySense boards reports two light values from the LTR-329ALS sensor.

Reading the datasheet for the sensor that's because there are two sensors sensitive to different wavelengths of light.

The datasheet mentions that there is a formula for calculating the lux level from those two readings. It would be good to have the lux reading available from the LTR329ALS01 class as well as the raw light readings.

@amcewen
Copy link
Author

amcewen commented Apr 6, 2019

The datasheet doesn't actually include Appendix A, but i received a copy of it from LiteON when I asked them about it.

I've implemented the new method in my fork of the libraries, in mcqn@3faed57

Happy to submit a pull request, but at the moment I've already got PR #95 outstanding, so it looks like that would need to be accepted/rejected first?

@Kriskras99
Copy link

Your implementation does not work if light_level == (0, 0), because the ratio calculation would be a division by zero (ZeroDivisionError)

@amcewen
Copy link
Author

amcewen commented Dec 2, 2019

Yes, sorry I forgot to update this issue - that bug was fixed in the next commit to my fork - mcqn@8d655f9 - a few weeks later.

@osmoralv
Copy link

osmoralv commented Apr 1, 2020

Hello @amcewen , could you share the file with the formula please?, I am working on a Light sensor using the LTR-329ALS-01 on my job and I need a reliable reference for my programming algorithm. The work will be share on github in C language and libraries for PIC mirochip microcontrollers. I really appreciate your help.

@JobStokkermans
Copy link

Hello @amcewen Could you share appendix A with me? I am working on the LTR-329ALS-01 as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants