Skip to content

Quick Start

In this Quick Start guide we'll connect the SparkFun Ambient Light Sensor - VEML7700 to a SparkFun IoT RedBoard - ESP32 and use the SparkFun VEML7700 Arduino library print out ambient light data measured by the VEML7700 in lux.

If you're not familiar with using sensor breakouts, development boards or the development environments covered in this guide, refer to the Hardware & Arduino sections of this Hookup Guide for a detailed overview of the board along with instructions on setting up and using the SparkFun VEML7700 Arduino Library.

Basic Assembly

Since this is a Qwiic breakout, assembling the circuit only requires connecting the sensor breakout to a Qwiic-compatible development board like the IoT RedBoard - ESP32. Connect the Ambient Light Sensor Breakout to the IoT RedBoard with a Qwiic cable and then connect the RedBoard to your computer with a USB-C cable like the photo below:

Photo of completed Qwiic assembly with the Light sensor and IoT RedBoard - ESP32

Arduino Example - Get Lux

This basic Arduino example prints out ambient light measurements from the VEML7700 in lux with default settings.

  • Open the Arduino IDE.
  • Install the SparkFun VEML7700 Arduino library with the Arduino Library Manager. Open the tool and search for "SparkFun VEML7700". Make sure to install the latest release.
  • If necessary, install board definitions for the IoT RedBoard - ESP32. Open the Board Manager and search for "ESP32" to install the latest release of espressif's ESP32 boards package.
  • Open the example in Arduino by navigating to File > Libraries > SparkFun VEML7700 Arduino Library > Example1_getLux.
  • Select your Board and Port and click "Upload".
  • Once the code finishes compiling and uploading, open the serial monitor with the baud set to 115200 and you should see light values in lux print out every 250ms like the screenshot below:

Screenshot of serial monitor output for example 1