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

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):
Whole thing.png


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.


BH1750 Spectrum.JPG BH1750 Light Source.JPG
This is what it looks like in the VI for LabView:
LV VI BH1750.JPG


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

So I fired it up and let it run while I mowed the lawn:
Lawn Mow.png
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):


Sun Stare.png
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...


Sunset.png
 

Attachments

heckler73

Well-Known Member
And then there was the question, "why the fuck did you do this?"

I wanted to test my LED Multichip, to see if it really had as much power as I suspected.
My first concern is the spectrum. Since the multichip looks like this,


Chip or COB.jpg

and I'm dealing with this,
BH1750 Spectrum.JPG

I figured I wouldn't necessarily get a true value of the LEDs being they are dominant in the 630nm range.

However, here is what I got with the following setup:

IMG-20140414-00010.jpg MC LED1.png

Not bad, eh?
But at 7" higher?

IMG-20140414-00011.jpg MC LED2.png

FUCK YEAH!
So whoever thinks LEDs don't have da ballz to get it done, think again.
They require different techniques than HPS/MH or sun, though. Case in point? Look at Subcool going through the learning curve in his Weed Nerd vids (I still don't get why LUSH is hard for Blue LEDs...)
 

Attachments

heckler73

Well-Known Member
Interesting data! Good job, Heckler...
It's not bad as a basic "intensity detector" for analyzing grow rooms, but it's no Jaz Spectrometer...

However, I wouldn't need much more than this to make one
;)
Detector: Sony ILX511B linear CCD array (200-1100 nm)
But the inspiration for this project (a gentleman from an aquarium forum), when making his own meter, DID manage to test a proper PAR head from an "expensive" meter ($400 type) and he got essentially the same values; although, he wasn't using a BH1750. I think he used an even less accurate part. So I'm pretty content, and I think the original specs of my light had comparable values to what I measured.

However, I do need to analyze the data more, and it would be optimum if I can find someone to calibrate against.
I also have a different type of sensor which I need to play with, that has the ability to separate RGB, supposedly. So I'll be curious if those measurements can be refined.

I also need to get my DHT11 (temp and humidity sensor) working. Ironically, it seems easier to program an I2C circuit (like above) in LabView than a simpler component, which is counter-intuitive based on how difficult it is (for me, at least) to program the Arduino text interface for i2c communication.
 

Abiqua

Well-Known Member
@heckler73

are you still messing around with this at all? I just now started a Forum wide search for Arduino threads and don't know how I missed this!

I have a 1750 arriving soon
I also have photoresistor...[link in sig] where I found the lux conversion math in a library...from analog only...haven't ever done a light reading in Digital....yet?

I am also going to attempt to copy and [maybe] refine something like this for a DIY PAR....but I have a couple of diodes w/filtering in mind as well :peace:
http://www.plantedtank.net/forums/showthread.php?t=823705

It would awesome to be able to compare readings from a common source to calibrate...:joint:
 

Doer

Well-Known Member
@heckler73

are you still messing around with this at all? I just now started a Forum wide search for Arduino threads and don't know how I missed this!

I have a 1750 arriving soon
I also have photoresistor...[link in sig] where I found the lux conversion math in a library...from analog only...haven't ever done a light reading in Digital....yet?

I am also going to attempt to copy and [maybe] refine something like this for a DIY PAR....but I have a couple of diodes w/filtering in mind as well :peace:
http://www.plantedtank.net/forums/showthread.php?t=823705

It would awesome to be able to compare readings from a common source to calibrate...:joint:
It does look like the linked project, just needs a bit more filtering and isolation, maybe some power factor correction.
 

Abiqua

Well-Known Member
It does look like the linked project, just needs a bit more filtering and isolation, maybe some power factor correction.
@Doer tell me what you are thinking about the power isolation, has me curious!

Filtering seems to be straight forward as far as materials, but making it work with the diodes, seem to be the trouble??? dunno...:peace:
 

heckler73

Well-Known Member
@heckler73

are you still messing around with this at all? I just now started a Forum wide search for Arduino threads and don't know how I missed this!

I have a 1750 arriving soon
I also have photoresistor...[link in sig] where I found the lux conversion math in a library...from analog only...haven't ever done a light reading in Digital....yet?

I can see how you'd miss this thread. My posts are pretty dry and obscure, so they get buried pretty quick :lol:
I did see your project link before, but I forgot I had used the same component.
I guess I should go give it a read? :mrgreen:


It would awesome to be able to compare readings from a common source to calibrate...:joint:

That is how citizen science operates ;) I'll be glad to fire up my hobo-lux ®© meter when you want to get down to some dirty work. Although, I don't have access to LabView anymore (unless I fork out $75 or so...I might do that), so I'd have to code it.
Anyway, I'll go take a look at what you're doing first.
 

Doer

Well-Known Member
I can see how you'd miss this thread. My posts are pretty dry and obscure, so they get buried pretty quick :lol:

That is how citizen science operates ;)
Oh, heck, it's just that you don't know how to make friends, like I do.

And we all thank you for that. :)

It used to be solely a Gentleman's avocation, and now Science is for CITIZENS!

Lv it.
 

Doer

Well-Known Member
I just bought the most expensive app I ever had. $8!

LuxMeterPro Advanced by AM PowerSoftware

It read out in watts among other things, and has different calibrations for different sources.

It has a digitized spectral graph and average color temperature.
 

Abiqua

Well-Known Member
I can see how you'd miss this thread. My posts are pretty dry and obscure, so they get buried pretty quick :lol:
I did see your project link before, but I forgot I had used the same component.
I guess I should go give it a read? :mrgreen:



