β οΈ Affiliate Disclosure: This post contains Amazon affiliate links. If you purchase through our links, we may earn a small commission at no extra cost to you. Every product below was checked against its live Amazon listing before publishing. Prices change often, so we don’t list them here. Tap any Buy Here button to see the current price on Amazon.
ESP32 Sensor Buying Guide
βοΈ Best Light Sensors for ESP32
Lux meters, UV index sensors, spectral colour sensors and gesture boards: 8 I2C light sensors that work with ESP32, Arduino and ESPHome, compared on range, features and real use cases.
β
8 Sensors Compared
β
Verified Amazon ASINs
β
Lux, UV and Spectral
β
ESPHome Friendly
Light sensors are some of the most useful parts you can wire to an ESP32. They dim displays and LED strips automatically, switch on porch lights at dusk, log daylight in a greenhouse, report the UV index on a weather station and even tell colours apart on a sorting machine. A cheap photoresistor on an analog pin can tell light from dark, but it drifts with temperature, needs calibration and the ESP32’s ADC is not very linear, so you never get a real lux value out of it.
The digital I2C sensors in this guide do the conversion on-chip and hand your ESP32 calibrated readings over two wires. We compared 8 sensors: general-purpose lux sensors (VEML7700, VEML6030, BH1750), a very high dynamic range sensor (TSL2591), UV sensors (LTR390), a spectral colour sensor (AS7341) and a combined proximity, colour and gesture sensor (APDS9960). All of them have mature Arduino libraries, and most are supported directly in ESPHome.
π‘ Before you buy: Decide what you actually need to measure. For indoor brightness and auto-dimming, any lux sensor works. For direct sunlight, check the top of the range (the BH1750 saturates around 65,000 lux, while full summer sun can exceed 100,000 lux). For very dark rooms or night sky, low-end sensitivity matters more, which is where the TSL2591 shines. A UV sensor or colour sensor will not replace a lux sensor, and a sensor behind a tinted or frosted enclosure window will always read low, so plan a clear window and calibrate in place.
β‘ Quick Comparison: All 8 Light Sensors
| Sensor | Type | Range / Channels | Connector | Best For | Buy |
|---|
| π₯ Adafruit VEML7700 | Ambient lux | 0 to ~120,000 lux, 16-bit | STEMMA QT | Best Overall | Buy Here β |
| π Adafruit TSL2591 | Lux + IR | 188 Β΅lux to 88,000 lux | STEMMA QT | Best for Low Light | Buy Here β |
| π SparkFun VEML6030 | Ambient lux | 0 to ~120,000 lux, 16-bit | Qwiic | Best Qwiic Lux Sensor | Buy Here β |
| πΆοΈ Adafruit LTR390 | UV + ambient light | UV counts to UV Index, plus lux | STEMMA QT | Best UV Sensor | Buy Here β |
| π Waveshare AS7341 | Spectral colour | 8 visible bands + clear, NIR, flicker | I2C header | Best Spectral Sensor | Buy Here β |
| π Adafruit APDS9960 | Proximity, RGB, gesture | RGB + clear light, gestures | STEMMA QT | Best for Gestures | Buy Here β |
| π° SHILLEHTEK BH1750 | Ambient lux | 1 to 65,535 lux, 16-bit | Pin header | Best Budget | Buy Here β |
| βοΈ Waveshare LTR390-UV (C) | UV + ambient light | UV index and lux output | I2C header | Budget UV Pick | Buy Here β |
Specs come from the manufacturers and the live Amazon listings. Star scores below are our ratings.
π What Matters in an ESP32 Light Sensor
π
Lux Range
Indoor rooms sit around 100 to 1,000 lux, overcast daylight several thousand, and direct sun can top 100,000. Pick a sensor whose range covers your brightest case.
π
Low-Light Sensitivity
Dusk detection and night logging need resolution well below 1 lux. Adjustable gain and integration time let one sensor cover dark and bright scenes.
ποΈ
Human Eye Response
Good lux sensors filter their response to match the human eye, so a bright IR source like an incandescent bulb or the sun does not inflate the reading.
π
I2C Address and Connector
STEMMA QT and Qwiic boards plug in with one cable and chain with other sensors. Check the I2C address so it does not clash with sensors already on the bus.
π
Library and ESPHome Support
All picks here have Arduino libraries. VEML7700, TSL2591, BH1750, LTR390, AS7341 and APDS9960 also have native ESPHome components.
π Detailed Reviews: The Top Two
π₯ BEST OVERALL LIGHT SENSOR
Adafruit VEML7700 Lux Sensor
β 4.8/5 Β· Our Rating Β· The Default Choice
Buy on Amazon β

