heckler73
Well-Known Member
I needed a break from the books, so I decided to figure out how to make a Lux Meter using a component called the BH1750 (attached is the data sheet, hopefully). Now there are plenty of tutorials on how to do it using the Arduino text method (yawn...coding), but I wanted to figure out how to do it using LabView (which can be downloaded as an evaluation, and you get it for 6 months if you're a student).
Now there is an impracticality with this, in that (for now) the Arduino needs to be tethered via USB to the computer. But I got it working on my notebook, so it's not exactly a resource pig.
It is possible to use WiFi or bluetooth, but I don't have those attachments yet.
Anyway, here is the result (after processing data in Igor Pro):
That spike was me screwing around staring into the sun through two planes of glass, and a bamboo shade (with gaps in it). However, the first thing one needs to do is look at the datasheet for the component one wishes to access.
Communication with the BH1750 requires sending byte requests (I believe the colloquial term is "bit-banging") and reading two bytes of data (Hi-byte and Lo-byte), combining them into a 16-bit integer, dividing by an appropriate ratio for the light source, then displaying and logging the data. But note the spectrum limitation on this component.
This is what it looks like in the VI for LabView:
And a sample of the output from the Front Panel of Labview (all the gauges, charts etc. go there):
So I fired it up and let it run while I mowed the lawn:
Yup, there were some clouds while I was working outside. But it made for comfortable, sweat-free operation.
So I decided to see what it looked like to point the sensor directly at the Sun (through the aforementioned filtering):
WHOA! Even through all that, I was still hitting >1000 Lm m^-2!!!
And then I put the sensor back in place, where it was measuring the ambient light, and watched as the sun faded over the hill...
Now there is an impracticality with this, in that (for now) the Arduino needs to be tethered via USB to the computer. But I got it working on my notebook, so it's not exactly a resource pig.
It is possible to use WiFi or bluetooth, but I don't have those attachments yet.
Anyway, here is the result (after processing data in Igor Pro):
That spike was me screwing around staring into the sun through two planes of glass, and a bamboo shade (with gaps in it). However, the first thing one needs to do is look at the datasheet for the component one wishes to access.
Communication with the BH1750 requires sending byte requests (I believe the colloquial term is "bit-banging") and reading two bytes of data (Hi-byte and Lo-byte), combining them into a 16-bit integer, dividing by an appropriate ratio for the light source, then displaying and logging the data. But note the spectrum limitation on this component.
This is what it looks like in the VI for LabView:
And a sample of the output from the Front Panel of Labview (all the gauges, charts etc. go there):
So I fired it up and let it run while I mowed the lawn:
Yup, there were some clouds while I was working outside. But it made for comfortable, sweat-free operation.
So I decided to see what it looked like to point the sensor directly at the Sun (through the aforementioned filtering):
WHOA! Even through all that, I was still hitting >1000 Lm m^-2!!!
And then I put the sensor back in place, where it was measuring the ambient light, and watched as the sun faded over the hill...
Attachments
-
378.6 KB Views: 50