That is how citizen science operates ;) I'll be glad to fire up my hobo-lux ®© meter when you want to get down to some dirty work. Although, I don't have access to LabView anymore (unless I fork out $75 or so...I might do that), so I'd have to code it.
Anyway, I'll go take a look at what you're doing first.
Saweet....I haven't updated in a couple of weeks but just used a cheap LDR from Keyes, which has an ok light curver, not great....don't have a lux meter to calibrate to...lol, that's why the BH1750 is on the way...but I have been waiting over 6 weeks now...geez

What is LabView?...I have heard of it in passing, and I am guessing it is an API of sorts, was it all that great for a Pay? I think I could base an API off Java from scratch, or after a few refresher tutorials....

^ Yeah, I started my blog, because I don't really know where to place an Arduino thread......and all the one's that have been started get no play, shame :peace:
 

heckler73

Well-Known Member
Saweet....I haven't updated in a couple of weeks but just used a cheap LDR from Keyes, which has an ok light curver, not great....don't have a lux meter to calibrate to...lol, that's why the BH1750 is on the way...but I have been waiting over 6 weeks now...geez

That is a long wait. I'd contact the supplier.


What is LabView?...I have heard of it in passing, and I am guessing it is an API of sorts, was it all that great for a Pay? I think I could base an API off Java from scratch, or after a few refresher tutorials....

LabView is an interface package for DAQs (Data AQuisition devices) from National Instruments. It turns out the Arduino makes for a good little one on the cheap. "Professional" ones start at $100+ and hit $500 a pop without sweating :lol:

http://www.ni.com/data-acquisition/

^ Yeah, I started my blog, because I don't really know where to place an Arduino thread......and all the one's that have been started get no play, shame :peace:

I noticed Stardustsailor also started playing with them, recently. It's good to see it being incorporated more.
Anyway, since you're still waiting for your BH1750
maybe I'll tackle coding it this weekend.
 

Abiqua

Well-Known Member
Well, I didn't say power isolation. And I mean light frequency isolation. :) And now I am wondering if you mean filtering noise from the signal path?

Or are you taking about spectrum filtering at the aperture to your photo-diode? Using UVIR cut, filter plates you can avoid swamping your diode
http://rocoes.com.tw/2008e/optical/ircut.htm
Your right, big time freudian slip fuck up on my part.....and yes filters seem mandatory on every diode that I have come across...and I spent the better part of last weekend going thru 2K entries worth of photodiodes from everyone...and few [more expensive than an Apogee or Scout meter]....so DIY would be pointless....I have to read that rocoes link ^^^^

But I have two ideas at the moment...

1 is maybe using the Taos TCS 3200
http://www.jameco.com/1/1/47893-sen0101-tcs3200-color-sensor-power-2-7v-5-5v-components.html

But it might be lacking too much in the blue region and it might not be sensitive enough across each spectrum RGB, but against the clear diode, a baseline similar to an Apogee, might be able to be created???
taos 3200.jpg


2nd, is to take a couple of photodiodes and create my own version of the 3200 that uses a better blue and green sensing diode and maybe another "clear' with more blue spectrum in the white light to even out the other "clear" diode..just trying to achieve more of even baseline like the Rocoes, but DIY......if its get to be a project over $75, it is practically not worth it....imho :peace:
 

Abiqua

Well-Known Member
@heckler73

It is an Ali Express order, that was probably ordered a week before the Chinese New Year and I am on the West Coast and they are probably still going thru a backlog of unloading....since they had effectively a soft strike on the West Coast US ports from Feb to early March

It sucks, and normally after 4 weeks I would get a refund, but I let this one play out...I did get the other two items ordered at a similar time, so hopefully it is close :peace:
 

heckler73

Well-Known Member
But it might be lacking too much in the blue region and it might not be sensitive enough across each spectrum RGB, but against the clear diode, a baseline similar to an Apogee, might be able to be created???
View attachment 3381439
:lol:
I have that sensor, too. I've never fired it up, though. The BH1750 was good enough for what I wanted at the time.
Well, I guess we can collaborate on that, too. :mrgreen:
 

Abiqua

Well-Known Member
:lol:
I have that sensor, too. I've never fired it up, though. The BH1750 was good enough for what I wanted at the time.
Well, I guess we can collaborate on that, too. :mrgreen:
Speak of the muthafuckin devil...showed up today......also forgot I have this LDR with a TI LM393 and the adjustable resistor...

problem is I dont have a soldering station except for a Cheap waller, so I need to source something to get this header on...damn it :peace:

1750 and the other one.jpg
 

heckler73

Well-Known Member
Speak of the muthafuckin devil...showed up today......also forgot I have this LDR with a TI LM393 and the adjustable resistor...

problem is I dont have a soldering station except for a Cheap waller, so I need to source something to get this header on...damn it :peace:

View attachment 3382431

I recall having to solder mine, too. I just use a cheap, switchable 15/30W and file a fine tip on it (tinned, of course). As long as you heat the pin, and not the pad, you should get a good joint without frying components. I use eutectic solder, though, not 60/40.
 

Doer

Well-Known Member
Speak of the muthafuckin devil...showed up today......also forgot I have this LDR with a TI LM393 and the adjustable resistor...

problem is I dont have a soldering station except for a Cheap waller, so I need to source something to get this header on...damn it :peace:

View attachment 3382431
Don't look back. :)
http://www.adafruit.com/products/1204
Digital Genuine Hakko FX-888D (936 upgrade) - FX-888D
PRODUCT ID: 1204
$109.95
IN STOCK


Don't forget to clean, and re-blob the solder on the tip to encase it as it cools.
These tips are a bit more pricey than the Weller crap. :) Don't leave the tip unprotected to corrode in the air.
 
Top