Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By B0SC0
#10622 I have an ESP8266-12 using lualoader.
Would like to have a LDR (light dependent resistor) and resistor going to A0.
Basically, 3.3v > LDR > A0(PIN2)> Resistor(1k - 100k ohm) > GND.
Setup to determine full light or full dark
Send to ThingSpeak.
A programmer I am not, however, I am trying.
Can anybody give me advice to implement this?

B0SC0
User avatar
By B0SC0
#10651 Just the reading of the ldr part is all I need.
The Thingspeak part I have already.
User avatar
By Mikejstb
#10654 I do this:
Light = ADC.read(0)

In LuaLoader you can do this interactively and also use the little clock button to repeat reading and displaying.
User avatar
By B0SC0
#10658 I was just playing with the gpio monitor in lualoader and was able to view adc readings..
Checked back here and saw your comment.
The only thing I had to change was reverse the resistor and ldr locations.
3.3v > Resistor(1k - 100k ohm) > A0(PIN2) > LDR > GND
Now I just have to setup a threshold of some sorts.
I just need to know daytime,nighttime.
Thanks for the reply.