# Light intensity sensor BH1750FVI_i2c
Reference tutorial
[bh1750FVI Chinese Data Manual-Baidu Library (baidu.com)](https://wenku.baidu.com/view/57203d05856a561252d36ff6.html "bh1750FVI Chinese Data Manual-Baidu Library (baidu.com)") [GY-30 light intensity sensor](https://wenku.baidu.com/view/57203d05856a561252d36ff6.html "GY-30 light intensity sensor")
![](././../../images_dir/1625020583/1.png)
BH1750FVI——i2c module installation diagram
![](././../../images_dir/1625020700/2.png) ![](././../../images_dir/1625020745/3.png)
Source code path: driver_210519 bh1750fvi_i2c Powering code:bh1750fvi_drv.c Compiler: 1、Copy "driver_210519 bh1750fvi_i2c" to the "lichee" directory in tina-d1 sdk 2、Enter bh1750fvi_i2c and execute the "make" command to generate the bh1750fvi_drv.ko file 3、Copy to the development board, execute insmod bh1750fvi_drv.ko, load the driver module, as shown below
![](././../../images_dir/1625020815/4.png)
Verify that the device is generated
![](././../../images_dir/1625020880/5.png)
Device tree file and adding nodes: driver_210519sunxi-dts board.dts
rvboards_bh1750fvi:bh1750fvi@46{ compatible = "tina-d1,rvboards-bh1750fvi"; device_type = "sensor"; reg = <0x23>; /*Address 0x46 when the ALT ADDRESS pin is grounded and 0xB8 when it is powered*/ alt_addr_gpio = <&pio PD 22 GPIO_ACTIVE_HIGH>; status = "okay"; };
User level test procedure:bh1750fvi_user.c Compile and execute: 1、Copy bh1750fvi_user.c to the development board 2、Execute gcc -o bh1750fvi_user bh1750fvi_user.c to compile and generate bh1750fvi_user execution program 3、Test command:./ bh1750fvi_user /dev/bh1750fvi
![](././../../images_dir/1625021109/6.png)
---
![](././../../images_dir/1703141148/4.png)