Introduction
Light sensing is a crucial aspect of various electronic applications, from energy-efficient lighting to environmental monitoring. The BH1750 Light Intensity | Arduino Tutorial is a powerful Project that enables accurate measurement of ambient light levels. In this comprehensive guide, we will explore the working principles and capabilities of the BH1750 sensor. Furthermore, we will learn how to Interface BH1750 Light Intensity Sensor with Arduino Nano to create a light sensing system. By the end of this tutorial, you’ll possess the knowledge and skills to incorporate the BH1750 Light Sensor into your projects, allowing them to respond intelligently to changing light conditions. Let’s dive into the realm of light sensing with Arduino Nano and unlock the potential of the BH1750 Light Sensor!
Hardware Required
You will require the following Hardware Components for interfacing BH1750 Light Intensity Sensor with Arduino Nano.
Components | # | Buy From Amazon |
---|---|---|
Arduino Nano | 1 | Buy Now |
BH1750 Light Intensity Sensor | 1 | Buy Link |
37 in 1 Sensor kit (Optional) | 1 | Buy Link |
9v DC Adapter (Optional) | 1 | Buy Link |
Jumper Wires | 4 | Buy Link |
Breadboard | 1 | Buy Link |
What is BH1750 Light Intensity Sensor?
The BH1750 Light Intensity Sensor is a celestial observer in the Arduino cosmos, designed to measure the intensity of light in lux. With its ethereal precision, it transforms the dance of photons into a language that Arduino comprehends—the language of illumination.
Pinout
Pin Configuration of BH1750 Sensor
Pin | Description |
---|---|
VCC | Module power supply: 2.4V to 3.6V, typically 3.0V. |
GND | Ground, connected to ground of the circuit |
SCL | Serial Clock Line provides clock pulses for I2C communication. |
SDA | Serial Data Address for data transfer in I2C communication. |
ADDR | Address pin selects module address in a multi-module setup. |
Specifications
- Measurement Range: The BH1750 sensor typically has a measurement range suitable for both indoor and outdoor light conditions.
- Digital Output: The sensor provides digital output, making it easy to interface with microcontrollers like the Arduino Nano.
- High Accuracy: The BH1750 offers high accuracy in light-intensity measurement, allowing for precise adjustments.
Features
- Lux Measurement: The sensor measures light intensity in lux, a unit that accounts for the human eye’s sensitivity to different wavelengths.
- Auto-Adjustment: It enables devices to automatically adjust lighting or display settings based on changing light conditions.
- Compact Size: The small size of the BH1750 sensor makes it easy to integrate into various projects.
Circuit Diagram
The following circuit shows you the connection of the BH1750 Light Intensity | Arduino Tutorial with Arduino Please make the connection carefully
Circuit Connections
Arduino | BH1750 Sensor |
---|---|
VCC | 5V |
GND | GND |
A5 | SCL |
A4 | SDA |
Installing Arduino IDE Software
First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow
Installing Libraries
Now when you are Ready to upload the code, to the Arduino Board you will need first to add the Following Libraries in Arduino, If you Learn How to add the library in the Arduino step-by-step guide click on how to install the library Button given Blow
Code
//For more Projects: www.arduinocircuit.com
#include <Wire.h>
#include <BH1750.h>
BH1750 lightMeter;
void setup(){
Serial.begin(9600);
lightMeter.begin();
}
void loop() {
uint16_t lux = lightMeter.readLightLevel();
Serial.print(“Light: “);
Serial.print(lux);
Serial.println(” lx”);
delay(100);
}
Explanation
Let’s understand the code step by step:
- First, we include the Wire library for I2C communication and the BH1750 library.
- Next, we create an instance of the BH1750 class called “lightMeter”.
- In the setup function, we initialize the serial communication and call the begin function of the lightMeter object.
- In the loop function, we read the light intensity using the readLightLevel function and store it in the “lux” variable.
- We then print the light intensity in lux units using Serial.print.
- Finally, we add a delay of 1 second before repeating the process.
Testing
To test the BH1750 light intensity sensor, follow these steps:
- Connect the Arduino to your computer.
- Upload the code to the Arduino.
- Open the Serial Monitor in the Arduino IDE.
- You should see the light intensity values in lux being printed every second.
- Try shining a light source on the sensor and observe how the values change.
Applications
- Smart Lighting Systems: BH1750 enables Arduino to create responsive lighting systems that adjust based on ambient light conditions, fostering energy efficiency.
- Weather Stations: Utilizing BH1750, Arduino can gauge daylight levels for comprehensive weather monitoring.
- Greenhouse Automation: Arduino, guided by BH1750, ensures optimal light conditions for plant growth in a greenhouse.
- Artificial Intelligence in Robotics: BH1750 aids Arduino-powered robots in perceiving and reacting to changing light environments.
- Energy-Efficient Homes: BH1750, in collaboration with Arduino, contributes to smart homes by adjusting artificial lighting according to natural light availability.
Conclusion
In this tutorial, we have learned how to measure light intensity using the BH1750 sensor and Arduino. You can now use this sensor in your projects to automate lighting systems, monitor ambient light levels, or create interactive lighting effects. Have fun experimenting!