Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » IoT ESP8266 Lux Meter using BH1750 Light Sensor & Blynk
ESP8266 Projects IoT Projects

IoT ESP8266 Lux Meter using BH1750 Light Sensor & Blynk

Mamtaz AlamBy Mamtaz AlamUpdated:August 21, 20234 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
BH1750 ESP8266
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Overview

In this project, we will make an IoT ESP8266 Based Lux Meter or Light Meter using BH1750 Ambient Light Sensor & monitor it on Blynk Application. Using this sensor we can calculate the amount of light in lux units and check the brightness of the surrounding light. This sensor has a wide range of applications and can be used to adjust the LCD brightness on the Mobile Phone by detecting the environmental light. It can also be used to turn ON/OFF Street Lights based on darkness.

Earlier, we made Lux/light Meter using BH1750 Sensor & Arduino. We also made Solar Irradiance Meter. The Light Intensity in lux is displayed on a 16×2 LCD Display. Now instead of LCD Display, we will send the data to Blynk Application. Using the Blynk application, we can monitor the Light intensity of a particular location from anywhere in the world. For that, we need to use some hardware like NodeMCU ESP8266 & BH1750 Ambient Light Sensor Module.


Bill of Materials

The components required for this project are as follows. All the components can be easily purchased from Amazon.

S.N.Components NameQuantityPurchase Links
1NodeMCU ESP8266 Board1Amazon | AliExpress
2BH1750 Ambient Light Sensor1Amazon | AliExpress
3Connecting Wires10Amazon | AliExpress
4Breadboard1Amazon | AliExpress



BH1750 Ambient Light Sensor

BH1750

This is a BH1750 light intensity sensor breakout board that is a digital Ambient Light Sensor IC with an I2C bus interface. This IC is best suited to get the ambient light data in mobile phones to manipulate the screen brightness based on the environment lighting. This sensor can accurately measure the LUX value of light up to 65535. It consumes a very low amount of current & uses a photodiode to sense the light.

BH1750 works with a supply voltage of 2.4V to 3.6V. BH1750FVI is the main module of the sensor which requires 3.3V for working. So, a voltage regulator is used in the circuit. SDA and SCL are the pins used for I2C communication with the I2C address 0x23. 4.7kΩ of pullup resistors are used with these pins.


BH1750 NodeMCU ESP8266 Circuit Diagram

Now, let us interface the BH1750 Ambient Light Sensor with NodeMCU ESP8266 Board. The connection is fairly simple. Connect the I2C Pin of BH1750, i.e. SDA & SCL to D1 & D2 of NodeMCU Board Respectively.

ESP8266 BH1750

Connect the 3.3V pin of BH1750 to NodeMCU 3.3V pin & GND to GND. The circuit can be easily assembled on a breadboard as shown in the image below.

BH1750 ESP8266 Blynk



Blynk Application Setup

The IoT Based Lux Meter Project is incomplete without the Blynk Application. Blynk is designed for the Internet of Things. It can control hardware remotely, it can display sensor data, it can store data, visualize it, and do many other cool things.

Download and install the Blynk Application from Google Play Store. IOS users can download from the App Store. Once the installation is completed, open the app & sign-up using your Email id and Password.

Create your UI by dragging dropping and filling up details along with the virtual pin assignment. Once the UI is created, you can ask for the authentication Token by sending the mail. You will need the Authentication Token for the code.


Source Code/Program

The source code or program for IoT Lux Meter using BH1750 ESP8266 & Blynk is given below. You can upload this code to the NodeMCU Board. Before compiling the sketch, you need to add following library to the Arduino IDE.

  1. Download: Blynk Library
  2. Download: BH1750 Library

From the code part, change the wifi SSID, Password & Blynk Authentication Code.

1
2
3
char auth[] = "******************************";    
char ssid[] = "******************************";                
char pass[] = "******************************";

The complete code is given below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <Wire.h>         // adds I2C library
#include <BH1750.h>       // adds BH1750 library file
#define BLYNK_PRINT Serial
#include <Blynk.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
 
char auth[] = "_YONn2J3C8pxB1iIItsalCkS2diOjW9E";       // You should get Auth Token in the Blynk App.
char ssid[] = "Alexahome";                       // Your WiFi credentials.
char pass[] = "loranthus";
 
BH1750 lightMeter;
 
void setup()
{
  Wire.begin();
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  lightMeter.begin();
 
}
void loop()
{
  Blynk.run();
  float lux = lightMeter.readLightLevel();
  Serial.print("Light Meter: ");
  Serial.print(lux);
  Serial.println(" lx");
  Blynk.virtualWrite(V2, lux);
  delay(1000);
}




Monitoring Light Intensity in Blynk Application

Once the code is uploded, the NodeMCU Board will connect to the wifi using the assigned Wifi SSID & Password. Once, the Nodemcu connects to the Wifi, it will start uploading the data to Blynk Server.

You can monitor the Light Intensity data on the Blynk Application as shown in the image below.

BH1750 Lux Meter ESP8266 Blynk

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleIoT Based TDS Meter using ESP8266 for Water Quality Monitoring
Next Article GPS+GSM Based Vehicle Tracking System using Arduino

Related Posts

IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

Updated:May 10, 20261K
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

Updated:May 2, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

Updated:April 27, 20261K
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

Updated:April 27, 20262K
DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

Updated:February 1, 20261K
Add A Comment

CommentsCancel reply

Latest Posts
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

May 31, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

February 1, 2026
Top Posts & Pages
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • IoT Based Drinking Water Quality Monitoring with ESP32
    IoT Based Drinking Water Quality Monitoring with ESP32
  • LD2410 Sensor with ESP32 - Human Presence Detection
    LD2410 Sensor with ESP32 - Human Presence Detection
  • ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
    ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
  • DIY IoT Water pH Meter using pH Sensor & ESP32
    DIY IoT Water pH Meter using pH Sensor & ESP32
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (204)
    • ESP32 MicroPython (7)
    • ESP32 Projects (81)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.