If you only buy one light sensor for ESP32 projects, make it the VEML7700. This Vishay sensor measures from near darkness up to roughly 120,000 lux with 16-bit resolution, so the same board handles a dim bedroom and full sunlight. Its photodiode response is filtered to match the human eye, which means readings line up with what you see rather than spiking under IR-heavy light. Adafruit’s breakout adds a regulator and level shifting, so it runs from 3.3V or 5V, and STEMMA QT connectors let you chain it with other sensors without soldering. Gain and integration time are adjustable, and both the Adafruit library and ESPHome’s veml7700 component handle the auto-ranging for you.
β
Pros- Covers dark rooms to direct sun
- Human eye matched response
- Plug-and-play STEMMA QT
- Native ESPHome support
β Cons- Fixed I2C address (0x10)
- Needs auto-gain for best low-light results
π― Verdict: The best all-round lux sensor for auto-dimming, dusk switches and daylight logging.
π Check Price on Amazon β
π BEST FOR LOW LIGHT AND HIGH DYNAMIC RANGE
Adafruit TSL2591 High Dynamic Range Light Sensor
β 4.7/5 Β· Our Rating Β· Most Sensitive
Buy on Amazon β

The TSL2591 is the sensor to pick when darkness matters. It resolves light levels as low as 188 micro-lux and still reads up to 88,000 lux, a dynamic range of about 600,000,000 to 1. It has separate full-spectrum and infrared photodiodes, so the library can subtract IR and calculate a lux value close to human vision, or give you the raw IR reading for plant and IR experiments. That sensitivity makes it ideal for sky-quality meters, night-time logging, astronomy projects and dusk detection that must not flicker at twilight. The STEMMA QT version runs from 3.3V or 5V and uses I2C address 0x29.
β
Pros- Exceptional low-light sensitivity
- Separate IR and full-spectrum readings
- Huge dynamic range
- STEMMA QT and ESPHome support
β Cons- Tops out below full summer sun
- Fixed I2C address (0x29)
π― Verdict: The best choice for dark scenes, night logging and twilight switching.
π Check Price on Amazon β
π¬ Detailed Reviews: Lux, UV, Spectral and Gesture Sensors
π BEST QWIIC LUX SENSOR Β· β 4.6/53. SparkFun Ambient Light Sensor VEML6030 (Qwiic)
VEML6030 Β· 0 to ~120,000 lux Β· 16-bit Β· Qwiic Β· selectable I2C address Β· interrupt pin
Buy Here β

SparkFun’s VEML6030 board is the Qwiic-ecosystem counterpart to the VEML7700, using a closely related Vishay sensor with the same 16-bit resolution and a range up to roughly 120,000 lux. Two things set it apart: a jumper lets you change the I2C address, so you can run two on one bus (for example, one indoors and one facing a window), and an interrupt pin can wake your ESP32 when light crosses a threshold, which is useful for battery-powered deep-sleep projects. It is a 3.3V board, which suits the ESP32 perfectly.
β
Pros: Address jumper; threshold interrupt; Qwiic chaining; SparkFun library.
β Cons: 3.3V only; no native ESPHome component (use a custom component or the VEML7700 instead).
π― Verdict: The best lux sensor when you need two on one bus or an interrupt for deep sleep.
πΆοΈ BEST UV SENSOR Β· β 4.6/54. Adafruit LTR390 UV Light Sensor
LTR390 Β· UV and ambient light modes Β· UV Index from raw counts Β· STEMMA QT Β· I2C 0x53 Β· 3 to 5V
Buy Here β

