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

heckler73

Well-Known Member
It turns out I already "hacked" a sketch for the BH1750FVI.h library (different from the the github BH1750.h version)

Code:
#include <Wire.h>
#include <BH1750FVI.h>
//VCC - 3v3
//GND - GND
//SDL - A5
//SDR - A4
//ADD - A3
 
BH1750FVI lightSensor;

void setup(){
Serial.begin(9600);
lightSensor.begin();
lightSensor.SetAddress(Device_Address_H);
lightSensor.SetMode(Continuous_H_resolution_Mode);
Serial.println("Running...");
}
//if I type this will it be blank

void loop() {
uint16_t lux=lightSensor.GetLightIntensity();
Serial.print("Solar Penis Index: ");
Serial.print(lux);
Serial.println(" Jizzers");
delay(1000);
}
It's working for me at the moment...

bh1750 sketch test.JPG

That was me hitting it with a 3W LED Maglite.
 

heckler73

Well-Known Member
I've now updated my "hack" by adding the DHT11 temp/humidity sensor and a datalogger to it. :lol:
All I need is the CO2 sensor, and I'll have a portable Grow Analyzer (basic).


Code:
#include <Wire.h>
#include <BH1750FVI.h>
#include <dht11.h>
#include<SPI.h>
#include<SD.h>

#define DHT11PIN  6
//Pin 2 of DHT11 (grill-side) to Digi 6

dht11 DHT11;
BH1750FVI lightSensor;
//VCC - 3v3
//GND - GND
//SDL - A5
//SDR - A4
//ADD - A3

const int chipSelect=4;

void setup(){
  Serial.begin(9600);
  lightSensor.begin();
  lightSensor.SetAddress(Device_Address_H);
  lightSensor.SetMode(Continuous_H_resolution_Mode);
  Serial.println("Do you have a card?");
  pinMode(10,OUTPUT);
  if (!SD.begin(chipSelect)){
    Serial.println("FUCK NO, it ain't there");
    //return;
  }
  else {
    Serial.println("yup, she's workin' ");
  }
 
  Serial.println("Running like SEE4 in a Sorority...");
}

void loop() {
  uint16_t lux=lightSensor.GetLightIntensity();
  Serial.print("Solar Penis Index: ");
  Serial.print(lux);
  Serial.println(" Jizzers");
  int chk = DHT11.read(DHT11PIN);
   Serial.print(DHT11.humidity);
   Serial.println("% Panty Sweat ");
   Serial.print(DHT11.temperature);
   Serial.println(" degC Vaginal Heat flow");
File dataFile = SD.open("datalog.txt", FILE_WRITE);
if (dataFile){
   String info = "";
    info += String(lux);
    info += "," ;
   info += String(DHT11.humidity);
   info += ",";
   info += String(DHT11.temperature);
   dataFile.println(info);
   dataFile.close();
}
delay(5000);
}
It now spits out a serial reading if I'm tethered and watching, giving me lux, RH%, and Temps, and then it assembles a string of data, comma tabulated, to save on the SD card so I can let it run remotely (with battery) and then analyze the data later.

Not bad for an afternoon, eh? It would be nice if I could clean up the code more, but I'm not sure what other tricks I can spin in there. :-?
 

Abiqua

Well-Known Member
Nice stuff Heckler!

I ran around all fucking day and got nothing accomplished..although I did find this cheap Hakko, that Im going to pick up @Doer
http://www.homedepot.com/p/Hakko-40-Watt-Soldering-Iron-Kit-in-Blue-508-1-P/204215977

I live in an area of 2 mil + people, nobody in the this motherfucker has a logic level shifter so I can use my LCD screen.....$.99 cent part wtf?

As soon as I get my shit squared I will be hopefully matching...also working on a ordering an Ethernet shield to datalog with, 2nite :peace:
 

OGEvilgenius

Well-Known Member
o_O What COB(s?) do you want on it?
Do you do this though, for real? Because I read through this and realized you know wtf you're doing and I don't (although I could probably learn).

I've been wanting to invest in a really high quality highly efficient veg lamp though. I'd probably want those Cree CXA series lamps. Whichever is best suited to a 6'6 height with a full canopy of plants.
 

Doer

Well-Known Member
Oh it is so EASY. Jstkidding.

