Light Measurement:

Post date: May 11, 2015 12:39:36 AM

Components:

  • ArduinoUno

  • Photo resistor VT90N2LDR

  • Resistor 10KOhms

Breadboard:

Schematic:

Formula:

from the article https://arduinodiy.wordpress.com/2013/11/03/measuring-light-with-an-arduino/

I'm using the rough formula that relates the resistance of an LDR to the light in Lux. That is:

Rldr=500/Lux, or

Lux=500/Rldr (in kOhm)

Lux = 500 / (10 * ((aref_voltage - (A1Reading * (aref_voltage / 1024))) / (A1Reading * (aref_voltage / 1024))))

Where A1 readingis the Digital reading of the Pin A1 of the arduino form 0 to 1023.

IDE Code:

Conclusion:

The Lux calculation from the resistance of the LDR is really a rough one. Don't expect accurate reading but it work. The alternate method would have been to calibrate the reading according to Lux reader on android device like beeCamLightMeter.

My day night counter could be improved but it's good enough for the basic function of counting how many time i open the door of the fridge and to answer to the fundamental question : Is the light inside a fridge is switched of when i close the door (fridge version of the schrodinger cat).