Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Lima Moreira
Published © GPL3+

How to make a Luxmeter with Arduino and BH1750 Module

You'll learn how to make a luxmeter with Arduino and BH1750 Module.

BeginnerFull instructions provided2 hours7,156
How to make a Luxmeter with Arduino and BH1750 Module

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
Breadboard (generic)
Breadboard (generic)
×1
BH1750 Luxmeter Sensor Module
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Custom parts and enclosures

Enclosure of the project

Schematics

Gerber file of the Project

Electronic Schematic

Enclosure in PDF File

Code

Code of the Project

Arduino
// Bibliotecas
 #include <Wire.h>
 #include <BH1750.h>
 #include <LiquidCrystal_I2C.h>
 LiquidCrystal_I2C lcd (0x27,2,1,0,4,5,6,7,3,POSITIVE);

 // definiçao de objeto
 BH1750 sensor;
 
void setup() 
{
  // velocidade de comunicação serial
  Serial.begin(9600);
  Wire.begin();
  sensor.begin();
  Serial.println(" Monitoramento de luminosidade sensor BH1750 ");
  lcd.begin(16,2);
  lcd.setBacklight(HIGH);
  lcd.setCursor(2,0);
  lcd.print("LUXIMETRO");
}

void loop() 
{
  // variavel para leitura da luminosidade
  unsigned lux = sensor.readLightLevel();
  lcd.setCursor(2,1);
  lcd.print("LUX: ");
  lcd.setCursor(6,1);
  lcd.print(lux);  
  Serial.print(" Luminosidade: ");
  Serial.print(lux);
  Serial.println(" Lux ");
  delay(300);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("SENSOR - BH1750");
}

Credits

Lima Moreira
12 projects • 8 followers
Contact

Comments

Please log in or sign up to comment.