BH1750FVI Module

This module contains the Zerynth driver for BH1750FVI digital ambient light sensor. The BH1750FVI features a I2C digital interface. It is possible to detect wide scale at High resolution. (1 - 65535 lx).

BH1750FVI class

class BH1750FVI(drvname, addr=0x23, clk=400000)

Creates an intance of the BH1750FVI class.

Parameters:
  • drvname – I2C Bus used ‘( I2C0, ... )’
  • addr – Slave address, default 0x23
  • clk – Clock speed, default 400kHz

Ambient light value can be easily obtained from the sensor:

from rohm.bh1750fvi import bh1750fvi

...

sensor = bh1750fvi.BH1750FVI(I2C0)

ambient_light = sensor.get_value()
set_sensitivity(sensitivity = 1)
Parameters:sensitivity – is the sensitivity to set (default value = 1).

Sensitivity scale is 0.45-3.68, typical value is 1.

Set the sensor sensitivity value.

get_sensitivity()

Return the sensitivity set.

set_accuracy(accuracy = 1.2)
Parameters:accuracy – is the accuracy to set (default value = 1.2).

Accuracy scale is 0.96-1.44, typical value is 1.2.

Set the sensor accuracy value.

get_accuracy()

Return the accuracy set.

set_resolution(res = 1)

Parameters:

res: is the resolution to set (default value = 1).

res Resolution
1 One measurement, 1.0 lx resolution
2 One measurement, 0.5 lx resolution
3 One measurement, 4 lx resolution
4 Continous measurement, 1.0 lx resolution
5 Continous measurement, 0.5 lx resolution
6 Continous measurement, 4 lx resolution

Set the sensor resolution value.

get_resolution()

Return the resolution set.

get_value()

Return the ambient light value in lx.