Average rainfall 2001-2016, global tropics

Map: Average rainfall 2001-2016, global tropics

project: VL6180X + BH1750: Dual I2C sensors

Introduction

This post illustrates how two I2C components can be connected in parallel and serve data to an Arduino Nano board.

Modules

The two modules that are used in this project are the VL6810X Time of Flight (ToF) distance sensor and the BH1750 ambient light sensor. Actually the VL6810X ToF sensor also contains an ambient light sensor, and the project can thus also be used for checking the consistency between these two sensors.

Wiring

Wiring of two I2C modules - VL6810X Time of Flight (ToF) distance sensor and BH1750 ambient light sensor, to an Arduino Nano board.

Sketch

The sketch is simply created by joining the individual sketches for the two modules.

To see the output, open the Serial Monitor of Arduino from the menu:

Tools -> Serial Monitor

The lux reading from the BH1750 ambient light sensor is higher compared to the lux reported from the VL6180X ToF distance sensor. Unless you direct both sensors toward the light source, then they will be very similar. This indicates that the filed of view (FoV) of the BH1750 sensor is wider compared to the VL618X sensor.

Serial monitor showing the output from the sketch as the whole breadboard is tilted.
Serial monitor showing the output from the sketch as the whole breadboard is directed towards the light source and with no object in between (Range = 255 = no ToF return signal).