VEML6070 and VEML6030

Hi all,

I am trying to implement VEML6070 with VEML6030 to have a UV and ambient sensor but my results coming out are a bit funky. I built on the open source which combines with VEML6040 attached in link below:

Datasheets:

veml6070 for the ‘UV index conversion’

veml6030 - CALCULATING THE LUX LEVEL

https://www.mouser.co.uk/pdfdocs/designingveml6030.pdf

Below I have attached my arduino. I seem to get funky results for the UV sensor- as in it will go from 511 to 90 which would be UV index 1.825 to 0.16. If you have any advice or can find my issue would be greatly appreciated.

MOD1024.cpp (4.41 KB)

MOD1024.h (4.04 KB)

new.ino (5.21 KB)

  Serial.print(uv);
  //Serial.println('\n');
  //Serial.print("als");+Serial.print(als);
  Serial.println(white);

I have some doubts that you actually see the UV value correctly. Post the output you get! Post a wiring diagram!

Hi thanks for replying

I get values that do seem to modulate with the amount of sunlight and whether Im indoors or outdoors.

Here is images of my PCB and current wiring

For values: Here I walked into the sunlight then back and covered with my hand

14:25:11.914 -> UV: 49.00
14:25:11.914 ->
14:25:11.914 -> White: 29059.00
14:25:11.951 -> Lux
14:25:11.951 -> done
14:25:14.331 -> UV: 44.00
14:25:14.331 ->
14:25:14.331 -> White: 27855.00
14:25:14.331 -> Lux
14:25:14.331 -> done
14:25:16.754 -> UV: 67.00
14:25:16.754 ->
14:25:16.754 -> White: 32239.00
14:25:16.754 -> Lux
14:25:16.754 -> done
14:25:19.134 -> UV: 68.00
14:25:19.134 ->
14:25:19.134 -> White: 32754.00
14:25:19.134 -> Lux
14:25:19.134 -> done
14:25:21.557 -> UV: 60.00
14:25:21.557 ->
14:25:21.557 -> White: 31443.00
14:25:21.557 -> Lux
14:25:21.557 -> done
14:25:23.952 -> UV: 33.00
14:25:23.952 ->
14:25:23.952 -> White: 40807.00
14:25:23.952 -> Lux
14:25:23.952 -> done
14:25:26.351 -> UV: 28.00
14:25:26.351 ->
14:25:26.351 -> White: 53964.00
14:25:26.351 -> Lux
14:25:26.351 -> done
14:25:28.780 -> UV: 165.00
14:25:28.780 ->
14:25:28.780 -> White: 36737.00
14:25:28.780 -> Lux
14:25:28.780 -> done
14:25:31.174 -> UV: 232.00
14:25:31.174 ->
14:25:31.174 -> White: 21139.00
14:25:31.174 -> Lux
14:25:31.174 -> done
14:25:33.569 -> UV: 79.00
14:25:33.569 ->
14:25:33.569 -> White: 38660.00
14:25:33.569 -> Lux
14:25:33.569 -> done
14:25:35.983 -> UV: 95.00
14:25:35.983 ->
14:25:35.983 -> White: 24601.00
14:25:35.983 -> Lux
14:25:35.983 -> done
14:25:38.390 -> UV: 57.00
14:25:38.390 ->
14:25:38.390 -> White: 41094.00
14:25:38.390 -> Lux
14:25:38.390 -> done
14:25:40.774 -> UV: 83.00
14:25:40.774 ->
14:25:40.774 -> White: 38096.00
14:25:40.774 -> Lux
14:25:40.774 -> done
14:25:43.187 -> UV: 97.00
14:25:43.187 ->
14:25:43.187 -> White: 27693.00
14:25:43.187 -> Lux
14:25:43.187 -> done
14:25:45.598 -> UV: 118.00
14:25:45.598 ->
14:25:45.598 -> White: 29083.00
14:25:45.598 -> Lux
14:25:45.598 -> done
14:25:48.003 -> UV: 122.00
14:25:48.003 ->
14:25:48.003 -> White: 41778.00
14:25:48.003 -> Lux
14:25:48.003 -> done
14:25:50.418 -> UV: 35.00
14:25:50.418 ->
14:25:50.418 -> White: 26026.00
14:25:50.418 -> Lux
14:25:50.418 -> done
14:25:52.814 -> UV: 110.00
14:25:52.814 ->
14:25:52.814 -> White: 43838.00
14:25:52.814 -> Lux
14:25:52.814 -> done
14:25:55.199 -> UV: 81.00
14:25:55.199 ->
14:25:55.199 -> White: 28374.00
14:25:55.199 -> Lux
14:25:55.199 -> done
14:25:57.626 -> UV: 77.00
14:25:57.626 ->
14:25:57.626 -> White: 51815.00
14:25:57.626 -> Lux
14:25:57.626 -> done
14:26:00.011 -> UV: 42.00
14:26:00.011 ->
14:26:00.011 -> White: 52716.00
14:26:00.011 -> Lux
14:26:00.011 -> done
14:26:02.423 -> UV: 33.00
14:26:02.423 ->
14:26:02.423 -> White: 38584.00
14:26:02.423 -> Lux
14:26:02.423 -> done
14:26:04.827 -> UV: 24.00
14:26:04.827 ->
14:26:04.827 -> White: 25749.00
14:26:04.827 -> Lux
14:26:04.827 -> done
14:26:07.226 -> UV: 24.00
14:26:07.226 ->
14:26:07.226 -> White: 37052.00
14:26:07.226 -> Lux
14:26:07.226 -> done
14:26:09.648 -> UV: 5.00
14:26:09.648 ->
14:26:09.648 -> White: 7510.00
14:26:09.648 -> Lux
14:26:09.648 -> done
14:26:12.033 -> UV: 17.00
14:26:12.033 ->
14:26:12.033 -> White: 19860.00
14:26:12.070 -> Lux
14:26:12.070 -> done
14:26:14.463 -> UV: 16.00
14:26:14.463 ->
14:26:14.463 -> White: 18894.00
14:26:14.463 -> Lux
14:26:14.463 -> done
14:26:16.842 -> UV: 61.00
14:26:16.842 ->
14:26:16.842 -> White: 32442.00
14:26:16.842 -> Lux
14:26:16.842 -> done
14:26:19.264 -> UV: 27.00
14:26:19.264 ->
14:26:19.264 -> White: 21056.00
14:26:19.264 -> Lux
14:26:19.264 -> done
14:26:21.683 -> UV: 32.00
14:26:21.683 ->
14:26:21.683 -> White: 23207.00
14:26:21.683 -> Lux
14:26:21.683 -> done
14:26:24.089 -> UV: 28.00
14:26:24.089 ->
14:26:24.089 -> White: 20239.00
14:26:24.089 -> Lux
14:26:24.089 -> done
14:26:26.496 -> UV: 13.00
14:26:26.496 ->
14:26:26.496 -> White: 10703.00
14:26:26.496 -> Lux
14:26:26.496 -> done
14:26:28.901 -> UV: 13.00
14:26:28.901 ->
14:26:28.901 -> White: 14253.00
14:26:28.901 -> Lux
14:26:28.901 -> done
14:26:31.284 -> UV: 11.00
14:26:31.284 ->
14:26:31.284 -> White: 10709.00
14:26:31.284 -> Lux
14:26:31.284 -> done
14:26:33.705 -> UV: 44.00
14:26:33.705 ->
14:26:33.705 -> White: 27054.00
14:26:33.705 -> Lux
14:26:33.705 -> done

Ideally I should be seeing much larger numbers so I can use this to determine UVI

Picture 1.png

Picture 2.png

image001.png

I'm sure that output is not from the posted version of the sketch!

Anyway, I probably see which uncommenting you've done.

Below I have attached my arduino. I seem to get funky results for the UV sensor- as in it will go from 511 to 90 which would be UV index 1.825 to 0.16. If you have any advice or can find my issue would be greatly appreciated.

The values you get correspond to the UV the sensors gets but you think the translation to the UV index is wrong?

BTW, you have to use column two to get the correct translation as the default integration time using your library is 2T.

In my opinion the library doesn't initialize the sensor according to the datasheet.
Try to change the VEML6070 init method to:

void VEMLClass::VEML6070_init() {
	// Read alert response address to acknowledge pending alerts
	Wire.requestFrom(0x0C,1);
	// Send initial value
	VEML6070_write(0x06);
}

If you use this init() method, the refresh time is set to 1T, so you table applies again.

BTW, your schematics are unusable tiny.