Have you got the GPIO pull-down switched off?
At 60k the theoretical voltage of the divider is 0.99V, at 80k it is 1.32V, both those voltages are in no-mans-land* ie they will be interpreted unpredictably. This is why you have been recommended to use an ADC which can discriminate those different voltages accurately.
A lens might help your LDR if it is a weak light source, it would also reduce any incidental lighting from the side. Better still would be a photodiode/phototransistor. LDR's aren't very good at low light nor small changes in light level.
I can't remember for sure but I'd suspect an LDR to have significant thermal drift, especially at the dark end.
* non-mans-land (logic guard band) for 3.3V logic is 0.8V to 2V
At 60k the theoretical voltage of the divider is 0.99V, at 80k it is 1.32V, both those voltages are in no-mans-land* ie they will be interpreted unpredictably. This is why you have been recommended to use an ADC which can discriminate those different voltages accurately.
A lens might help your LDR if it is a weak light source, it would also reduce any incidental lighting from the side. Better still would be a photodiode/phototransistor. LDR's aren't very good at low light nor small changes in light level.
I can't remember for sure but I'd suspect an LDR to have significant thermal drift, especially at the dark end.
* non-mans-land (logic guard band) for 3.3V logic is 0.8V to 2V
Statistics: Posted by pidd — Fri Dec 15, 2023 4:43 am