Page 1 of 1

Reading analog values from a light sensor

Posted: Tue Jun 29, 2021 4:25 pm
by Wicked
Hello!

I have a light sensor, TEMT6000, and I want to read its values and convert them in lux, because the sensor measures illuminance.

Circuit of the sensor:
Image

I'm a bit confuse on how I should set up my ADC pin ( using the adc.h library ) to read the values, and also how to convert them to lux. If anyone has any idea about this, I will be grateful.

PS: I have a ESP32 Lolin. I'm using the ADC1 because I also use WiFi and I know that ADC2 has problems when Wifi is in use.

Re: Reading analog values from a light sensor

Posted: Wed Jun 30, 2021 12:56 am
by tommeyers

Re: Reading analog values from a light sensor

Posted: Wed Jun 30, 2021 8:56 am
by Wicked
Well, I just connected the sensor and used analogRead to see what values I get.

I get values around 40-50 when the sensor is exposed to room light, and if I put my hand 10cm above it, it reads 0 (??). When I use my phone light (torch) to shine on the sensor , it reads anywhere between 50 and 1000 , depending on the distance the light is, or the angle.