For a weather station, a garden monitor or a “should I wear sunscreen” display, the LTR390 is the modern UV sensor to use. It has two modes: a UV mode that measures UVA/UVB light and lets the library convert raw counts to a UV Index, and an ambient light mode that reports lux, so one board covers both. It replaces older analog UV modules that need an ADC and careful calibration. Adafruit’s version has STEMMA QT connectors and works at 3.3V or 5V, and ESPHome has a native ltr390 component.
β
Pros: UV Index and lux in one board; digital I2C; ESPHome support; STEMMA QT.
β Cons: UV readings need a UV-transparent window outdoors (ordinary plastic and glass block much of it).
π― Verdict: The best way to add UV Index readings to an ESP32 weather station.
π BEST SPECTRAL COLOUR SENSOR Β· β 4.5/55. Waveshare AS7341 Spectral Color Sensor
AS7341 Β· 8 visible bands plus clear, NIR and flicker detection Β· I2C Β· 3.3V/5V Β· onboard LEDs
Buy Here β

The AS7341 goes far beyond a basic RGB sensor. It splits visible light into 8 separate bands across the spectrum, plus clear and near-infrared channels and a flicker detection channel that can spot 50/60 Hz lamp flicker. That makes it useful for colour matching, checking grow-light spectra, comparing LED bulbs, simple spectroscopy experiments and sorting objects by colour. Waveshare’s board adds fill LEDs for measuring reflected colour and works at 3.3V or 5V. It is overkill for simple brightness sensing, but nothing else here gives you this much spectral detail.
β
Pros: Eight visible channels; flicker detection; onboard LEDs; ESPHome support.
β Cons: Not a calibrated lux meter; takes more code to interpret.
π― Verdict: The pick for colour matching, grow-light checks and spectral experiments.
π BEST FOR GESTURES AND PROXIMITY Β· β 4.4/56. Adafruit APDS9960 Proximity, Light, RGB and Gesture Sensor
APDS9960 Β· proximity Β· RGB and clear light Β· up/down/left/right gestures Β· I2C 0x39 Β· interrupt
Buy Here β

