VEML6070 and VEML6075 UV sensors
-
@korttoma you can try this, and you'll see it's not a big thing :smile:
in your .h, in the public section, add this:
void sleep(bool mode);then in the .cpp, add this:
void VEML6075::sleep(bool mode) { if (mode) this->config |= 1; // Go to sleep else this->config &= 254; // Wake up this->write16(VEML6075_REG_CONF, this->config); }In your sketch, just do this:
veml6075.sleep(true); // power down veml6075Note: i added this because i noticed it wasn't implemented, but i've not checked the power consumption yet. So if you can tell me if it's ok, please!
Enjoy ;)
@scalz thanks for the sleep function! The current consumption is now down to 85uA but the problem is that onece it sleeps I cant get it to wake up.
Tried with:
veml6075.sleep(false);Tried allso adding a 500ms sleep after the wakeup to give it time to setle.
But do I need to do something more? -
@scalz thanks for the sleep function! The current consumption is now down to 85uA but the problem is that onece it sleeps I cant get it to wake up.
Tried with:
veml6075.sleep(false);Tried allso adding a 500ms sleep after the wakeup to give it time to setle.
But do I need to do something more? -
@korttoma sorry for the copy/paste mistake :) you can try again, i've updated above. maybe someday i'll measure power consuption of a sensebender, weird that you get 28uA for the standalone..
@scalz seems to be working now :D don´t take my current consumtion figures to sareously since Im using the Micro (nano) ampere meter and I realy have nothing good to calibrate it against.

-
I have a strange problem. VEML6070 is showing UV Index 6, which is more or less in line with other online sources. VEML6075 is showing UV index 10.5, which is wrong. I'll double check the sketch once more but cannot understand where this error comes from
-
I mounted the Sensebender Micro VEML6075 inside my old broken UVN800 and set it in the roof. Here are graphs of the values I received the last 3 days. Unfortunately I do not have anything to compare with but the values seem reasonable.

-
@korttoma you can try this, and you'll see it's not a big thing :smile:
in your .h, in the public section, add this:
void sleep(bool mode);then in the .cpp, add this:
void VEML6075::sleep(bool mode) { if (mode) this->config |= 1; // Go to sleep else this->config &= 254; // Wake up this->write16(VEML6075_REG_CONF, this->config); }In your sketch, just do this:
veml6075.sleep(true); // power down veml6075Note: i added this because i noticed it wasn't implemented, but i've not checked the power consumption yet. So if you can tell me if it's ok, please!
Enjoy ;)
-
Yeah, my 6075 device is also still working fine on the 2xAA batteries I put in it a year ago.
-
OK, I think found what the issue is. VEML 6070 is not providing accurate UV Index. Adafruit is stating the following:
Note that this is not UV index, its just UV light intensity!This is how it can be converted into sort of UV Index according to the datasheet:
RISK_LEVEL convert_to_risk_level(WORD uvs_step) { WORD risk_level_mapping_table[4] = {2241, 4482, 5976, 8217}; } WORD read_uvs_step(void) { BYTE lsb, msb; WORD data; VEML6070_read_byte(VEML6070_ADDR_DATA_MSB, &msb); VEML6070_read_byte(VEML6070_ADDR_DATA_LSB, &lsb); data = ((WORD)msb << 8) | (WORD)lsb; return data; } LEVEL* UV Index ===== ======== LOW 0-2 MODERATE 3-5 HIGH 6-7 VERY HIGH 8-10 EXTREME >=11 -
Yeah, my 6075 device is also still working fine on the 2xAA batteries I put in it a year ago.
@korttoma @scalz FYG I got a new DMM from Dave Jones 121GW and decided to measure a sleep current for VEML6075 and to my surprise:

Quickly reading the datasheet I discovered my mistake:
- current supply - 480uA
- shutdown current - 800nA
Therefore, the sensor has to be put to sleep properly.
One can modify the existing lib:uint8_t VEML6075::Shutdown() { //Places device in shutdown low power mode Config = ReadByte(CONF_CMD, 0); //Update global config value return WriteConfig(Config | 0x01); //Set shutdown bit } uint8_t VEML6075::PowerOn() { //Turns device on from shutdown mode Config = ReadByte(CONF_CMD, 0); //Update global config value return WriteConfig(Config & 0xFE); //Clear shutdown bit } Make sure you define #define CONF_CMD 0x00PS Now I understand why I did not change batteries - they are rechargeable. Charing and putting them back made me think that batteries lasted for a long time. :relaxed:
-
I have now three sensor from Vishay - VEML6040, VEML6070 and VEML6075
I can confirm all three sensors must be property put down to sleep with battery nodes or you would have the following sleeping currents on nodes with typical mysensors setup and standalone sleeping current of 4uA:VEML6040 - 240uA
VEML6070 - 94uA
VEML6075 - 622uAUnfortunately, most libraries do not care for properly sleeping/waking up sensors and therefore, one has to do a little tinkering with software to make it work. I am actually thinking about re-writing some libs completely.
-
Battery issues is one thing, SparkFun's VEML6075 library can't handle direct daylight even (compensated UV readings go negative).
@avamander That's impossible - it is designed to handle the direct sunlight. Mine is showing UV Index = 9. Negative UV reading is a software issue - looks like Sparkfun did not write a good lib for it. Did you try a different lib?
-
@avamander That's impossible - it is designed to handle the direct sunlight. Mine is showing UV Index = 9. Negative UV reading is a software issue - looks like Sparkfun did not write a good lib for it. Did you try a different lib?
-
Did you try a different lib?
Haven't bothered, I'm just logging the raw values and then compensating with software.
@avamander It definitely works.
My problem for now was just the battery consumption. I have one of these:
The problem is that it is dodgy - the sleep consumption never goes below 50uA at 3.2V. According to the datasheet it should be 800nA while sleeping at 1.8V and 25C. Can anyone measure a shutdown current for VEML6085 please?
-
@avamander It definitely works.
My problem for now was just the battery consumption. I have one of these:
The problem is that it is dodgy - the sleep consumption never goes below 50uA at 3.2V. According to the datasheet it should be 800nA while sleeping at 1.8V and 25C. Can anyone measure a shutdown current for VEML6085 please?
-
@alexsh1 I have the same board, there seems to be a regulator and a few other components on the board, if you remove those, how's the power consumption then?
@avamander I have removed every component bit by bit. Originally the consumption was 56uA and now it is 50uA with the only sensor left on the board
-
@avamander I have removed every component bit by bit. Originally the consumption was 56uA and now it is 50uA with the only sensor left on the board
-
@alexsh1 There's an I^2C address selection jumper on the board, maybe that draws current?
-
-
@alexsh1 Just desolder the sensor itself from the board if you're that far already? I wouldn't be surprised if aliexpress sellers sell counterfeit chips that are s****ier, I'm already seeing that with nRF24L01+'s
@avamander I tried to resolder it to the board - no luck.
It is very small. Very hard to solder any wires to it

