Pages: [1]   Go Down
Author Topic: Display Lux with LDR  (Read 1787 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The LDR im using is a MLG4458 with the following specs:

Light Resistance @ 10 Lux(Kohm) = 100-200
Light Resistance @ 100 Lux(Kohm) = 20-35
Dark Resistance @ (Mohm) = 20

Ive got it connected to my arduino with a 39K resistor (LDR from 5v to PinA1 and 39K from GND to PinA1).

The 39K gives the best light range, giving analog readings of around 12 in a dark room with only the TV on and gives around 970 when i shine a very bright light source directly into the LDR. Now i want to display the LUX instead of analog values. Any help?

Code:
int InteriorLDR = 1;
int InteriorLDRreading;


void setup () {
Serial.begin(9600);
}

void loop() {
 InteriorLDRreading = analogRead(InteriorLDR);
 Serial.print("Interior - Analog - ");
 Serial.print(InteriorLDRreading);
 Serial.println("");
 delay(2000);
}
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 604
Posts: 33448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Not easy because of two things:-
1) the large range given for each light level suggests you will need to calibrate individual sensors.
2) the resistance to light reading is not linear, so you need to build up a look up table to convert it

Without more data or a calibrated light source or a calibrated light meter I don't think you can do it.
Logged

0
Offline Offline
Shannon Member
****
Karma: 201
Posts: 11744
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you know the actual technology used in the LDR you might be able to research an equation to relate light to resistance - this will involve several assumptions but might give good enough results.  If I remember rightly the common CdS LDRs work by the light generating electron-hole pairs in the CdS (which is a semiconductor) which make it more conductive.

You might be able to calibrate the sensor using a PWM controlled LED light source (I think LDRs have a slow response and will see an PWM LED as effectively a continuous source).  If not calibrate you should be able to check the validity of any equation you find.
Logged

[ I won't respond to messages, use the forum please ]

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 604
Posts: 33448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The LDR im using is a MLG4458
Have you got a link to the data sheet, I can't find one.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The LDR im using is a MLG4458
Have you got a link to the data sheet, I can't find one.

http://www.mantech.co.za/datasheets/products/MLGXXXX.pdf

It has specs for alot of different LDR's in there
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 604
Posts: 33448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Looking at the test conditions, 2 hours illumination at 400 - 600 LUX and then testing at 100 and 10 it doesn't sound the most accurate of sensors.
I am not sure you can do anything useful without calibration. Can you get hold of a photographic exposure meter these were sometimes calibrated in LUX.
Logged

Pages: [1]   Go Up
Jump to: