Hello guys, today I've been playing with LDR by reading the analog value but I found out that the reading are not accurate. Sometimes the reading is increasing and sometimes is decreasing, how can I increasing the LDR accuracy?
how can I increasing the LDR accuracy?
Use better hardware.
Or average several readings.
We can't see your code, or your circuit, or how much variation you are talking about.
LDRs respond to temperature. If you want to measure you can either try to compensate for this, or use a photodiode which is much better behaved.
LDRs are also slow, so settling time may be many seconds on going from bright to dark.
Photodiodes are the device of choice for measuring light electronically except for very exotic situations,
LDRs have become a bit of a curiosity nowadays.
Is your light source stable? Fluorescent lights flicker at the AC line frequency (faster than your eye can see) and although the LDR can't respond instantly, it will probably pick-up some of the flicker. LEDs can flicker too. Incandescent lights are more-constant because the filament can't heat-up and cool-down instantly.
How much variation are you getting? I wouldn't expect it to be perfectly stable.
..."Accuracy" is a funny word unless you're reading Lux or Lumens and you know what the actual reading should be. Otherwise we can talk about stability, noise, drift, etc.