Electronic Brick - Light Sensor Brick - Readings Problem

Greetings!

I bought the electronic brick from this manufacturer: One-stop Online Shop For Smart Home, HMI Display, Airspy, Diy Kits l ITEAD STUDIO and I'm a starter in arduino.

I've started some simple projects and now I would like to have readings of lux.

I used the following code I found in the manufacturer's website:
"int ASignal = A1;
void setup() {
Serial.begin(9600);
}

void loop() {
int sensorValue = analogRead(ASignal);
Serial.print("LUX = ");
Serial.println(sensorValue);
delay(1000);
}"

The problems are:

  • what kind of reading am I getting? It's a 0-1024 equivalent of a 0-5V signal, right?
  • I'm getting bigger values with the lights off than with the lights on, is this alright? does it work as a inverse proportionality?
  • how can I convert the bit value to lux?

Thank you very much,
Best Regards,
Pedro

Please supply a drawing of how you have it connected. Freehand on a sheet of paper and photographed will do.

Your analogue signal is proportional to the analogue reference voltage that I assume is 5V in this case.

Conversion to lux requires calibration. IE, a known light level and take a reading. This will change for various light levels so needs to be done over the range. It will also change with different boards. There is no direct conversion of analogue reading to lux.

Weedpharma

Good Morning and thank you for your answer.

The connection is simple. Ground to Ground, V to 5V and Signal to A1.

About calibration, i should get a calibrated lux measurer and calibrate it through it with a set of measured points, right?

But... what about this giving me an inverse proportional response? The more light, the less value of analog input? Is this right?

Thank you,
Pedro Oliveira

An LDR resistance reduces when light falls on it. This lower R takes the voltage on A1 closer to gnd. Hence dark makes the R higher and voltage bigger.

If you require a calibrated output you have to calibrate against a lux meter.

Weedpharma