Which (wired) lux sensor for outdoor can I use on an ESP8266/ESP32?

I’m looking for a good lux sensor for outdoor to control my shutters when the sun is shining in the windows.

I have now some cheap chineese zigbee lux sensors which are on batteries.

But I’m looking for a sensor that I can control with an ESP8266/ESP32 board. So I don’t need to use batteries.

I have found a few:

  • TSL2591
  • MAX44009
  • VEML7700

I don’t have found any casing for it. And because the sensor will be outside this is very import.

Are there any good lux sensors with a casing for outside and which are not wireless?

If there are no good lux sensors I will consider to buy the Philips Outdoor Sensor. But this one is offcourse also on batteries and I don’t know how many times the sensor is sending updates about the lux values (I have asked this at Philips today)

I use a BH1750 and ESP in a box like this:

unnamed

Plus a GN12 cable gland for waterproofing the power cable.

glandnut

1 Like

What is the maximum lux that the BH1750 can meassure?

Did you have installed the box in direct sun light? (So yes is that not a problem for the temperature of the board?)

121556 lx maximum and no issue with overheating.

The ORP12 is the classic light dependent resistor that you can put in a potential divider and read with the analogue input on the ESP8266. Google will provide alternatives. There are ways to read analogue on a digital input if push comes to shove.
Instead of putting the whole thing outside you can solder on wires and coat everything but the plastic sensor face with silicon goo.

While that will give a relative level it will not give a direct reading in Lux like the BH1750.

Interesting. The BH1750 is readily available and cheap. Must try one. However I still suggest in this particular application something robust wired to electronics inside is preferable.

Okay thanks for information. I will buy soon a BH 1750 sensor.

But I have still some questions:

  • Is it possible to connect the BH1750 sensor with long wires to the esp boards (so a couple of meters)?

  • Is it right that you could connect a maximum of 2 BH1750 sensors to 1 esp8266 board (because the esp8266 has only 1 I2C port and the BH1750 has 2 possible I2C addreses)

  • Is it right that you could connect a maximun of 4 BH1750 sensors to 1 esp32 board (because the esp32 has 2 I2C ports and the BH1750 has 2 possible I2C addreses, so 2 x 2 = 4)

What I also can do is buying a Philips outdoor sensor, opening the casing and build in the BH1750 sensor. So I have good casinig. But it is expensive action to this, so maybe…

Eh. i2c isn’t supposed to be used over distances of greater than 30cm or so. If you use Cat5e cable it will probably work. Especially if you leave the default i2c frequency at 50kHz.

Correct.

Correct.

Why do you need so many sensors?

The polycarbonate box I showed above will cost you about $5.

The purpose of the sensor is meassuring the amount of lux near a window. So that I can control the cover of the window.

I have 10 covers. And I need several sensors because the sun shines through the windows on the second floor and not the first. So on several locations at the house I need to have a sensor (not every window needs seperate sensor).

In the meantime I have 2 sensors running:

  1. Philips Hue Outdoor sensor
  2. BH1750

The Philips Hue Outdoor sensor runs now for 2 weeks. But I’m not happy with this sensor because it sends only the lux value once every 5 minutes. This is really to little. I have a Node-RED flow running to check if the lux value >= 40.000 for 5 minutes and then the covers will be closed. So it will check 1 value and when you set it to 6 minutes 2 values.

So today I was playing with the BH1750 sensor. I have buy some case and a “fresnel lens”. For now everything is still prototype so its temporally mounted:

My experience for a few hours with the BH1750 and the sunny weather today:

The BH1750 gives much higher lux values which I think are more realistic then the Philips is giving.
(With the sun light you see on the picture: Philips +/- 44K lux and the BH1750 +/- 76K lux.

So I’m going definitely for the BH1750. The casing (waterproof IP65) that I’m using now is also very small (83 x 58 x 33 mm) in which everything will fit.I use the fresnel lens of a HC-SR501 pir sensor. (But you can get those fresnel lens at aliexpres very cheap!).

Finally I will mount the BH1750 with some glue to the fresnel and on that I will mount the Wemos D1 Mini. So that everything is finally mounted to the lid of the casing. The back of the case I will mount to the wall. So when it is needed to reprogram (now I’m using ESPHOME, but you could offcourse write your own code) it is very easy to get all the eletronic (the power will be some plug).

I will mount the casing nest to the roller shutter box.

Maybe I will also add some led to show if everything is working correctly. But that is offcourse not necessary but …:slight_smile:

1 Like

You’ve just messed with the calibration of the BH1750 by including that smi-opaque Fresnel lens. But for relative measurements it should be ok.

By using the shorter conversion time and mounting the sensor in the box I linked above I measure up to 100k Lux in full sun.

I’ve been using the Wemos/LOLIN BH1750 shield with a Wemos D1 Mini board in a southern-facing window for years now. It works quite well, and is entirely reliable.

Hi Tom,

Is not good to use such a fresnel lens?

I have also changed the measurement_duration option, but I didn’t see any changes to that.

First I tried the default option: 69. But I wanted to have as big as possible lux value, so I have changed it to 32.

Now it is running on 32.

How does your casing looks like?

I simply have the bare module affixed to the inside of the window, using 3M VHB tape. It is located behind a sofa, so not visible within the room.

I don’t know what you use the lux sensor for, but in my case it is for closing/opening covers at the outside of the house (which you see on the photo).

So in my case I can not place the sensor inside the window, because you can’t determine when you must open the covers.

It is attenuating the light by some amount you don’t know. So the Lux output is no longer calibrated. Your measured value will be lower than the real value by some fixed offset.

It will be fine for relative measurements.

Strange because the values of the BH1750 in the fresnel lens are much higher then the offical Philips Hue outdoor sensor (which I think that this device should be calibrated).

Buy anyway indeed I can use it for my purpose.

One question about your casing. Do you have some holes in your casing. I heard from some people that when there are no holes in the housing you could get some condensation.

Lol. No.

Nope. No holes, no condensation.