But, I just finished designing an 800w CXB3590 for $1200 I am beginning to build it. I have a thread about it.

CXBs replace the CXAs as a much more efficient version.

So, really the beginning is costly, like all efficiency upgrades, but it pays for itself.

You really need to think watts is watts, so what watts do you want as a veg light?

Then, active or passive cooling?
 

Doer

Well-Known Member
^ $110 what i am Bill Gates ? :)

If I could afford that, I wouldn't be DIY'ing :)
Wrong. Gates DIYed because no one else could think of it. :) That/s how you get Gates in this world.

You just spent $15 again. :) And you are no closer to controlling solder than you were before.

Don't look back. You are spending $100s on Crees you can easily ruin with a cheap-o soldering pencil.

But, it is not that it won't work. It is just you have to be much more careful.

Do not use a wet sponge for cleaning for example.

Put away $5 a week and you will soon have real tools. :)
 
Last edited:

heckler73

Well-Known Member
Do you do this though, for real? Because I read through this and realized you know wtf you're doing and I don't (although I could probably learn).

I do many things...for real ;)
And your query has started my gears turning.


I've been wanting to invest in a really high quality highly efficient veg lamp though. I'd probably want those Cree CXA series lamps. Whichever is best suited to a 6'6 height with a full canopy of plants.

As Doer has pointed out, prototyping is expensive, especially with something as sophisticated as that. I actually don't know the difference between CXAs and CXBs, because it hasn't mattered to me (I have read the LED forum debates, here and there, but it becomes a pissing match after a while).
However, that is no more than a few hours research, in practical matters (I'm sure Stardustsailor or one of the other "hardcores" have a thread which will tell me plenty :mrgreen: ). What dimension of footprint are you wanting? That will determine reflector geometry and lensing requirements.
 

OGEvilgenius

Well-Known Member
Oh it is so EASY. Jstkidding.

But, I just finished designing an 800w CXB3590 for $1200 I am beginning to build it. I have a thread about it.

CXBs replace the CXAs as a much more efficient version.

So, really the beginning is costly, like all efficiency upgrades, but it pays for itself.

You really need to think watts is watts, so what watts do you want as a veg light?

Then, active or passive cooling?
CXBs it is. Toss a link to the thread. I am not looking for 800w. I think that would be overkill for a 5x5 veg tent. I'd go with active cooling (i like stuff to last) and as far as wattage goes - well, I'd estimate that somewhere in the neighbourhood of 500w would suffice, but maybe I'm being conservative? I realize veg is just as important as flowering.

Thing is I want to be able to safely plug it into a wall outlet. I think 500w is probably somewhere close to the max I'd feel comfortable. Maybe less even. But again, is this enough? I know the efficiency is off the charts with these.
 

OGEvilgenius

Well-Known Member
I do many things...for real ;)
And your query has started my gears turning.



