ESP-MQTT-JSON-Multisensor icon indicating copy to clipboard operation
ESP-MQTT-JSON-Multisensor copied to clipboard

LDR all over the place

Open melsom opened this issue 8 years ago • 9 comments
trafficstars

Hello,

Is there any way to correct this? The sensor i stationary but the values seems to be up/down alot even though the median seems to be correct, looking at the 24h logs.

image

image

melsom avatar Jun 24 '17 09:06 melsom

I get this when someone walks in front of the sensor. I was thinking of using a diffuser on top of it to try and level it out a bit. I also have a 30 minute window where the sun bounces off cars going past and they reflect into the flat causing it to read higher for a second or so....

cooljimy84 avatar Jul 03 '17 16:07 cooljimy84

Also, if you're using an LDR, lux is an arbitrary thing in that scale, you aren't getting true lux values.

jonathanweinberg avatar Jul 05 '17 14:07 jonathanweinberg

I got this too and realized it was my ceiling fan throwing shadows all over the place. I moved the sensor to a place that isn't affected and mounted in an enclosure and it's been rock solid.

ntalekt avatar Jul 09 '17 01:07 ntalekt

I got a different issue , my sensor works backwards, if its dark the numbers goes up to about 600 lux, if is bright is goes down to 33 lux. , I got the 4 pin sensor and got signal pin on AO (analog output) instead of DO (digital output). already tried switch AO and DO, but got the same result. any help would be greatly appreciated.

Jizar07 avatar Nov 19 '17 00:11 Jizar07

correct (well for me as well) so darkness for my sensor is 900 LUX and bright light is 20 odd.

cooljimy84 avatar Nov 21 '17 16:11 cooljimy84

@Jizar07 At least with an LDR, this happens if your ground and 3v are swapped.

rdbahm avatar Dec 08 '17 02:12 rdbahm

Also, if you're using an LDR, lux is an arbitrary thing in that scale, you aren't getting true lux values.

Thanks. came here to ask about that as I found it just gave me a voltage reading between 0-1024 (as expected when using A0). So I wrote a template in HA that turned it into a % value.

mikewebb70 avatar Jan 30 '19 09:01 mikewebb70

@mikewebb70 - you should share that template :)

jonathanweinberg avatar Feb 02 '19 00:02 jonathanweinberg

@mikewebb70 - you should share that template :)

You are right I should have, it's nothing special. Here is my light sensor Home Assistant yaml entry

- platform: mqtt
  name: "lux office"
  state_topic: "tele/labmcu/SENSOR"
  unit_of_measurement: "%"
  #value_template: "{{ value_json['ANALOG'].A0 }}"
  value_template: "{{ (value_json['ANALOG'].A0|float/1024*100|float)|round(0) }}"
  availability_topic: "tele/labmcu/LWT"
  payload_available: "Online"
  payload_not_available: "Offline"

mikewebb70 avatar Feb 02 '19 01:02 mikewebb70