UV Sensor VEML6075

dev board Adafruit Feather Bluefruit
chip nRF52
chip VEML6075

Before starting

Dependancies

Ensure the following requirements are available:

Pre-requisites

Try these simpler examples:

Buy the components

Description

Read the UV sensor values with Adafruit nRF52 Feather and Adafruit VEML6075 breakout board.

Code

Download code
#include "Adafruit_VEML6075.h"

Adafruit_VEML6075 uv = Adafruit_VEML6075();

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);

  Serial.begin(115200);
  Serial.println("VEML6075 Full Test");

  if (!uv.begin()) {
    Serial.println("Failed to communicate with VEML6075 sensor, check wiring?");
  }

  Serial.println("Found VEML6075 sensor");
}

void loop() {
  Serial.println("");

  Serial.print("Raw UVA reading:  ");
  Serial.println(uv.readUVA());

  Serial.print("Raw UVB reading:  ");
  Serial.println(uv.readUVB());

  Serial.print("UV Index reading: ");
  Serial.println(uv.readUVI());

  // turn the LED on (HIGH is the voltage level)
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);

  // turn the LED off by making the voltage LOW
  digitalWrite(LED_BUILTIN, LOW);
  delay(2000);
}

Makefile

.PHONY: lint compile upload clean

lint:
	cpplint --extensions=ino --filter=-legal/copyright *.ino

compile:
	arduino-cli compile --fqbn adafruit:nrf52:feather52832 ./

upload:
	adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application ./.*.hex dfu-package.zip
	adafruit-nrfutil dfu serial --package dfu-package.zip -p /dev/tty.SLAB_USBtoUART -b 115200

clean:
	rm -f .*.bin
	rm -f .*.elf
	rm -f .*.hex
	rm -f *.zip

flash: lint compile upload clean

Serial console

Serial output from the firmware.

UV Sensor VEML6075 serial console

Schematic

Wire up the hardware accordingly

UV Sensor VEML6075 schematic