VEML6070 and VEML6075 UV sensors
-
@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 -
Ok, I did manage to solder the bare sonsor.
Consumption is still 50uA.
Can anyone please let me know your VELM6075 break board consumption?????
-
@avamander That's ok. Just post values here - other may benefit on this as well.
I still have no idea why the sensor is taking so much current -
An old thread, tried the github ino for the VEML6075, is not working ok. UVA and UVB sometimes wrong negative figures. I am going to try the sparkfun library, is from 2018. Let you now if I get beter results.
-
/*
Original by scalz@mysensors: https://forum.mysensors.org/topic/6952/veml6070-and-veml6075-uv-sensors/25#
Needs a modified VEML6075-lib: https://github.com/rejoe2/VEML6075
rewritten by Tonbor using sparkfun libary
/
// Enable debug prints to serial monitor
#define MY_DEBUG
// Enable and select radio type attached
#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69
//#define MY_NODE_ID 10
#include <MySensors.h>
#include <SparkFun_VEML6075_Arduino_Library.h>
VEML6075 uv;
//VEML6075 veml6075 = VEML6075();
bool sensorFound = false;
#define CHILD_ID_UVI 1
#define CHILD_ID_UVA 2
#define CHILD_ID_UVB 3
uint32_t SLEEP_TIME = 301000; // Sleep time between reads (in milliseconds)
MyMessage uviMsg(CHILD_ID_UVI, V_UV);
MyMessage uvaMsg(CHILD_ID_UVA, V_UV);
MyMessage uvbMsg(CHILD_ID_UVB, V_UV);
void presentation()
{
// Send the sketch version information to the gateway and Controller
sendSketchInfo("UV Sensor", "1.4T");
// Register all sensors to gateway (they will be created as child devices)
present(CHILD_ID_UVI, S_UV);
present(CHILD_ID_UVA, S_UV);
present(CHILD_ID_UVB, S_UV);
}
void setup()
{
if (!uv.begin()) {
Serial.println(F("VEML6075 not found!"));
} else
sensorFound = true;
//#ifdef MY_DEBUG
// uint16_t devid = veml6075.getDevID();
// Serial.print(F("Device ID = "));
// Serial.println(devid, HEX);
// Serial.println(F("----------------"));
//#endif
}
void loop()
{
if (sensorFound) {
unsigned long lastSend =0;
float uvi;
float uva;
float uvb;
static float uviOld = -1;
static float uvaOld = -1;
static float uvbOld = -1;
//veml6075.sleep(false); // power up veml6075 == begin()
//sleep(500);
// Poll sensor
//veml6075.poll();
uv.powerOn();
delay(250);
uva = uv.a();
uvb = uv.b();
uvi = uv.index();
#ifdef MY_DEBUG
Serial.print(F("UVA = "));
Serial.println(uva, 2);
Serial.print(F("UVB = "));
Serial.println(uvb, 2);
Serial.print(F("UV Index = "));
Serial.println(uvi, 1);
#endif
if (uvi != uviOld) {
send(uviMsg.set(uvi,2));
uviOld = uvi;
}
if (uva != uvaOld) {
send(uvaMsg.set(uva,2));
uvaOld = uva;
}
if (uvb != uvbOld) {
send(uvbMsg.set(uvb,2));
uvbOld = uvb;
}
}
uv.shutdown(); ; // power down veml6075
sleep(SLEEP_TIME);
} -
This ino is working for me, it has the sleep function to save batteries. The Adafruit en the github/mysensors-> https://github.com/schizobovine/VEML6075 lib gives far to high index with my sensor. Only uv a and uv b declaration is not correct. Uv expect a index 0 till 11, domoticz controller passes a lower figure when it receives a number above 11.

