Let's make a LUX Meter! (BH1750 + Arduino + LabView2013 = ERECTION!)

heckler73

Well-Known Member
Okay...it's time to take this thread to a higher level.
So, a LUX meter is fine and dandy, but wouldn't it be nice to have something closer to this magical PAR crap people fawn over. Beyond that, how about a calibrated McCree-Inada meter?

For review, what are we working with, and what's the goal ?
CXB3590-PSR-BH1750.jpg
The BH1750 spectrum is in green, and the McCree-Inada curve in purple. Now while the general shape of the BH1750 is fairly nice for the PAR rectangle, it is missing the outer parts near 400 and 700nm. What can one do in the face of that? It would be nice to have a way to measure those parts and sum them with the BH1750, right? Then one could be working with a tool which is closer to a LiCor head without the expense.

Well...LEDs to the rescue. They are quasi-solar cells after all:

Cookie Crumbs.jpg

What this collage shows is the effect of light on the voltage output of LEDs, in reverse.
The lights being tested consist of two 430nm blues with one warm white (3000K IIRC) running at ~500mA.
The LEDs exposed to the light mix consist of 3 430nm chips. As one should be able to to see (although some people are asleep at the switch in other sections, granted it is early morning :lol: ), the 430nm "receivers" are picking up a discernible and far from negligible voltage.
So there is the basic premise. Bolster the BH1750 with LEDs as side-receivers, calibrate them to known devices (like the LEDs themselves), and then apply the necessary scalars or powers in the Arduino code to spit out a summed approximation of whatever normalized spectrum desired (be it PAR or McCree, etc...). It's possible to turn it into a menu item. Measure PAR, McCree, BBR, and whatever else the imagination can cook up into code.


I suspect the calibration part is going to be the most tedious, requiring several runs with different LEDs just to get a basic data set from which to define an I-V characteristics curve WRT photon density...
 
Last edited:

heckler73

Well-Known Member
The most exciting phrase to hear in science, the one that heralds new discoveries, is not “Eureka” but “That's funny...” —Isaac Asimov (1920–1992).
I've managed to set up an experiment in LabView2014 (FFS it was < CDN$30 for the student edition ! :lol: I figured now is as good a time to get it as any)
It is capable of measuring a manual voltage-sweep of a test source, and displaying the I-V characteristics on an XY-graph, as well as reading the voltage output from the Rx (receiver) LED. I've been trying to get a 3D graph to work which will display all 3 in relation to each other, but have been hitting walls in getting it to function beyond a spastic, datum.

sigh...I'll figure something out. I could just plot the current of the Tx (transmitter) LED against the voltage of the Rx LED, which will at least give some manner of visually comparing the data to intuit correlations.

But a 3D graph is much sexier. I suppose another method is to just dump the data into IGOR and process it in there, but having real-time feedback is always nice in science. Hopping back and forth is a hassle, but whatever must be done, must be done... (to be continued in follow-ups)

To that end, I did notice something "funny" while benchmarking the 430nm Rx LEDs .
Measuring their response in the sun could be a way to "bin" one's LEDs, quickly and painlessly.
When I went outside to measure the response with a DMM, I was mucking around under diffused sunlight through a fairly dense--but not dark--cloud.
I had three LEDs on a string in series (the same ones in the cookie collage), and was just testing one at a time.
I hooked up the first one in the chain, and played around with angle, trying to find the normal plane to maximize readings. I noticed it going up and down as the sun danced behind the cloud, varying maybe 30mV in the process... took notes and datum.
Hooking up the 2nd one wasn't much of a surprise...very similar in response to the first, perhaps a slightly different equilibrium voltage in relation (0.86V vs. 0.78V) but generally the same action.

Then the sky opened up briefly, and I was able to get some fuller sun where I could feel the IR more, to which the 2nd LED started going up as well. I unfortunately did not write down the value, but it did hover around 1.3V IIRC; however, the sun quickly faded behind some clouds, to where I only had shadowless diffusion again.

But that didn't stop the following "that's funny" moment. I tried the 3rd LED in the string. Under diffuse light, it was putting out 1.158 V !!! I thought, "there must be something wrong", so I quickly jumped back to the 2nd LED to check. Nope, it's still showing ~0.8V.

It was that point where the LEDs in my head began to flicker. But the light was blasted into full current as the sun then opened up and showed me for a brief moment the power of the point. 1.680 V under a sun which cast well-defined shadows with a definitive "heat" and as the sun's intensity weaved and wobbled, the readings followed along but stayed high.
Still not what I would call full sun, and therefore I can only consider these tests as being crudely preliminary. There could also be a bias from the actual lenses, considering the likelihood of their cheapness in manufacture.
However, the results are no less encouraging.

Summary (all 430nm SCs):
LED1--0.778 V (thick cloud)
LED2--0.858, 0.880 V (thick cloud)
LED3--1.680 V (Strong Sun, but not full) , 1.158, 1.121 V (thick cloud)

The greater takeaway from this trial is to make sure to calibrate your tools carefully, if one is trying to build a PARduino meter or whatever. This clearly demonstrates a lack of homogeneity in production, which is why "pros" bin their LEDs (while charging the consumer extra for the service).
In a sense, this is just a Hobo-tech trick to compare threshold voltages of LEDs. But a threshold voltage reading is a static point. It does not describe the response well, and that is where the variables will determine photon flux characteristics.

Furthermore, by measuring the sun, one can use published spectral intensity data for calibration. It still won't be as refined as a spectrometer, but since monochrome LEDs will play within a 20-50nm bandwidth, it should be good enough to determine those final scalars required in the grand summation.

Then I ponder the why, some more. Is there a point in doing this, if all it winds up accomplishing is to demonstrate the efficacy of using a TCS230 (or TCS3200)?
I suppose there are some positive externalities in researching the individual response characteristics of the LEDs, but as far as a PARduino project is concerned, I feel like it might be wasted effort.
Hmmmm.... trade-offs and risk-reward. :-?

Perhaps I should jump over to the TCS230 and explore its nature, first, to see if it can be applied successfully. That is an unusual chip, and what exactly is a "clear LED" ?
What mysterious and befuddling devices hath thou wrought, oh human?
That way if it doesn't work out, the "discrete" pursuit can be resumed.
Yet, there is already this work sitting on my desk...it would be dumb not to at least explore the response of the LEDs used prior, to see how these "sun" metrics translate to the bench-top.

Compromise...:lol:

ERRATA: in the prior post, I had stated the current as ~500mA. It should have read ~50mA (closer to 80, actually). I was limited in resistor choices, but have found some higher rated, low ohm resistors for follow-up experiments at more realistic levels.
 
Last edited:

heckler73

Well-Known Member
Okay...so I ran two trials on each LED from earlier (i.e. 1, 2 & 3) at a separation distance of ~22mm using a TP tube I cut to length as a spacer and got the following:

LED Rx1.jpg
LED Rx2.jpg
LED Rx3.jpg
Geez, those don't look like they turned up well in the transfer. But good enough for this purpose.
As can be seen, the "receiver" properties of the 3 LEDs are quite different.
That 2nd one is peculiar, especially, which is not what I expected, based on the surprise from #3 in the sun.
What's the takeaway from this? I'm still not sure. It's going to require more pondering, but the graphical data is now there for anyone to abuse. Here's the LabView schematic (for what it's worth):


LED chars VI .JPG
 

heckler73

Well-Known Member
630nm LED trials...
I took 3-630nm LEDs outside to test in the sun (I'd say 90%...clear sky, but a faint mist in the atmosphere).
I also re-tested the 430nm set to see if anything was different with those (and to provide a comparative dataset).
I numbered the LEDs I, II, & III.
The tests at max intensity (pointed towards sun) gave:

I -- 1.544 V
II-- 1.552
III-- 1.550

Then testing to normal surface (i.e. parallel to gravity),
I--1.524
II--1.534
III--1.528

I then retested the 430nm Blues at surface normal and max intensity, respectively
I--0.750 , 0.870 (??)
II-- 0.720, 1.145
III-- 1.075, 1.403

This series gives a reference to the change in intensity relative to when I first benchmarked them earlier in the week. Note they have not been abused with any currents. Their occupation has been strictly as passive receivers, so it is not likely any "breakdown" has occurred.

Restesting the Reds at surface normal (having been >30mins since first test

1.534, 1.534, 1.531 for I, II & III
I'm pleasantly surprised with the uniformity of the samples I chose (just random from a bag of 10).
Following this base data gathering, I set up the experiment as per the prior trials, with the same 22mm TP-tube spacer, except using a random 630nm instead of the 430nm tester from the original series.

What happened next tweaked my head...

630nm Red Rx3.jpg
I haven't tested the other two, yet. I wanted to post this weird result, which I actually verified several times to make sure I wasn't imparting any indirect biases. The first trial was a gentle cycle through the limits (Arduino shits a brick when the input voltage crosses 5V at any point), garnering ~2000 samples.
The 2nd one was more carefully swept with 3 cycles, which yielded on the order of 6000 samples. The effect is definitely visible.
Note also the higher current achieved with the Red. It makes me wonder what's happening with my blues.
Was I sold some shit?
Based on this specsheet, I'd say yes ! :cuss:


 
Last edited:

heckler73

Well-Known Member
While meditating on what to do with the 1W Blues I now possess (maybe I'll just run them on their own lines in the grand scheme or re-educate them into a desk lamp) I thought about what the red LED is doing.

This picture is what immediately popped into mind after the data was processed:

Carrier Concentration -- Schubert.JPG
It seems to me, the data is directly showing where the maximum efficiency is located.
However, this is a steady state condition (from the perspective of the LED itself).
It is perhaps one of the main reasons why running LEDs at a lower voltage (ergo, current) will have a greater lumen per Watt output over the "recommended" operating levels. However, that is only an intuitive hypothesis. It will require more trials to examine the effect (if it is endogenous).


Regardless, this is just an addendum to the weird result obtained, clarifying (muddying? :lol: ) why it caused LEDs in my head to flicker in the first place...those damned Boltzmann statistics, I tells ya'.
 

heckler73

Well-Known Member
I worked all through the night in near darkness, but success is mine ! :lol:

And it even worked on the first try!

Protected Pulser.jpg
I assume it looks as blurry as I think it is; however, it is the first part, and perhaps most critical, in my grand scheme.
It is a circuit which will help make up for the fact the Arduino is not capable of high-speed interaction when loaded down.
What it does is take a positive trigger from its input (provided here by the switch), and sends it through a tied NOR (74LS02), then onto a couple monostable multivibrators (74LS123) with pulse widths (and lockout) being set with a couple tantalum caps and resistors.
That subcircuit then feeds the input of another NOR which sends out the pulse to an IRF520 MOSFET, connected to 2 LEDs (3W Warm White).
The beauty is, it can be fed with any clock signal (I need to salvage a 555 or some equivalent), but the protection cct. locks out retriggers until the 2nd Mono Mult is done.

To test it, I cranked my PSU to "11" (basically 1.2Amps and ~20 Volts) and fired it through the LEDs...

Over...

and OVER

AND OVER AND OVER !!!! MUAHAHAHAHAHAHAhahahahaha




And yes, there was much blinding brightness.


I love the smell of progress as the sun rises...
time for some coffee, and the planning of stage 2...feeding it a clock!


Happy Mothers (of Invention) Day.
(even if early)


 
Last edited:

drspastic

Member
leds really do some odd stuff. i have had them oscillating at less than 0.2 hz and going in and out of conductivity while in series. great idea about photosensitivity binning. i will set up a stable bench light source and test jig.

check this out:
 
Last edited:

heckler73

Well-Known Member
That video unfortunately offered no information.
How were those LEDs hooked up (i.e. what is "series parallel")? What was the PSU used? What is the capacitance? etc.
He's possibly under-driving the LEDs, so the current is alternating based on the variable & thermal nature of the resistance (coupled with inherent capacitance to lay the foundations of an oscillator cct.)
But again, who knows? He doesn't...
You should post that vid in the LED forum, and see what they say in there. I bet a lot of wild hypotheses will be put forth :lol:
 

drspastic

Member
Series parallel in this case is (two banks of (5 in parallel) in series) hence all driven by the 2 wires in the centre. Capacitance and driver matters little. Any series arrangement should have all series elements flash together (if at all assuming no other instability)
 

GrowUrOwnDank

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):
View attachment 3128625


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.


View attachment 3128619 View attachment 3128618
This is what it looks like in the VI for LabView:
View attachment 3128622


And a sample of the output from the Front Panel of Labview (all the gauges, charts etc. go there):
View attachment 3128620

So I fired it up and let it run while I mowed the lawn:
View attachment 3128621
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):


View attachment 3128623
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...


View attachment 3128624
You're gonna hurt your brain man. Ever wonder why athletes don't last past 35? Hello. Spread it out a little. Hold back some so when you old and ain't feeling so hot, you can just cut and paste it from your phone and keep people interested. You just need some love bro. Coming your way. ;-)
 

heckler73

Well-Known Member
You're gonna hurt your brain man. Ever wonder why athletes don't last past 35? Hello. Spread it out a little. Hold back some so when you old and ain't feeling so hot, you can just cut and paste it from your phone and keep people interested. You just need some love bro. Coming your way. ;-)
:lol:
oooooo-kaaaaaay. o_O
Thanks for the sentiment, but I think I'll be alright.
 
Top