Thursday 2 March 2023

Lux Sensor With Ray Bans

Yesterday my reader questioned why shadow played a part in the positioning of the Smart Lux Sensor. This will become obvious further down today's post.

I hit a small problem with the Smart Lux Sensor - it starts at 0 lux and only goes up to 1,000 lux, which is the reading not long after daybreak and hence totally useless when I need to detect the trigger point of between 10k and 20k lux, which is the amount of sunlight on a sunny day in March. 


It seems all cheap Smart Lux Sensors (20 quid-ish) are limited to 1,000 lux at the top end, making them suitable only for detecting daybreak and sunset for applications such as controlling curtain motors and lights - perhaps not lights, unless they're in a different room, else the system would get trapped in a circular logical interference loop of continually switching the lights on and off; on when the lux drops naturally and off again the second the lux increases due to the lamp light, progressing to a constant and annoying flicker, like Christmas tree lights. A more granular sensor, capable of accurately registering the lux over the range of a full day, costs a couple of hundred quid but isn't suitable for integration into the Tuya App.

My solution was initially to place the sensor well inside the house (on my desk) to extend the sensitivity, but the amount of light at the centre of the room rises until about 10am, as it streams through a set of east-facing French doors, only to decrease again as the sun traverses round to the south of the house, where there are no windows. Not only that, but the placement can vary only slightly and yet have a large effect on the reading.

I have reached the conclusion that I need to extend the monitor's sensitivity by placing it in a north-facing window, where there's no chance of hit being hit by direct or varying sunlight, and providing it with sunglasses. In this manner 10,000 lux, for example, would register on the monitor as something between 0 and 500 lux and 20k lux as near, but not at, 1,000 lux.

Now to find a suitable pair of cheap sunglasses I can cannibalise a lens from to place over the photoelectric cell. OK, it doesn't have to be sunglasses - a lidless box of some description would do. I have to work fast, as today is sunny all day (which means I could actually use the weather function of the Tuya programme).

Another thing I have to find out is whether the Smart devices themselves contain the programming, whether the programme resides in the Tuya cloud, or whether it sits on my phone. If it's the latter, then being out of network coverage on my phone will invalidate any programming. Certainly, the ability to remotely switch a Smart Device on or off on demand will depend on having mobile phone coverage, but the automation programming is a different matter. I have yet to find a comprehensive answer.


No comments: