Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_light_intensity() is always returning zero #41

Open
fcortijos opened this issue Nov 17, 2023 · 6 comments
Open

get_light_intensity() is always returning zero #41

fcortijos opened this issue Nov 17, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@fcortijos
Copy link

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

@rzeldent
Copy link
Owner

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

@fcortijos
Copy link
Author

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

@lazzaroevan
Copy link

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.

@rzeldent
Copy link
Owner

rzeldent commented Feb 2, 2024

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 rzeldent added the bug Something isn't working label Feb 2, 2024
@lazzaroevan
Copy link

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.

@rzeldent
Copy link
Owner

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants