087 808 6825   0 Items

DIY light intensity meter (lux meter) project

This projects will show you how to create a lux meter. Lux is defined as 1 lumen per square meter.  This unit can be used from measuring the human visible light for photographers, distance grow lights should be from plants, the amount of sun on plants, instances where you want to see how much light reaches an area, measure light from LED’s, placing of lights to get a uniform covered area and much more.

Please note: All components with the perspex case can be bought from our website here.

Battery operated
This DIY Lux meter kit is battery operated for mobility. This unit thus needs to be power efficient. To help with this, this unit has a power button you need to hold to power on the device and take readings. Once the power button is released, power is cut and your battery will not be drained while no readings are taken. Of cause, you can change the circuit slightly and program the button to do anything like automatically switching off after 3 minutes etc. We found the current setup to work the best, from the time you press the button it will take the microcontroller to start up and take the first reading 1/2 a second.

DIY light intensity meter (lux meter) project

The modules we used.
The circuit in itself is very easy to build and require only 3 modules:

  1. Our Arduino skeleton board, it’s cost-effective and only includes the bare minimum as to not have unnecessary components draining the battery. Note, this board is a bare minimum board and does not include the serial USB chip, you will need an FTDI programmer to upload programs or what most guys do it to program the chip with the Arduino Uno. More info here. (if you buy this project in kit format here, the program is already installed on the Arduino skeleton for you)
  2. OLED screen. These little screens have high resolution and only have 4 wires to solder to the Arduino skeleton board. We sell these modules separately here.
  3. The light sensor module that uses the MAX44009 ambient light sensor. This is a great sensor that uses only 0.65μA power and can read intensity levels up to 188,000 LUX. Here is the datasheet for this module, they are also sold separately on our site here.

There is also a 9V battery clip to power your project

Putting it all together

The drawing below shows exactly how all the wires get connected to the microcontroller board.

Lux meter diy project

The program:

As I explained earlier, we do have a kit that also includes the case the project comes in but the Arduino skeleton also has this program loaded already. We include it for the guys that would like to make some changes or tinker with the program.

Before uploading this sketch make sure you have this oled library installed else it will not compile.: U8g2 library

Here is the sketch file: Lux meter sketch

Below is the full sketch:

/*
*OLED LUX_METER Skeleton
*VCC VCC VOUT
*GND GND GND
*SCL SCL A4
*SDA SDA A5
*/

#include <Arduino.h>
#include <U8g2lib.h>
#include <SPI.h>
#include <Wire.h>

int BH1750address = 0x23;
byte buff[2];

uint16_t LUX = 1;

String ABC = " LUX";

U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0);

void setup()
{
Wire.begin();
u8g2.begin();
Serial.begin(9600);
Serial.print("BH1750 Light");
Serial.print("Intensity Sensor");
}

void loop()
{
int i;
LUX = 0;
BH1750_Init(BH1750address);
delay(200);

if (2 == BH1750_Read(BH1750address))
{
LUX = ((buff[0] << 8) | buff[1]) / 1.2;
Serial.print("Intensity in LUX");
Serial.println(LUX);
}
//u8g2.begin();
String NumberStr = String(LUX) + ABC;
int DC = (NumberStr.length()) + 1;
char Number[180] = {0};
NumberStr.toCharArray(Number, DC);
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_crox5t_tf); // choose a suitable font at https://github.com/olikraus/u8g2/wiki/fntlistall
u8g2.drawStr(0, 24, Number); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
//Wire.end();
//}
delay(150);
}

int BH1750_Read(int address)
{
int i = 0;
Wire.beginTransmission(address);
Wire.requestFrom(address, 2);
while (Wire.available())
{
buff[i] = Wire.read();
i++;
}
Wire.endTransmission();
return i;
}

void BH1750_Init(int address)
{
Wire.beginTransmission(address);
Wire.write(0x10);
Wire.endTransmission();
}