# Converting TEMT6000 value to lux

**URL:** <https://forum.arduino.cc/t/converting-temt6000-value-to-lux/180676>\
**Category:** Sensors\
**Created:** [August 29, 2013, 5:25am UTC](https://forum.arduino.cc/t/converting-temt6000-value-to-lux/180676 "2013-08-29T05:25:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 29, 2013, 5:25am UTC](https://forum.arduino.cc/t/converting-temt6000-value-to-lux/180676/1 "2013-08-29T05:25:27Z")

</div>

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](http://bildr.org) guide  
[http://bildr.org/2011/06/temt6000\_arduino/](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.

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [August 29, 2013, 11:58am UTC](https://forum.arduino.cc/t/converting-temt6000-value-to-lux/180676/2 "2013-08-29T11:58:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 30, 2013, 5:03pm UTC](https://forum.arduino.cc/t/converting-temt6000-value-to-lux/180676/3 "2013-08-30T17:03:09Z")

</div>

> johnwasser:  
> 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.

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [August 30, 2013, 11:32pm UTC](https://forum.arduino.cc/t/converting-temt6000-value-to-lux/180676/4 "2013-08-30T23:32:58Z")

</div>

> cklim85:  
> 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.

```arduino
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:

```arduino
float lux = analogRead() * 0.9765625;  // 1000/1024

```

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

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 31, 2013, 1:55pm UTC](https://forum.arduino.cc/t/converting-temt6000-value-to-lux/180676/5 "2013-08-31T13:55:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bitNine](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@bitNine](https://forum.arduino.cc/u/bitNine)\
**Post date:** [October 5, 2015, 3:12am UTC](https://forum.arduino.cc/t/converting-temt6000-value-to-lux/180676/6 "2015-10-05T03:12:50Z")

</div>

Just found this thread while trying to figure out how to calculate lux with a cheap light meter I bought. NO data sheet available. I've checked the resistance of the photoresistor, and it's 20k ohms when dark, and close to 200 ohms with a bright flashlight. Attempting to use the code above, it seems that one flaw is that the voltage is backwards. The lux value goes down when light is added, and up when light is taken away. Swapping it so that it's the difference from 5 volts of the volts value (volts = 5.0 - volts), gets pretty close, but it's still not right. I have a cheap lux meter that I used to try to calculate a lux:ohms table. It's crazy how NOT linear the photoresistor is. While darkness is 20k ohms, 41 lux is ~6k ohms. 14k ohms for 40lux is certainly not linear to the max of 155 ohms at 110,000 lux.

The question is, might this just have to do with this specific photoresistor, or is it common for them to not have linear values like that? I have a TEMT6000 on order, and really want to be able to calculate lux values. Maybe my cheap lux meter is, um... cheap.

---

<div class="post-metadata">

**Author:** ![bitNine](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@bitNine](https://forum.arduino.cc/u/bitNine)\
**Post date:** [October 8, 2015, 7:03am UTC](https://forum.arduino.cc/t/converting-temt6000-value-to-lux/180676/7 "2015-10-08T07:03:54Z")

</div>

For the record, I got the TEMT6000, and while it works, it FREAKS out with any light that is over 1000 lux. The calculation here works relatively well. Definitely different from the other light sensor I tested.

---

<div class="post-metadata">

**Author:** ![rrwiyatn](https://avatars.discourse-cdn.com/v4/letter/r/9de0a6/32.png) [@rrwiyatn](https://forum.arduino.cc/u/rrwiyatn)\
**Post date:** [March 31, 2016, 9:45pm UTC](https://forum.arduino.cc/t/converting-temt6000-value-to-lux/180676/8 "2016-03-31T21:45:13Z")

</div>

Hi guys,

if I change the resistor to 1K instead 10K, can I measure up to 10k lux? If yes, what will be the formula to calcualte the lux?

I already changed the resistor and it seems that it can go higher than 1K lux. I just don't know where the saturation point is..

Also, isn't this sensor use log scale?

Rey

---

<div class="post-metadata">

**Author:** ![bryan\_brennan](https://avatars.discourse-cdn.com/v4/letter/b/b782af/32.png) [@bryan\_brennan](https://forum.arduino.cc/u/bryan_brennan)\
**Post date:** [November 15, 2019, 8:18pm UTC](https://forum.arduino.cc/t/converting-temt6000-value-to-lux/180676/9 "2019-11-15T20:18:52Z")

</div>

I performed the conversion mentioned above, but my TEMT6000 reads only ~25% the lux read by my lux meter.

Can you think of a reason for this discrepancy?

Also, is the 10k Ohm resistor something that you added to the circuit? Or is it something internal to the TEMT6000 board?

---

<div class="post-metadata">

**Author:** ![Qete\_Arg](https://avatars.discourse-cdn.com/v4/letter/q/7993a0/32.png) [@Qete\_Arg](https://forum.arduino.cc/u/Qete_Arg)\
**Post date:** [April 5, 2020, 7:47pm UTC](https://forum.arduino.cc/t/converting-temt6000-value-to-lux/180676/10 "2020-04-05T19:47:50Z")

</div>

> johnwasser:  
> I agree. So lux = 2 \* microamps.
> 
> ```arduino
> float volts = analogRead() * 5.0 / 1024.0;
> 
> ```

float amps = volts / 10000.0; &nbsp;// across 10,000 Ohms  
float microamps = amps \* 1000000;  
float lux = microamps \* 2.0;

> ```arduino
> 
> Or to mash it all together:
> 
> ```
> 
> float lux = analogRead() \* 0.9765625; &nbsp;// 1000/1024
> 
> ```arduino
> 
> This should give you a value between 0 and 1000 lux.
> 
> ```

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 10:02am UTC](https://forum.arduino.cc/t/converting-temt6000-value-to-lux/180676/11 "2021-05-06T10:02:32Z")

</div>


