Newbie question: LDR

Moderators: Voyager, BertB, rtenklooster, Stuntteam, grovkillen, TD-er

Post Reply
Message
Author
pgielen
Normal user
Posts: 3
Joined: 25 May 2019, 10:13

Newbie question: LDR

#1 Post by pgielen » 25 May 2019, 10:43

I have just succesfully flashed my first Wemos D1 with ESP Easy and got a PIR sensor to work following the tutorial in the Wiki. The values are read in Domoticz. Now, of course I want to add a LDR in a voltage divider circuit, following this tutorial: https://www.letscontrolit.com/wiki/inde ... e_resistor. In the newest version of ESP Easy, the settings are not the same as in the wiki tutorial, for example, I do not see a delay or port setting, but I think these should work:

Code: Select all

Device: Analog input - ADS1115
Name: LDR
Enabled: checked
I2C Address: default
Gain: 1x
Input multiplexer: AIN0-AIN1 (Differential)	
Calibration: not checked
Send to Controller: checked
IDX: 182
Interval: 60 sec
Name #1 Analog
Formula: 100-%value%*100/32752
Decimals: 0
The idx 182 is of a virtual device I created in Domoticz, of the type LUX. The value however always stays 200, regardless if it is dark or light. The log file does not show any data coming in from ESP. Am I overlooking something?

I also tried changing the Device tot Analog - internal. No improvement.

Pierre

pgielen
Normal user
Posts: 3
Joined: 25 May 2019, 10:13

Re: Newbie question: LDR

#2 Post by pgielen » 25 May 2019, 12:28

I solved it myself... The LDR does not return a LUX value, but a voltage, so I had to create a Voltage device in Domoticz and set the formula in ESP Easy to (%value%/1024)*3.3
If light, the voltage is low, if dark, the voltage is high... :D

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests