Hi everyone,
I launched myself into a home automation project in which I wanted to integrate a lux sensor to control the lights intensity via Domoticz.
So I flashed an ESP8266 with ESPEasy and connected a GL5528 like so : wiring 3,3V to A0 through a GL5528 photocell and a 1KOhm resistor from A0 to GND.
When I look at the web interface (configured as Analog Input : Internal), I got a steady value of 65535. Whatever I do, it's not moving.
I first thought it was the resistor which was too low, so I changed it for a 4,7K then a 47K resistor without sucess. Still the same steady value ... I also replaced the GL5528 just in case.
Then I red on the wiki that ESP8266 NodeMCU already had a pullup/down resistor, so I replaced the 47K with a 0Ohm resistor. Still, nothing has changed !
I'm coming out of ideas, so if you have any informations that could help me troubleshoot this !
Thank you in advance
ESP8266 and photocell GL55.. not reading
Moderators: grovkillen, Stuntteam, TD-er
Re: ESP8266 and photocell GL55.. not reading
Check your ESPEasy firmware file; If it has "_VCC" in the bin's name then you are using the wrong one.When I look at the web interface (configured as Analog Input : Internal), I got a steady value of 65535. Whatever I do, it's not moving.
What is the full name of the firmware file that you used to flash your device? That is an important detail to share.I'm coming out of ideas, so if you have any informations that could help me troubleshoot this !
- Thomas
Re: ESP8266 and photocell GL55.. not reading
Apart from the "_VCC" remark made by Thomas, you should also think about the 'schematics'.
A NodeMCU indeed does have resistors present to convert 0...3v3 to 0...1V which the analog input of the ESP needs.
But that doesn't mean you should exchange the resistor you first tried to use for a 0 Ohm one.
I would have placed the photoresistor between GND and A0, but I don't think it really matters here.
In short, what you need is something like this:
R1 is in your setup chosen as the photocell, and R2 should be the fixed resistor, but like I said those can also be swapped as you need to calibrate the output anyway.
But I can imagine it would be more intuitive to have a lower value in the dark and a higher value in bright light as you first intended.
What is important is that you limit the current through R1 + R2 to such an amount that with the lowest expected resistance of the photocell you won't take too much current.
Also given the relative high resistance of the LDR you should probably pick the resistance value of the resistor to be roughly equal to the resistance value of the LDR when lit with half the max. intended light intensity. (on a log scale, half the lux scale)
Based on a quick search on Google, I see most schematics use between 10k and 100k.
A NodeMCU indeed does have resistors present to convert 0...3v3 to 0...1V which the analog input of the ESP needs.
But that doesn't mean you should exchange the resistor you first tried to use for a 0 Ohm one.
I would have placed the photoresistor between GND and A0, but I don't think it really matters here.
In short, what you need is something like this:
Code: Select all
3v3 --- R1 --- A0 --- R2 --- GND
But I can imagine it would be more intuitive to have a lower value in the dark and a higher value in bright light as you first intended.
What is important is that you limit the current through R1 + R2 to such an amount that with the lowest expected resistance of the photocell you won't take too much current.
Also given the relative high resistance of the LDR you should probably pick the resistance value of the resistor to be roughly equal to the resistance value of the LDR when lit with half the max. intended light intensity. (on a log scale, half the lux scale)
Based on a quick search on Google, I see most schematics use between 10k and 100k.
Re: ESP8266 and photocell GL55.. not reading
Hello guys !!
Thank you for your answers, the name of the firmware is "ESP_Easy_mega_20210503_test_A_alt_wifi_ESP8266_4M1M_VCC.bin"
So ... Indeed it got VCC in it's name, althought I don't really know what it means and why it's bad. I'll tell you I picked the first firmware on the list thinking it was the latest release ... My bad :'(
Which one should I choose then ? Could you enlight me on the reason aswell ?
Thanks again !!
Thank you for your answers, the name of the firmware is "ESP_Easy_mega_20210503_test_A_alt_wifi_ESP8266_4M1M_VCC.bin"
So ... Indeed it got VCC in it's name, althought I don't really know what it means and why it's bad. I'll tell you I picked the first firmware on the list thinking it was the latest release ... My bad :'(
Which one should I choose then ? Could you enlight me on the reason aswell ?
Thanks again !!

Re: ESP8266 and photocell GL55.. not reading
So, following your indications, I tried with this firmware : "ESP_Easy_mega_20210503_test_A_ESP8266_4M1M.bin" and a 10K resistor
And it magically works !! Thank you very much again !!
No I just got to understand why !
And it magically works !! Thank you very much again !!
No I just got to understand why !
Re: ESP8266 and photocell GL55.. not reading
Fantastic news.And it magically works !! Thank you very much again !!
The software with "_VCC" in the name is a special version that can be used to measure the device's operational voltage on a battery powered device. It ignores the voltage on the Analog Input pin. Instead, it measures the VCC voltage without any pin connections or extra hardware. It does this magic by measuring the internal Vref.No I just got to understand why !
You''re not the first to get confused by this. If the information is not already in the wiki and readthedocs, perhaps the docs need to be updated to reflect which version is needed for these two different analog applications.
- Thomas
Who is online
Users browsing this forum: No registered users and 12 guests