Need help with an ESP8266 and a photocell

Everything about esp8266 and more.

Moderator: leecollings

Post Reply
Morrine
Posts: 3
Joined: Sunday 23 May 2021 19:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Need help with an ESP8266 and a photocell

Post by Morrine »

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 1KOhm resistor and the GL5528 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 wire. 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
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: Need help with an ESP8266 and a photocell

Post by erem »

you will most likely have better response if you ask this on the espeasy forum

here: https://www.letscontrolit.com/forum/
Regards,

Rob
User avatar
jvdz
Posts: 2208
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Need help with an ESP8266 and a photocell

Post by jvdz »

Shouldn't that be wired like shown in this example?:
https://www.hackster.io/gary-watts/esp8 ... schematics
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Treve
Posts: 107
Joined: Thursday 05 November 2015 10:37
Target OS: Raspberry Pi / ODroid
Domoticz version: v4.11474
Location: Rotterdam, NL
Contact:

Re: Need help with an ESP8266 and a photocell

Post by Treve »

I build a LUX sensor with ESP8266 (standard software ) and Lux sensor BH1750, no use of resistors.
ESP8266 send his data to Domoticz, with a Blockly I manage the darkness in the living room. It works flawlessly.
- RFXtrx433E,
- AEON Labs ZW090 Z-Stick Gen5 EU
- Hue v2.1
- Raspberry Pi 3 Model B, Raspbian Stretch Full on USB-Stick.
- Domoticz 4.11474
Devices: KaKu, Z-Wave, Hue.

for testing:
Raspberry 4, 2GB, SSD
Domoticz 2022.1
Ikea Hub, Fyrtur curtain
User avatar
Treve
Posts: 107
Joined: Thursday 05 November 2015 10:37
Target OS: Raspberry Pi / ODroid
Domoticz version: v4.11474
Location: Rotterdam, NL
Contact:

Need help with an ESP8266 and a photocell

Post by Treve »

Image

This was the test setup.
- RFXtrx433E,
- AEON Labs ZW090 Z-Stick Gen5 EU
- Hue v2.1
- Raspberry Pi 3 Model B, Raspbian Stretch Full on USB-Stick.
- Domoticz 4.11474
Devices: KaKu, Z-Wave, Hue.

for testing:
Raspberry 4, 2GB, SSD
Domoticz 2022.1
Ikea Hub, Fyrtur curtain
User avatar
jvdz
Posts: 2208
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Need help with an ESP8266 and a photocell

Post by jvdz »

A photocell is something different from the BH1750, which works quite different. The photocell is simply a resistor which varies based on the light. That is why you need the 3.3v - LDR - a0 pin - fixed resistor - 0. The a0 wil get a variable Volt level based on the resistance of the LDR. :)
Agree that the BH1750 works "better" but I have both and it should also work when no accuracy is required.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Treve
Posts: 107
Joined: Thursday 05 November 2015 10:37
Target OS: Raspberry Pi / ODroid
Domoticz version: v4.11474
Location: Rotterdam, NL
Contact:

Re: Need help with an ESP8266 and a photocell

Post by Treve »

Hi Jos, I know the difference. I’m using the LDR as well as shown. It allows the sunscreen to go out.
The topic starter was talking about lux, so I responded with my build to show it can be very simpel, accurate and cheap

Image
With regards,

Evert
- RFXtrx433E,
- AEON Labs ZW090 Z-Stick Gen5 EU
- Hue v2.1
- Raspberry Pi 3 Model B, Raspbian Stretch Full on USB-Stick.
- Domoticz 4.11474
Devices: KaKu, Z-Wave, Hue.

for testing:
Raspberry 4, 2GB, SSD
Domoticz 2022.1
Ikea Hub, Fyrtur curtain
Morrine
Posts: 3
Joined: Sunday 23 May 2021 19:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Need help with an ESP8266 and a photocell

Post by Morrine »

jvdz wrote: Sunday 23 May 2021 20:39 Shouldn't that be wired like shown in this example?:
https://www.hackster.io/gary-watts/esp8 ... schematics
Jos
Yup, it's what I did, sorry, I messed myself when writing ...
erem wrote: Sunday 23 May 2021 20:06 you will most likely have better response if you ask this on the espeasy forum

here: https://www.letscontrolit.com/forum/
Thanks for the link of the forum, I tried to post on the ESP reddit but got insta moderated for no reasons :(

I originally bought photocells to reduce cost at maximum since I already had resistors, but now I'm considering buying an I2C BH1750 !

I'll try posting on the ESP forum, I don't like to stay on a unexplained failure ...

Thank you for the quick answers :)
Morrine
Posts: 3
Joined: Sunday 23 May 2021 19:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Need help with an ESP8266 and a photocell

Post by Morrine »

I'm back with an answer from the ESP forum. Apparently, if the firmware contains VCC in its name, then the A0 input doesn't work quite fine. I changed mine and it's now working just perfect with a 10KOhm resistor. (ESP_Easy_mega_20210503_test_A_ESP8266_4M1M.bin : name of the firmware used)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest