Reading analog values from a light sensor

Wicked
Posts: 10
Joined: Sat Jun 05, 2021 4:20 pm

Reading analog values from a light sensor

Postby Wicked » Tue Jun 29, 2021 4:25 pm

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.

tommeyers
Posts: 184
Joined: Tue Apr 17, 2018 1:51 pm
Location: Santiago, Dominican Republic

Re: Reading analog values from a light sensor

Postby tommeyers » Wed Jun 30, 2021 12:56 am

IT Professional, Maker
Santiago, Dominican Republic

Wicked
Posts: 10
Joined: Sat Jun 05, 2021 4:20 pm

Re: Reading analog values from a light sensor

Postby Wicked » Wed Jun 30, 2021 8:56 am

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.

Who is online

Users browsing this forum: Bing [Bot] and 49 guests