Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Adafruit BH1750: Examples, Pinouts, and Specs

Image of Adafruit BH1750
Cirkit Designer LogoDesign with Adafruit BH1750 in Cirkit Designer

Introduction

The Adafruit BH1750 (Part ID: 4681) is a digital light sensor designed to measure ambient light levels in lux. It uses the I2C communication protocol, making it easy to integrate into microcontroller-based projects. The BH1750 is highly sensitive and provides precise light measurements, making it ideal for applications such as automatic lighting control, environmental monitoring, and photography.

Explore Projects Built with Adafruit BH1750

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino Mega 2560 and BH1750 Light Sensor for Ambient Light Monitoring
Image of karakterisasi bh1750: A project utilizing Adafruit BH1750 in a practical application
This circuit uses an Arduino Mega 2560 to interface with a BH1750 light sensor. The Arduino provides power to the BH1750 and communicates with it via the I2C protocol using the SCL and SDA pins. The setup is designed to read light intensity data from the BH1750 sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Light Sensor with BH1750 and Relay Control
Image of light: A project utilizing Adafruit BH1750 in a practical application
This circuit uses an Arduino UNO to interface with a BH1750 light sensor via I2C communication. The Arduino reads light intensity data from the BH1750 sensor, which is powered by the Arduino's 3.3V and GND pins.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Mega 2560 Light Sensor with LED Indicator
Image of GP: A project utilizing Adafruit BH1750 in a practical application
This circuit uses an Arduino Mega 2560 to control a red LED and interface with a BH1750 light sensor. The Arduino reads data from the BH1750 via I2C communication and can control the LED connected to a PWM pin.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based Ambient Light Monitoring with I2C LCD Display
Image of intensity: A project utilizing Adafruit BH1750 in a practical application
This circuit features an Arduino UNO microcontroller connected to a BH1750 light intensity sensor and a 20x4 LCD display, both interfaced via I2C communication. The Arduino is programmed to read the ambient light level from the BH1750 sensor and display the readings in lux on the LCD. The circuit is designed for monitoring and displaying real-time light intensity data.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit BH1750

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of karakterisasi bh1750: A project utilizing Adafruit BH1750 in a practical application
Arduino Mega 2560 and BH1750 Light Sensor for Ambient Light Monitoring
This circuit uses an Arduino Mega 2560 to interface with a BH1750 light sensor. The Arduino provides power to the BH1750 and communicates with it via the I2C protocol using the SCL and SDA pins. The setup is designed to read light intensity data from the BH1750 sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of light: A project utilizing Adafruit BH1750 in a practical application
Arduino UNO Light Sensor with BH1750 and Relay Control
This circuit uses an Arduino UNO to interface with a BH1750 light sensor via I2C communication. The Arduino reads light intensity data from the BH1750 sensor, which is powered by the Arduino's 3.3V and GND pins.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of GP: A project utilizing Adafruit BH1750 in a practical application
Arduino Mega 2560 Light Sensor with LED Indicator
This circuit uses an Arduino Mega 2560 to control a red LED and interface with a BH1750 light sensor. The Arduino reads data from the BH1750 via I2C communication and can control the LED connected to a PWM pin.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of intensity: A project utilizing Adafruit BH1750 in a practical application
Arduino UNO Based Ambient Light Monitoring with I2C LCD Display
This circuit features an Arduino UNO microcontroller connected to a BH1750 light intensity sensor and a 20x4 LCD display, both interfaced via I2C communication. The Arduino is programmed to read the ambient light level from the BH1750 sensor and display the readings in lux on the LCD. The circuit is designed for monitoring and displaying real-time light intensity data.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Automatic brightness adjustment for displays
  • Smart home lighting systems
  • Environmental monitoring and data logging
  • Photography light metering
  • Agricultural light intensity monitoring

Technical Specifications

The Adafruit BH1750 is a compact and efficient light sensor with the following key specifications:

