Pages: [1]   Go Down
Author Topic: Converting TEMT6000 value to lux  (Read 1037 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My apology as I'm a newbie in arduino.

Can anyone please advice me how do I convert the
output of TEMT6000 into lux?

I followed the code in bildr.org guide
http://bildr.org/2011/06/temt6000_arduino/

and the output value is from 0 - 1023.

I would like to convert the readings to LUX. How do I do it?

Please advice.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8967
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In the datasheet you will find a chart that shows the relationship between lux and collector current.  From that chart you can calculate the formula.  Then you just need to convert the voltage measured to a current measurement.

The series resistor is 10,000 Ohms so the current should be voltage / 10000.

The voltage is: analogRead() * 5.0 / 1024.0
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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

In the datasheet you will find a chart that shows the relationship between lux and collector current.  From that chart you can calculate the formula.  Then you just need to convert the voltage measured to a current measurement.

The series resistor is 10,000 Ohms so the current should be voltage / 10000.

The voltage is: analogRead() * 5.0 / 1024.0

Thank you for your advice. Based on the chart I find out that the formula is y = 1/2(x) + 0. Please correct me if I'm wrong.

Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8967
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your advice. Based on the chart I find out that the formula is y = 1/2(x) + 0. Please correct me if I'm wrong.

I agree.  So lux = 2 * microamps.

Code:
float volts = analogRead() * 5.0 / 1024.0;
float amps = volts / 10000.0;  // across 10,000 Ohms
float microamps = amps * 1000000;
float lux = microamps * 2.0;

Or to mash it all together:
Code:
float lux = analogRead() * 0.9765625;  // 1000/1024

This should give you a value between 0 and 1000 lux.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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

Thank you for all your advices. Really appreciate it very much.
Logged

Pages: [1]   Go Up
Jump to: