Which VEML7700 module do you have ? Can you give a link to where you bought it ?
Only the Adafruit module is compatible with a 5V Arduino board. The Leonardo is a 5V board.
Did you put it in the sun and it got too hot ?
The sensor itself can measure from 7mLux to 120kLux.
The 120kLux is sunlight and no sensor can measure direct sunlight. But if the datasheet says that 120kKux is the maximum, then it should be able to measure up to 120kLux.
I'm afraid we can not help if no one of us has that module to verify it
According to the Adafruit forum and an issue on Github, there is something weird with the sensor and the library. Even the Adafruit tutorial is stuck at 471.85, that is a bad sign. I think that the software should have a autoranging feature implemented to measure the full range.
Keep in mind that the sensor could be broken. You might spent a lot of time trying to solve it.
You could try another library, but perhaps you should buy another sensor (not a VEML7700) and leave this behind you.
Does this sketch gives a different result https://forum.arduino.cc/index.php?topic=637017.0 ?
On the upper-right of the Arduino IDE is a drop-down-button where you can add a file. There you can add "VEMLConfig.h" and copy that contents of that second file in.
The Adafruit TSL2591 module can measure up to 88kLux. Perhaps it has the same problem, if the library has no autoranging.
What is your project ? If you want something outdoors in direct sunlight, then you need something else.
Thank you I get pretty accurate results from this. I am currently working on a project where I want to use this sensor to measure the number of lux in a room in order to adjust the lights in that room.
So my next step is to use bluetooth to send this data to another arduino.
for others who have the same problem I used the "Adafruit VEML7700 Lux sensor - I2C light sensor"
Please explain. With what do you get good results ? That sketch in this forum ?
In that sketch, you can change it for the brightest light in the *.h file:
This is now it is now:
// --- Uncomment one from this group:
//#define ALS_IT 0b1100 // 25 ms
#define ALS_IT 0b1000 // 50 ms
//#define ALS_IT 0b0000 // 100 ms
//#define ALS_IT 0b0001 // 200 ms
//#define ALS_IT 0b0010 // 400 ms
//#define ALS_IT 0b0011 // 800 ms
You can select the 25 ms for the brightest light. Comment the 50 ms and uncommend the 25 ms line.
Perhaps you can go back to the Adafruit sketch and change the numbers to 25 ms and 1/8.
Without autoranging, the sensor has to be set for a certain amount of light. That is no fun, that is only a small range and the sensor can do so much more.
That link to amazon is indeed the real Adafruit module, it is compatible with your Leonardo board
It probably has to do with the settings you are talking about. Because if I change the settings I also get better results with the library from adafruit.
Here you set the gain to a reasonable value (x1), but the exposure time to maximum, making it very sensitive,
as the exposure time affects the gain directly too.
Try
veml.setGain(VEML7700_GAIN_1_8) ; // set gain = 1/8
veml.setIntegrationTime(VEML7700_IT_25MS); // set 25ms exposure time
then you'll get it able to handle the brightest light it can measure.