Git Product home page Git Product logo

bh1750fvi's Introduction

license-badge version stars hit-count github-issues

ROHM BH1750FVI

This is an Arduino library for ROHM BH1750FVI Ambient Light Sensor

  • power supply voltage +2.4v..+3.6v
  • maximum current 190μA, sleep current 1μA
  • I²C bus speed 100KHz..400KHz, up to 2 sensors on the bus
  • maximum sensitivity at 560nm, yellow-green light
  • 50Hz/60Hz flicker reduction
  • measurement accuracy ±20%
  • measurement angle ±30°
  • calibration by changing the accuracy 0.96..1.44 (1)
  • optical filter compensation by changing sensitivity 0.45..3.68 (2) (6)
  • onetime+sleep and continuous measurement mode
  • typical measurement resolution: (3)
    • 0.5 lux, high resolution mode2
    • 1.0 lux, high resolution mode
    • 4.0 lux, low resolution mode
  • typical measurement range from 1..32767 lux to 1..65535 lux (4) (5)
  • typical measurement interval from 10..88 msec to 81..662 msec (6)

Supports all sensors features:

  • set sensitivity (2)
  • set resolution
  • calibration (1)
  • read illuminance in lux (5)
  • set measurement mode (high/low resolution and onetime/continuous measurement) (3)
  • sleep, 1μA
  • reset (clears previous measurement, not accepted in sleep mode)

Tested on:

  • Arduino AVR
  • Arduino ESP8266
  • Arduino STM32

(1) Typical calibration values:
- 1.00, fluorescent light
- 1.06, white LED & artifical sun
- 1.15, halogen light
- 1.18, krypton light
- 1.20, incandescent light (by default)
(2) Any optical filter you put in front of the sensor blocks some light. Sensitivity is used to compensate the influence of the optical filter. For example, when transmission rate of optical window is 50% (measurement result becomes 0.5 times lower), influence of optical window is compensated by changing sensor sensitivity from library default 1.0 to 2.0 times. With this function it is also possible to detect the light intensity from 0.11 lux to 100000 lux, with a loss of sensitivity in the upper or lower measurement range, respectively.
(3) Use "high resolution mode" or "high resolution mode 2" if you want to detect light intensity less than 10 lux.
(4) Depends on resolution mode, sensitivity and accuracy. The "high resolution mode 2" mode cuts the measurement range in half. Values greater than 1.0x reduce the measurement range, while smaller values increase it.
(5) Library returns 4294967295.00 lux if a communication error occurs.
(6) Depends on resolution mode and sensitivity. High resolutions increase measurement interval. Sensitivity values less than 1.0x decrease the measurement interval, while larger values increase it.

bh1750fvi's People

Contributors

enjoyneering avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bh1750fvi's Issues

integrationTime in readLightLevel

Dear @enjoyneering,

was it your intention that other modes than BH1750_ONE_TIME_HIGH_RES_MODE_2, BH1750_ONE_TIME_LOW_RES_MODE do have a integration time greater than zero?
My understanding is that in continuous operation mode you don't have to necessarily wait before reading out the sensor.

If it wasn't your intention you could add a break statement after each case of switch(_sensorResolution). If it is your intention you might want to adjust the documentation string of readLightLevel accordingly.

Thanks for consideration and kind regards,
randombitflip

Sensitivity compensation

Thanks for developing this library. I just bought a breakout board with BH1750FVI and found this library works great!

But one thing I found is that readLightLevel gives a very different value when the sensitivity is changed from 1 to another. I believe the reason is that, in the readLightLevel method, rawLightLevel is multiplied by _sensitivity. If I divided by _sensitivity, it could give me consistent values regardless of the sensitivity. Could you take a look? Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.