The APDS9960 packs three sensors into one tiny chip: proximity detection out to a few centimetres, RGB and clear ambient light sensing, and gesture recognition for up, down, left and right swipes. On an ESP32 that means touchless light switches, a display that wakes when your hand approaches, or a swipe-controlled music player, while the clear channel still gives you a rough brightness level. It is not a precise lux meter, so pair it with a VEML7700 if you need accurate light readings. The Amazon listing is Adafruit’s breakout; current units ship with STEMMA QT connectors.
β
Pros: Gesture, proximity and colour in one; interrupt output; ESPHome support.
β Cons: Short proximity range; light readings are approximate, not calibrated lux.
π― Verdict: The fun pick for touchless controls and hand-wave wake-up displays.
β Also Worth Considering: Budget Picks
π° BEST BUDGET LUX SENSOR Β· β 4.3/5
7. SHILLEHTEK GY-302 BH1750 Light Sensor
The BH1750 on a GY-302 board is the classic low-cost light sensor, and the one most ESP32 tutorials use. It reports calibrated lux directly over I2C from 1 to 65,535 lux with 16-bit resolution, runs from 3V to 5V, and its ADDR pin selects 0x23 or 0x5C so two can share a bus. This SHILLEHTEK version comes with the header pre-soldered, so it drops straight into a breadboard. It saturates in direct summer sun, so choose the VEML7700 for outdoor use, but for indoor auto-dimming it is hard to beat. ESPHome supports it natively.
Buy Here ββοΈ BUDGET UV PICK Β· β 4.3/5
8. Waveshare LTR390-UV Ultraviolet Sensor (C)
Waveshare’s module uses the same LTR390-UV chip as the Adafruit board, offering UV and ambient light readings over I2C at 3.3V or 5V. It comes with a cable for the onboard header instead of STEMMA QT connectors and is backed by Waveshare’s wiki with Arduino, Raspberry Pi and STM32 examples. Because the sensor chip is identical, the ESPHome ltr390 component and Adafruit library work with it too. A good choice if you are building a UV station and want a second unit or a Waveshare-style cable connector.
Buy Here βπ οΈ Which Sensor for Which ESP32 Project?
| ESP32 Project | Recommended Sensor |
|---|
| Auto-dimming a display or LED strip | VEML7700 or BH1750 |
| Dusk-to-dawn porch light switch | TSL2591 or VEML7700 |
| Weather station lux and UV Index | VEML7700 + LTR390 |
| Greenhouse and grow-light monitoring | AS7341 + VEML7700 |
| Battery sensor that wakes on light change | SparkFun VEML6030 (interrupt) |
| Touchless switch or gesture control | APDS9960 |
| Night sky and very low-light logging | TSL2591 |
| Lowest cost indoor light reading | BH1750 (GY-302) |
π Which One Should You Buy?
βοΈ
One sensor for everything
The Adafruit VEML7700 covers dark rooms to full sun.
π
Dark scenes and twilight
The Adafruit TSL2591 for micro-lux sensitivity.
πΆοΈ
UV Index on a weather station
The Adafruit LTR390, or the Waveshare LTR390-UV (C).
π
Colour and spectrum
The Waveshare AS7341 with 8 visible bands.
π
Touchless control
The Adafruit APDS9960 for gestures and proximity.
π°
Tightest budget
The BH1750 (GY-302) for indoor lux readings.
β Frequently Asked Questions
Can I just use a photoresistor (LDR) with the ESP32?
Yes, for simple light or dark detection. An LDR in a voltage divider on an ADC pin is cheap, but it drifts with temperature, varies between parts and the ESP32 ADC is not very linear, so you will not get accurate lux. Digital sensors like the VEML7700 or BH1750 give calibrated readings with far less effort.
Which light sensors work with ESPHome?
ESPHome has native components for the VEML7700, TSL2591, BH1750, LTR390, AS7341 and APDS9960. You add the I2C bus and the sensor block to your YAML and the readings appear in Home Assistant. The SparkFun VEML6030 needs a custom component.
Can I put several light sensors on the same I2C bus?
Yes, as long as their addresses differ. The VEML7700 (0x10), TSL2591 (0x29), LTR390 (0x53) and APDS9960 (0x39) can all share one bus. For two identical sensors, use boards with address jumpers like the BH1750 or VEML6030, or add an I2C multiplexer.
Why does my sensor read low inside an enclosure?
Any window in front of the sensor absorbs some light, and tinted, frosted or UV-blocking plastic absorbs much more. Use a clear window, mount the sensor right behind it, and calibrate by comparing against a reference meter, then apply a correction factor in code.
Is the VEML7700 or BH1750 better for outdoor use?
The VEML7700. The BH1750 maxes out around 65,000 lux, and direct summer sun can exceed 100,000 lux, so it saturates outdoors. The VEML7700 reaches roughly 120,000 lux and keeps reading accurately in bright daylight.
π Final Verdict: Best Light Sensors for ESP32
The right sensor for each job:
For most ESP32 projects, the Adafruit VEML7700 is the light sensor to start with: it reads from dim rooms to full sunlight, plugs in with one cable and works in ESPHome out of the box. Choose the TSL2591 for dark scenes, add an LTR390 for UV Index, reach for the AS7341 when colour matters, and use a BH1750 when cost is the main concern. Building a full environmental station? Pair your light sensor with picks from our temperature and humidity sensors, weather station parts and PIR motion sensors guides, or browse our complete ESP32 sensors guide.
π¬ Which light sensor are you using in your ESP32 project, and what are you measuring? Share your setup in the comments below.
All Amazon links above use our affiliate tag (esp32tutorials-20). Purchasing through them supports esp32tutorials.com at no extra cost to you. Prices and availability change frequently, so always confirm the current price on Amazon before buying.
We are a team of experienced Embedded Software Developers with skills in developing Embedded Linux, RTOS, and IoT products from scratch to deployment with a demonstrated history of working in the embedded software industry. Contact us for your projects: admin@esp32tutorials.com