Hi! Breaking my head with one concept...
I have to measure light flickering index with Arduino. In first place, I thought about LDR to measure tiny changes in voltage given by it to calculate this index. It didn't go well so I decided to change my sensor to a light sensor, measuring luxes [lx]. I chose BH1750
So general idea is to SAMPLE LUX VALUES EVERY 21ms. Here is why: Expected flickering is around 100Hz (2x50Hz -> double of the amount of Hertzs in current flow in my country) - it corresponds to period of 20ms. So finally I decided to use "undersampling" to catch it and that's why the period of sampling is exactly 21ms.
I tried to use different modes, different sensivities, different time registers... but no luck.
The changes that I measure are definietly too small. The flickering index calculated from collected data is around 1.5% while it should be at least 30% in the source I have tested...
So... the questions are:
-> is this idea of measuring even correct?
-> can I use this lux sensor? I mean...it can't be TOO SLOW...In most hardcore mode it samples data every 16ms...
-> maybe I2C devices are not good for those purposes and I should go for analog output sensor and use old good built-in ADC?
Any help would be nice, thank You in advance!
#include <Wire.h>
#include <BH1750FVI.h>
BH1750FVI LightSensor;
void setup()
{
Serial.begin(115200);
LightSensor.Begin(Addr_LOW, Continous_L);
LightSensor.SetMTReg(69);
LightSensor.SetSensitivity(2.00);
}
void loop()
{
float lux = LightSensor.GetLux();// Get Lux value
Serial.println(lux);
delay(21);
}