Parameter Value
Operating Voltage 3.0V to 5.0V
Operating Current 0.12 mA (typical)
Measurement Range 1 lux to 65,535 lux
Communication Protocol I2C
I2C Address (Default) 0x23
I2C Address (Alternate) 0x5C
Resolution 1 lux
Operating Temperature -40°C to +85°C
Dimensions 18mm x 18mm x 3mm

Pin Configuration

The BH1750 sensor module has the following pinout:

Pin Name Description
1 VIN Power supply input (3.0V to 5.0V)
2 GND Ground connection
3 SCL I2C clock line
4 SDA I2C data line
5 ADDR I2C address selection (connect to GND or VCC)

Usage Instructions

Connecting the BH1750 to an Arduino UNO

To use the Adafruit BH1750 with an Arduino UNO, follow these steps:

  1. Wiring:

    • Connect the VIN pin of the BH1750 to the 5V pin on the Arduino.
    • Connect the GND pin of the BH1750 to the GND pin on the Arduino.
    • Connect the SCL pin of the BH1750 to the A5 pin on the Arduino (I2C clock line).
    • Connect the SDA pin of the BH1750 to the A4 pin on the Arduino (I2C data line).
    • Optionally, connect the ADDR pin to GND (default I2C address: 0x23) or VCC (alternate I2C address: 0x5C).
  2. Install Required Library:

    • Open the Arduino IDE.
    • Go to Sketch > Include Library > Manage Libraries.
    • Search for "Adafruit BH1750" and install the library.
  3. Example Code: Use the following example code to read light levels from the BH1750:

    #include <Wire.h>
    #include <Adafruit_Sensor.h>
    #include <Adafruit_BH1750.h>
    
    // Create an instance of the BH1750 sensor
    Adafruit_BH1750 lightMeter;
    
    void setup() {
      Serial.begin(9600); // Initialize serial communication
      while (!Serial) {
        delay(10); // Wait for the serial port to connect
      }
    
      // Initialize the BH1750 sensor
      if (!lightMeter.begin()) {
        Serial.println("Error initializing BH1750 sensor!");
        while (1) {
          delay(10); // Halt execution if initialization fails
        }
      }
      Serial.println("BH1750 sensor initialized.");
    }
    
    void loop() {
      // Read light level in lux
      float lux = lightMeter.readLightLevel();
      if (lux < 0) {
        Serial.println("Error reading light level!");
      } else {
        Serial.print("Light Level: ");
        Serial.print(lux);
        Serial.println(" lux");
      }
      delay(1000); // Wait 1 second before the next reading
    }
    

Important Considerations

  • I2C Address Selection: Ensure the ADDR pin is correctly connected to select the desired I2C address (0x23 or 0x5C).
  • Power Supply: The BH1750 operates on 3.0V to 5.0V. Ensure your power source matches this range.
  • Pull-Up Resistors: The I2C lines (SCL and SDA) may require pull-up resistors (typically 4.7kΩ) if not already included on the module.

Troubleshooting and FAQs

Common Issues

  1. Sensor Not Detected:

    • Ensure the wiring is correct and matches the pin configuration.
    • Verify that the I2C address matches the one used in the code (default: 0x23).
  2. Incorrect Light Readings:

    • Check for obstructions or reflections near the sensor.
    • Ensure the sensor is not exposed to extreme temperatures or humidity.
  3. Code Compilation Errors:

    • Confirm that the Adafruit BH1750 library is installed in the Arduino IDE.
    • Ensure the correct board and port are selected in the Arduino IDE.

FAQs

  1. Can the BH1750 measure light levels in direct sunlight?

    • Yes, the BH1750 can measure up to 65,535 lux, which is sufficient for most outdoor applications.
  2. What is the resolution of the BH1750?

    • The BH1750 has a resolution of 1 lux, making it suitable for precise light measurements.
  3. Can I use the BH1750 with a 3.3V microcontroller?

    • Yes, the BH1750 is compatible with both 3.3V and 5V systems.
  4. How do I change the I2C address?

    • Connect the ADDR pin to GND for the default address (0x23) or to VCC for the alternate address (0x5C).

By following this documentation, you can effectively integrate the Adafruit BH1750 into your projects for accurate and reliable light measurement.