BeginnerTest and Measurement
Digital Light-Level Meter
Connect an OPT3001 light sensor to a microcontroller and learn how lux changes with distance and angle.
Parts from the database
- OPT3001 × 1Ambient-light sensor
- Raspberry-Pi-Pico × 1Microcontroller board
Other supplies
- OPT3001 breakout board with regulator/level shifting appropriate for 3.3 VCommon build supply
- Raspberry Pi PicoCommon build supply
- USB cableCommon build supply
- jumper wiresCommon build supply
Amazon links may be affiliate links. As an Amazon Associate, Electronics Hobby Hub earns from qualifying purchases.
Connections
- Connect sensor VCC to 3V3, GND to GND, SDA to GP4 and SCL to GP5 (default I²C pins for this sketch).
- Use a breakout board with its I²C pull-ups fitted; avoid stacking several strong pull-ups on the same bus.
- Keep the sensor window uncovered and orient it toward the light source.
Build steps
- Install the vendor library for the exact OPT3001 breakout, then run its sensor example first.
- Confirm the detected I²C address and that the example reports changing lux values.
- Place the sensor at a fixed point, note the reading, then move the lamp or sensor and compare.
- For meaningful comparisons, keep the same sensor orientation and avoid shadows from your hand.
Software and firmware setup
Firmware is required, but a complete sketch is not included yet. Use the example supplied by the manufacturer of your OPT3001 breakout (the bare sensor and breakout libraries differ), confirm its I2C address, then adapt it to print lux over Serial on the Pico. The TI datasheet below documents the sensor itself.
Test your build
The reading should increase when the sensor faces a brighter light and decrease when shaded. Use the official library example for your breakout; the bare IC and modules may have different pin labeling.
Troubleshooting
- If the sensor is not found, confirm SDA/SCL are not swapped and scan the I²C bus.
- If readings remain fixed, uncover the sensing window and check the chosen address.
- A bare OPT3001 IC requires a correctly designed board; use a labeled breakout for this beginner build.
Safety and limitations
Use ordinary low-voltage USB power. Lux readings from an uncalibrated hobby setup are approximate, not workplace safety measurements.
Manufacturer and platform documentation
Community Notes for This Project
These are unverified visitor contributions, separate from the build guide and manufacturer specifications. Verify technical advice against the linked datasheets before relying on it.
Set up the comments service to load community notes.