i am doing lux meter using Photo-transistor(TEPT4400) with microchip controller. I got resistance value from ADC samples but I dont know how to convert resistance to lux. Please help me to find out.
This is my circuit
Analog i/p
| |
3.6 V ------/////----|----___/-----| |GND
10K /^/^ |
photo transistor (TEPT4400 )
Hole controller will be working on 3.6v Battery supply.
Do you have a Lux meter for verification? If so then make a graph that relates the two properties (resistance measured vs Lux meter reading taken at same time). Then it should be a simple scaling calculation. The Arduino lib actually has a built in function Map() you can use if you know the scaling parameters, however this will only work if your graph gives a straight line.
You might also want to consider whether converting from one set of arbitrary units to another equal arbitrary set is actually necessary in your application. It usually isn't, though it may still be handy to know how.
DonMilne:
Do you have a Lux meter for verification? If so then make a graph that relates the two properties (resistance measured vs Lux meter reading taken at same time). Then it should be a simple scaling calculation. The Arduino lib actually has a built in function Map() you can use if you know the scaling parameters, however this will only work if your graph gives a straight line.
...
Hi Mr. JohnLincoln,
I cant swap the positions because the hardware is already designed for temperature sensor but now we need to use that the same hardware for Lux meter because we don't want to go for schematic change. So please give me more ways to get correct output using the same circuit.
John's suggestion was a "nice to have" - you already had answers before that that easily produce a working design. There's no magic solution here, i.e. there's no getting around the need to calibrate the range of results.
And ps... while I'm here. While I didn't demur at the time for politeness sake, in fact I didn't really agree with John's suggestion anyway. If you do that graph I mentioned earlier, IMHO is isn't important if the slope of the line is positive or negative. It makes no difference at all to the calculation or the result.
Hi DonMilne,
the problem is below 1000lux the resistance of my lux sensor is not stable and there is huge variations in resistance readings. So i am having doubt on my resistance measurement. So kindly tell me my resistance measurement formula is correct or not. i am using the same for temperature measurement and it is working fine.
You can calculate the equivalent resistance of the photodiode at a given light level, but that doesn't help to get the lux value.
What you should do is convert the ADC reading into a lux value. The only way to do that is to compare ADC readings obtained to light levels measured using an accurate lux meter, and work out the proper conversion table or function.
I would need to see a complete function before I could declare it right or wrong. I particularly need to know the types of all variables and 'defines' used. Also I would need to know what function (mapping) you're trying to perform, in generic math terms.
If you're simply trying to correct for instability by averaging a large number (N) of samples, and you have freedom over the choice of N, then the calculation is easier if N is a power of 2. Then, given the sum of N ADC readings, the rounded integer average is given by a simple shift :-
average = (sum + (N>>1)) >> Y;
where Y=Log2(N) => 2^Y == N. E.g. if N=1024, Y=10.
I have to say, if the instability is that bad then I'd want to investigate why. E.g. you may just need a capacitor on a reference voltage. I can't think of any good reason for an LDR reading to fluctuate that much, assuming that air drafts etc aren't affecting it.
Now i am making table for actual Lux value and voltage read from adc for voltage to lux conversion. But at the same time i am looking for easy way to covert my adc readings to lux.
i am doing lux meter using Photo-transistor(TEPT4400) with microchip controller. I got resistance value from ADC samples but I dont know how to convert resistance to lux.