Electorials Electronics
Published © GPL3+

Project 017: Arduino BH1750 Light Sensor Project

A beginner Arduino project for measuring light levels utilising a BH1750 light sensor, an Arduino and a few lines of simple coding.

BeginnerProtip12 minutes21,703
Project 017: Arduino BH1750 Light Sensor Project

Things used in this project

Hardware components

DFRobot BH1750 Light Sensor
×1
Arduino UNO
Arduino UNO
You could use any other Arduino board as well. The Seeeduino v4.2 is used in this example.
×1
Jumper wires (generic)
Jumper wires (generic)
5 Male to Female Wires.
×5
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
Depends on the Arduino.
×1
PCBWay Custom PCB
PCBWay Custom PCB
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit Diagram

Schematics

Code

​Arduino BH1750 Light Sensor Project Code

C/C++
#include <Wire.h>
#include <BH1750.h>
BH1750 lightMeter;

void setup(){
  Serial.begin(9600);
  Wire.begin();
  lightMeter.begin();
  Serial.println(F("BH1750 Test"));
}

void loop() {
  float lux = lightMeter.readLightLevel(true);
  Serial.print("Light: ");
  Serial.print(lux);
  Serial.println(" lx");
  delay(2000);
}

Credits

Electorials Electronics
85 projects • 66 followers
I'm an electronic hobbyist interested in anything, from Arduino to drones. I plan to educate people with the content on my website.
Contact

Comments

Please log in or sign up to comment.