BH1750FVI Ambient Light Sensor
Posted: Sun Nov 06, 2022 12:02 pm
Hi
I have need to record Lux levels over the course of a day to obtain data for further analysis. Whilst just using a LDR and resistor combination would be a simple solution a ton of time would be wasted in calibration with most likely the hassle of look up tables too.
Noticing the BH1750FVI as a component, this looked to be an ideal way to simplify things as it provides a "Lux" output. Woo-hoo less work for me
I did find a minor bug with it, but Medelec35 quickly sorted that out (as usual) so again many thanks to him for his help.
Flowcode Simulation allowed me to test without any hardware which is a huge plus, so I had code ready to go when I took delivery of my sensors (mine are https://www.amazon.co.uk/gp/product/B07 ... UTF8&psc=1 ). Time now to go to the Evil Lab for some testing.
Up in my Ivory Tower I'm about three or four metres away from the skylights which provide enough natural light during the day for pretty much all activities including that taking place at ground level. As an aside, yesterday we had heavy, heavy rainfall all day and a PV panel, standing vertically and definitely not pointing to any light source, was still giving an output in excess of 14v.
I had a light meter with me that gives a Lux output. Whilst it isn't calibrated (possibly obtained from Maplin a decade or so ago) it wasn't too far away when I compared it with a photographer friend's light meter. Twenty quid versus hundreds..... hmm... no contest for my extremely modest needs.
With the sensor plugged into some breadboard and jumper'd to an EB006 Programmer / Combo board I downloaded the code. I set the light meter sensor as close as I could without casting shadows on the board as best I could, and I did appreciate and expect some differences not least due to the physical differences between the sensors. Bare board versus purpose case.
I have to say I was extremely surprised and impressed. Both readings were within a few digits of each other (610 on meter vs 607 on sensor). Any movement I made nearby would create a change in value that registered on both devices (I have four skylights surrounding bench). Taking my code loop delays into consideration etc I did think that the meter settled quicker than sensor but nothing of real note.
Moving meter / sensor closer / further apart did make quite noticeable differences. A cm or two could make a difference in readings of 40 Lux but of course I am part of the equation too and I'm not exactly static. However whatever the difference it remained consistent as I tested. With a difference of three Lux between them whilst just lying on the bench I shone a torch on them. Both increased from around 615 to around 1074 again maintaining the original difference between them.
For my needs this is more than accurate enough and FC definitely saved me a lot of time by allowing me to automate my capture.
Purely by coincidence another project came around that would be another great use of the sensor. A friend lives in a listed building so you cannot do anything at all (pretty much). They wanted some internal lights to come on in public areas if it got too dark during the day. Those that are familiar with these types of buildings know the problems faced. It isn't as simple as you might initially think. One possible solution is to use this sensor as a free standing remote, possibly linked via RF. Having everything "sleep", possibly waking up every ten or fifteen minutes and making a decision, would most likely give a battery life of many, many months.
Regards
I have need to record Lux levels over the course of a day to obtain data for further analysis. Whilst just using a LDR and resistor combination would be a simple solution a ton of time would be wasted in calibration with most likely the hassle of look up tables too.
Noticing the BH1750FVI as a component, this looked to be an ideal way to simplify things as it provides a "Lux" output. Woo-hoo less work for me

I did find a minor bug with it, but Medelec35 quickly sorted that out (as usual) so again many thanks to him for his help.
Flowcode Simulation allowed me to test without any hardware which is a huge plus, so I had code ready to go when I took delivery of my sensors (mine are https://www.amazon.co.uk/gp/product/B07 ... UTF8&psc=1 ). Time now to go to the Evil Lab for some testing.
Up in my Ivory Tower I'm about three or four metres away from the skylights which provide enough natural light during the day for pretty much all activities including that taking place at ground level. As an aside, yesterday we had heavy, heavy rainfall all day and a PV panel, standing vertically and definitely not pointing to any light source, was still giving an output in excess of 14v.
I had a light meter with me that gives a Lux output. Whilst it isn't calibrated (possibly obtained from Maplin a decade or so ago) it wasn't too far away when I compared it with a photographer friend's light meter. Twenty quid versus hundreds..... hmm... no contest for my extremely modest needs.
With the sensor plugged into some breadboard and jumper'd to an EB006 Programmer / Combo board I downloaded the code. I set the light meter sensor as close as I could without casting shadows on the board as best I could, and I did appreciate and expect some differences not least due to the physical differences between the sensors. Bare board versus purpose case.
I have to say I was extremely surprised and impressed. Both readings were within a few digits of each other (610 on meter vs 607 on sensor). Any movement I made nearby would create a change in value that registered on both devices (I have four skylights surrounding bench). Taking my code loop delays into consideration etc I did think that the meter settled quicker than sensor but nothing of real note.
Moving meter / sensor closer / further apart did make quite noticeable differences. A cm or two could make a difference in readings of 40 Lux but of course I am part of the equation too and I'm not exactly static. However whatever the difference it remained consistent as I tested. With a difference of three Lux between them whilst just lying on the bench I shone a torch on them. Both increased from around 615 to around 1074 again maintaining the original difference between them.
For my needs this is more than accurate enough and FC definitely saved me a lot of time by allowing me to automate my capture.
Purely by coincidence another project came around that would be another great use of the sensor. A friend lives in a listed building so you cannot do anything at all (pretty much). They wanted some internal lights to come on in public areas if it got too dark during the day. Those that are familiar with these types of buildings know the problems faced. It isn't as simple as you might initially think. One possible solution is to use this sensor as a free standing remote, possibly linked via RF. Having everything "sleep", possibly waking up every ten or fifteen minutes and making a decision, would most likely give a battery life of many, many months.
Regards