esp32-smartdisplay icon indicating copy to clipboard operation
esp32-smartdisplay copied to clipboard

get_light_intensity() is always returning zero

Open fcortijos opened this issue 1 year ago • 6 comments

First of all, I would like to thank you for your efforts in creating this library. I have the ESP32-3248S035C module. The function smartdisplay_get_light_intensity() is always returning zero. In the esp32_smartdisplay.h file the CDS_PIN is pointed to pin 34. Is there any particular pin configuration for this board or I bought a defective one?

tks

fcortijos avatar Nov 17 '23 19:11 fcortijos

Hi fcortijos ,

Normally, with light the value is 0. However, when covered the value increases. So in a way, you can call it a dark-sensor.

Please try if this is correct!

Regards

rzeldent avatar Nov 17 '23 23:11 rzeldent

Hi, it didn't change the value.

So I use this code instead (bellow) and the value change from 75 (no cover) to 400 (when covered).

// lv_label_set_text(label_cds, String(smartdisplay_get_light_intensity()).c_str()); lv_label_set_text(label_cds, String(analogReadMilliVolts(LIGHT_SENSOR)).c_str());

Regards

fcortijos avatar Nov 21 '23 16:11 fcortijos

I have a problem with my light sensor, it seems to only be set to 75, and if i completely cover it, nothing changes, pretty sure its set to the right gpio pin as well.

lazzaroevan avatar Dec 29 '23 15:12 lazzaroevan

I have a problem with my light sensor, it seems to only be set to 75, and if i completely cover it, nothing changes, pretty sure its set to the right gpio pin as well.

Have you checked the demo? It is displayed on the screen

rzeldent avatar Feb 02 '24 20:02 rzeldent

Yes, while running the demo, the value was stuck at 75, on one of my other boards, when I specifically set the dimming it seemed to work properly, so it may be a bad board or two.

lazzaroevan avatar Feb 05 '24 17:02 lazzaroevan

Then it is well possible something is wrong with the CdS sensor or soldering. When the sensor is in the dark, it has a high impedance so the value should be high. However in your case it looks like it is shorted because the value is always 75. Maybe some solder is present below the CdS sensor? You could try to take them out and retry soldering...

rzeldent avatar Feb 18 '24 14:02 rzeldent