As Doer has pointed out, prototyping is expensive, especially with something as sophisticated as that. I actually don't know the difference between CXAs and CXBs, because it hasn't mattered to me (I have read the LED forum debates, here and there, but it becomes a pissing match after a while).
However, that is no more than a few hours research, in practical matters (I'm sure Stardustsailor or one of the other "hardcores" have a thread which will tell me plenty :mrgreen: ). What dimension of footprint are you wanting? That will determine reflector geometry and lensing requirements.
Damn I could have sworn I posted a reply to this. 5x5 area. Just veg. IMO there's room for a small timer like yourself, especially if you are highly skilled, to make some ok cash on the side with these things. You don't see too many manufacturers offering COBs in their LEDs. I checked out some of the more popular models but they all seemed to be very red heavy in spectrum. I don't really intend to ever use this for flowering. I guess it could happen, but that's hardly my goal. Too much red just means I have to dump more cal mag on them and it annoys me having to do that in my dirt mix.
 

Doer

Well-Known Member
CXBs it is. Toss a link to the thread. I am not looking for 800w. I think that would be overkill for a 5x5 veg tent. I'd go with active cooling (i like stuff to last) and as far as wattage goes - well, I'd estimate that somewhere in the neighbourhood of 500w would suffice, but maybe I'm being conservative? I realize veg is just as important as flowering.

Thing is I want to be able to safely plug it into a wall outlet. I think 500w is probably somewhere close to the max I'd feel comfortable. Maybe less even. But again, is this enough? I know the efficiency is off the charts with these.

All about amps. 500w? Are you on 220v or 50v system?

500 / 120v(usa) = 4.16a Most of your circuits are 15a or 20a. See how that works?

http://www.kingbrite.cn/productsinfo.php?ID=1054&BigID=200&SubId=280

This the best source right now. They are around $50 according to the quantity.
But, you have to write to them. If they have them they ship immediately. I have 16 of the CXB3590s on DHL Carrier, right now.

I am building a water light where each module is 400w. See my Journal. I'll have a pair of 2x2 inch square tubes. But still that is only about 8.5a pull. And I will definitely plug it into a wall socket. You know a little space heater is 800w or more.

That's 8 COBs per tube on 2 Drivers (power supplies) @ 50w and about 47% efficiency.
 

OGEvilgenius

Well-Known Member
I know electricity pretty well. I have a 220v and a 120v that I use. I am in NA so having a 120v is handy. Flower is on the 220v circuit, I have my fans and veg on the 120v.

Fair enough about the wall socket. I have some limits on the amount of amps I can run through it though with fans and other things also on the same circuit.
 

Doer

Well-Known Member
I know electricity pretty well. I have a 220v and a 120v that I use. I am in NA so having a 120v is handy. Flower is on the 220v circuit, I have my fans and veg on the 120v.

Fair enough about the wall socket. I have some limits on the amount of amps I can run through it though with fans and other things also on the same circuit.
Yeah. I figure 30 amps for a grow room. And I need two circuits. I'm hoping to do with less using LED.
 

Abiqua

Well-Known Member
Still trying to find my iron.....lost track of it, got everything else, ready to fire up this fucking 1750....two nite

Haven't forgetten.....:joint:
 

Abiqua

Well-Known Member
@heckler73

Hopefully you can clear this up, technically I still a newb at this :)

Got the header soldered on.....and after reading all the various codes [ yours and a couple I have saved]....I realized this is a 3.3v.....I noticed you have vcc going to 3.3v but are the data lines still getting 5v? or do they need to be pulled down as well?
Wanted to clear this up before I program...:peace:
P1130736.JPG
 

heckler73

Well-Known Member
@heckler73

Hopefully you can clear this up, technically I still a newb at this :)

Got the header soldered on.....and after reading all the various codes [ yours and a couple I have saved]....I realized this is a 3.3v.....I noticed you have vcc going to 3.3v but are the data lines still getting 5v? or do they need to be pulled down as well?
Wanted to clear this up before I program...:peace:
View attachment 3395140
Did you solder it upside down? o_O Not that it matters if you don't care.

The data lines all go to ANALOG channels, hence the A3, A4, A5 (Pins I used in the code). I'm not sure why one would hook a 5V DC supply to them. :-?
Have you studied the datasheet for the BH1750?
If not, you should give it a once over, just so you can see how it functions.
 

Abiqua

Well-Known Member
Did you solder it upside down? o_O Not that it matters if you don't care.

The data lines all go to ANALOG channels, hence the A3, A4, A5 (Pins I used in the code). I'm not sure why one would hook a 5V DC supply to them. :-?
Have you studied the datasheet for the BH1750?
If not, you should give it a once over, just so you can see how it functions.
Did I solder the header upside down? :joint: ....oh well it works for my purposes of mounting.....and I have looked at the datasheet, so I have a little better handle....

I think where I was confused is with the Nokia 5110 screen I have been putting together..... but it is all digital pins and the shift register business had me all confused....but I think I have it all figured out....

Up and running....but my Datalogging shield order fell thru.....any ideas on saving data thru the serial port? Seems like it is an option, but can't find much written up on it...:peace:

P1130750.JPG
 

heckler73

Well-Known Member
I imagine there is a way to do it, after all, it is sending the data through the serial. That's why I used LabView prior, because it allowed me to save the data.
However, without such an interface, it may need a separate program, unless the Arduino can open a file on the HD and save it there.

There are some ideas here:
http://forum.arduino.cc/index.php?topic=6464.0
Not sure if the more dated solutions work, though. I like the idea of using "Processing" (the GUI counterpart for the Arduino). If you haven't played around with that program, you should. Start with the basic tutorials, and you can probably find a solution from there.
 
Top