KhaledOsmani
Full Member level 6
- Joined
- May 4, 2014
- Messages
- 384
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 18
- Activity points
- 3,933
I had connected an LDR to a PIC micro-controller.
It is running good, and I also made an ADC, so that the analog value of the input of the LDR (voltage) is translated into decimal values, and shown on the LCD.
My question is: Is there any formula to regulate the output of this component decimally?
i.e: when in full dark, the output must be shown as "0 lux" but it shows "7 lux" perhaps the value saved in the reserved byte must me subtracted from 7?
When in full light (glowing the LED of the iphone onto it) it says "1023 lux" which means 5V in analog which is maximum, which is logic.
What must be done to make it 100% accurate?
As for the LM35, there is for sure, a formulae so that after the ADC, the output (decimal value of the pre-saved byte in the file register) must have be mathematically operated, such as divided by two, or subtracted by ten, or both.
Can any body give me this formula? (note it is not posted in both of sensors datasheets)
It is running good, and I also made an ADC, so that the analog value of the input of the LDR (voltage) is translated into decimal values, and shown on the LCD.
My question is: Is there any formula to regulate the output of this component decimally?
i.e: when in full dark, the output must be shown as "0 lux" but it shows "7 lux" perhaps the value saved in the reserved byte must me subtracted from 7?
When in full light (glowing the LED of the iphone onto it) it says "1023 lux" which means 5V in analog which is maximum, which is logic.
What must be done to make it 100% accurate?
As for the LM35, there is for sure, a formulae so that after the ADC, the output (decimal value of the pre-saved byte in the file register) must have be mathematically operated, such as divided by two, or subtracted by ten, or both.
Can any body give me this formula? (note it is not posted in both of sensors datasheets)