Categories

Follow

VEML6075 ultraviolet (UV) light sensor and ESP266

The VEML6075 senses UVA and UVB light and incorporates photodiode, amplifiers, and analog / digital circuits into a single chip using a CMOS process. When the UV sensor is applied, it is able to detect UVA and UVB intensity to provide a measure of the signal strength as well as allowing for UVI measurement.

The VEML6075 provides excellent temperature compensation capability for keeping the output stable under changing temperature. VEML6075’s functionality is easily operated via the simple command format of I2C (SMBus compatible) interface protocol. VEML6075’s operating voltage ranges from 1.7 V to 3.6 V.

 

Parts List

Amount Part Type
1 VEML6075
1 D1 mini V2

 

Schematics/Layout

 

 

Code

Again we use a library and again its an adafruit one – https://github.com/NorthernWidget/VEML6075

WP-SYNHIGHLIGHT PLUGIN: NOTHING TO HIGHLIGHT! PLEASE READ README.TXT IN PLUGIN FOLDER!

#include <VEML6075.h>

VEML6075 UV;

void setup()
{
Serial.begin(38400); //Begin Serial
UV.begin(); //Begin the UV module

}

void loop()
{
Serial.print("UVA = ");
Serial.print(UV.GetUVA()); //Get compensated UVA value
Serial.print(" UVB = ");
Serial.println(UV.GetUVB()); //Get compensated UVB value
delay(1000);
}

[/cpp]

 

Output

Open the serial monitor - this is what I saw but I tested this indoors

UVA = 0.00 UVB = 3.00
UVA = 0.00 UVB = 0.00
UVA = 0.00 UVB = 0.00
UVA = 0.00 UVB = 2.00
UVA = 0.00 UVB = 2.00
UVA = 0.00 UVB = 2.00

Links

https://www.vishay.com/docs/84304/veml6075.pdf

I2C Interface 3.3V Board Based on VEML6075 UVA UVB Light Sensor Module

MLX90615 infrared thermometer and ESP8266 example

The MLX90615 is a miniature infrared thermometer for non-contact temperature measurements. Both the IR sensitive thermopile detector chip and the signal conditioning ASIC are integrated in the same miniature TO-46 can.

The infrared thermometer comes factory calibrated with a digital SMBus output giving full access to the measured temperature in the complete temperature range(s) with a resolution of 0.02 °C. The sensor achieves an accuracy of ±0.2°C within the relevant medical temperature range. The user can choose to configure the digital output to be PWM.

Features and benefits

Factory calibrated in wide temperature range: -20 to 85°C for sensor temperature and -40 to 115°C for object temperature
High accuracy of 0.5°C over wide temperature range (0..+50 C for both Ta and To)
Medical accuracy of 0.2°C in a limited temperature range
Measurement resolution of 0.02°C
SMBus compatible digital interface for fast temperature readings and building sensor networks
Customizable PWM output for continuous reading
3V supply voltage with power saving mode

 

Connection

esp8266 and mlx902615

esp8266 and mlx902615

 

Code

This particular example comes from the following library which I installed – https://github.com/skiselev/MLX90615

I had issues with one of the other libraries – this one works just fine

#include <Wire.h>
#include <mlx90615.h>
MLX90615 mlx = MLX90615();
void setup() {
Serial.begin(9600);
Serial.println("Melexis MLX90615 infra-red temperature sensor test");
mlx.begin();
Serial.print("Sensor ID number = ");
Serial.println(mlx.get_id(), HEX);
}
void loop() {
Serial.print("Ambient = ");
Serial.print(mlx.get_ambient_temp());
Serial.print(" *C\tObject = ");
Serial.print(mlx.get_object_temp());
Serial.println(" *C");
Serial.println();
delay(500);
}

 

Output

Open the serial monitor and you should see something like this. I moved a hot object near the sensor when the second value increased

Ambient = 21.41 *C Object = 37.91 *C

Ambient = 21.69 *C Object = 55.31 *C

Ambient = 22.03 *C Object = 55.51 *C

Ambient = 22.21 *C Object = 28.11 *C

 

Links

https://www.melexis.com/-/media/files/documents/datasheets/mlx90615-datasheet-melexis.pdf

1PCS MLX90615 Digital Infrared Temperature Sensor for Arduino

VL53L0X Time-of-Flight sensor and ESP8266

The VL53L0X is a new generation Time-of-Flight (ToF) laser-ranging module housed in the smallest package on the market today, providing accurate distance measurement whatever the target reflectances unlike conventional technologies. It can measure absolute distances up to 2m, setting a new benchmark in ranging performance levels, opening the door to various new applications.

The VL53L0X integrates a leading-edge SPAD array (Single Photon Avalanche Diodes) and embeds ST’s second generation FlightSenseTM patented technology.

The VL53L0X’s 940 nm VCSEL emitter (Vertical Cavity Surface-Emitting Laser), is totally invisible to the human eye, coupled with internal physical infrared filters, it enables longer ranging distances, higher immunity to ambient light, and better robustness to cover glass optical crosstalk.

 

Parts List

Should be able to pick up one of these sensors from $3 to $4

Amount Part Type
1 VL53L0X
1 D1 mini V2

 

Schematics/Layout

esp8266 and VL53L0X

esp8266 and VL53L0X

 

Code

Again we use a library and again its an adafruit one – https://github.com/adafruit/Adafruit_VL53L0X

The default example worked fine, so here it is

 

 

#include "Adafruit_VL53L0X.h"
 
Adafruit_VL53L0X lox = Adafruit_VL53L0X();
 
void setup()
{
Serial.begin(115200);
 
// wait until serial port opens for native USB devices
while (! Serial)
{
delay(1);
}
 
Serial.println("Adafruit VL53L0X test");
if (!lox.begin())
{
Serial.println(F("Failed to boot VL53L0X"));
while(1);
}
// power
Serial.println(F("VL53L0X API Simple Ranging example\n\n"));
}
 
void loop()
{
VL53L0X_RangingMeasurementData_t measure;
 
Serial.print("Reading a measurement... ");
lox.rangingTest(&measure, false); // pass in 'true' to get debug data printout!
 
if (measure.RangeStatus != 4)
{ // phase failures have incorrect data
Serial.print("Distance (mm): "); Serial.println(measure.RangeMilliMeter);
}
else
{
Serial.println(" out of range ");
}
 
delay(100);
}

 

 

 

Output

Open the serial monitor – this is what I saw. I moved an object closer to the sensor hence the readings decreasing

Reading a measurement… Distance (mm): 166
Reading a measurement… Distance (mm): 165
Reading a measurement… Distance (mm): 167
Reading a measurement… Distance (mm): 150
Reading a measurement… Distance (mm): 159
Reading a measurement… Distance (mm): 139
Reading a measurement… Distance (mm): 113
Reading a measurement… Distance (mm): 96
Reading a measurement… Distance (mm): 87
Reading a measurement… Distance (mm): 83
Reading a measurement… Distance (mm): 75
Reading a measurement… Distance (mm): 54

 

Links

https://www.st.com/resource/en/datasheet/vl53l0x.pdf

https://www.st.com/en/imaging-and-photonics-solutions/vl53l0x.html

VL53L0X Time-of-Flight (ToF) Laser Ranging Sensor Breakout

VEML6040 color sensor and ESP8266

VEML6040 color sensor senses red, green, blue, and white light and incorporates photodiodes, amplifiers, and analog / digital circuits into a single chip using CMOS process.

With the color sensor applied, the brightness, and color temperature of backlight can be adjusted base on ambient light source that makes panel looks more comfortable for end user’s eyes. VEML6040’s adoption of FiltronTM technology achieves the closest ambient light spectral sensitivity to real human eye responses.

VEML6040 provides excellent temperature compensation capability for keeping the output stable under changing temperature. VEML6040’s function are easily operated via the simple command format of I2C (SMBus compatible) interface protocol. VEML6040’s operating voltage ranges from 2.5 V to 3.6 V.

 

Schematics/Layout

 

esp8266 and VEML6040

esp8266 and VEML6040

 

Code

Again we use a library – https://github.com/thewknd/VEML6040

This example worked just fine

WP-SYNHIGHLIGHT PLUGIN: NOTHING TO HIGHLIGHT! PLEASE READ README.TXT IN PLUGIN FOLDER!

#include "Wire.h"
#include "veml6040.h"

VEML6040 RGBWSensor;

void setup() {
Serial.begin(9600);
Wire.begin();
if(!RGBWSensor.begin()) {
Serial.println("ERROR: couldn't detect the sensor");
while(1){}
}

/*
* init RGBW sensor with:
* - 320ms integration time
* - auto mode
* - color sensor enable
*/

RGBWSensor.setConfiguration(VEML6040_IT_320MS + VEML6040_AF_AUTO + VEML6040_SD_ENABLE);

delay(1500);
Serial.println("Vishay VEML6040 RGBW color sensor auto mode example");
Serial.println("CCT: Correlated color temperature in \260K");
Serial.println("AL: Ambient light in lux");
delay(1500);
}

void loop() {
Serial.print("RED: ");
Serial.print(RGBWSensor.getRed());
Serial.print(" GREEN: ");
Serial.print(RGBWSensor.getGreen());
Serial.print(" BLUE: ");
Serial.print(RGBWSensor.getBlue());
Serial.print(" WHITE: ");
Serial.print(RGBWSensor.getWhite());
Serial.print(" CCT: ");
Serial.print(RGBWSensor.getCCT());
Serial.print(" AL: ");
Serial.println(RGBWSensor.getAmbientLight());
delay(400);
}

[/cpp]

 

Output

Open the serial monitor - this is what I saw, the values will change depending on the colour the sensor detects

RED: 2681 GREEN: 1532 BLUE: 657 WHITE: 4341 CCT: 2027 AL: 48.20
RED: 2696 GREEN: 1543 BLUE: 661 WHITE: 4362 CCT: 2031 AL: 48.54
RED: 2617 GREEN: 1493 BLUE: 641 WHITE: 4257 CCT: 2024 AL: 46.97
RED: 3547 GREEN: 2504 BLUE: 974 WHITE: 5499 CCT: 2524 AL: 78.78
RED: 6319 GREEN: 7683 BLUE: 2525 WHITE: 10616 CCT: 4311 AL: 241.71
RED: 7193 GREEN: 9257 BLUE: 2923 WHITE: 12246 CCT: 4494 AL: 291.23
RED: 3830 GREEN: 3999 BLUE: 1319 WHITE: 6284 CCT: 3682 AL: 125.81
RED: 65535 GREEN: 64482 BLUE: 21495 WHITE: 65535 CCT: 3470 AL: 2028.60
RED: 65535 GREEN: 65535 BLUE: 25409 WHITE: 65535 CCT: 3747 AL: 2061.73
RED: 65535 GREEN: 65535 BLUE: 22060 WHITE: 65535 CCT: 3543 AL: 2061.73
RED: 6104 GREEN: 5541 BLUE: 1739 WHITE: 9182 CCT: 3122 AL: 174.32

Links

https://www.vishay.com/docs/84276/veml6040.pdf

VEML6040 Breakout Vishay RGBW Sensor Module