ESP32 + TEMT6000 with Esphome False Readings

Hi, I’ve setup an ESP32 with TEMT6000 connected to ADC0/GPIO36 configured as below, and the reading fluctuates, I’ve tried other pins with the same results, I noticed I get readings even when noting is connected to the pin as well, with nothing connected and viewing the log for a few minutes, it goes from “Got voltage=0.04V” to “Got voltage=0.05V” to “Got voltage=0.00V” to “Got voltage=0.02V” and so on, is this an issue with the ESP32?, or do I need additional configuration / hardware?, with the same sensor on a D1 Mini pin A0 the readings are as expected, any assistance will be greatly appreciated.

  - platform: adc
    pin: A0  ### tried with GPIO36 same resulth, and ADC0 which Esphome doesn't recognize
    name: "Bedroom Lux"
    update_interval: 30s
    unit_of_measurement: lux
    filters:
      - lambda: |-
          return (x / 10000.0) * 2000000.0;

ESP32
image
TEMT6000


Hookup

Was working “fine” for me on GPIO34:

Try a less noisy power supply.

Add some decoupling capacitance to the signal line.

@makai I tried setting it to various pins with the same results, trying to figure why there is readings without the sensor.

@tom_l Tried with two different power sources, multi-port charger and laptop, and got the same result, the confusing part is the readings with nothing connected to the pins, I’ll try with another power source and see what the results are.

Readings with sensor and it’s the same without anything connected.

[13:38:52][D][adc:056]: 'Bedroom Lux': Got voltage=0.00V
[13:39:22][D][adc:056]: 'Bedroom Lux': Got voltage=0.00V
[13:39:52][D][adc:056]: 'Bedroom Lux': Got voltage=0.00V
[13:40:22][D][adc:056]: 'Bedroom Lux': Got voltage=0.00V
[13:40:52][D][adc:056]: 'Bedroom Lux': Got voltage=0.68V
[13:41:22][D][adc:056]: 'Bedroom Lux': Got voltage=0.00V
[13:42:22][D][adc:056]: 'Bedroom Lux': Got voltage=0.25V
[13:42:52][D][adc:056]: 'Bedroom Lux': Got voltage=0.37V
[13:43:22][D][adc:056]: 'Bedroom Lux': Got voltage=0.54V
[13:43:52][D][adc:056]: 'Bedroom Lux': Got voltage=0.00V
[13:44:22][D][adc:056]: 'Bedroom Lux': Got voltage=0.31V
[13:44:52][D][adc:056]: 'Bedroom Lux': Got voltage=0.00V
[13:45:22][D][adc:056]: 'Bedroom Lux': Got voltage=0.27V
[13:45:52][D][adc:056]: 'Bedroom Lux': Got voltage=0.00V

Update New wall wart power supply - Nothing connected to pin

[14:00:48][D][adc:056]: 'Master Bed Lux': Got voltage=0.00V
[14:00:53][D][adc:056]: 'Master Bed Lux': Got voltage=0.21V
[14:00:58][D][adc:056]: 'Master Bed Lux': Got voltage=0.00V
[14:01:03][D][adc:056]: 'Master Bed Lux': Got voltage=0.00V
[14:01:08][D][adc:056]: 'Master Bed Lux': Got voltage=0.00V
[14:01:13][D][adc:056]: 'Master Bed Lux': Got voltage=0.00V
[14:01:18][D][adc:056]: 'Master Bed Lux': Got voltage=0.00V
[14:01:23][D][adc:056]: 'Master Bed Lux': Got voltage=0.00V
[14:01:28][D][adc:056]: 'Master Bed Lux': Got voltage=0.08V
[14:01:33][D][adc:056]: 'Master Bed Lux': Got voltage=0.00V
[14:01:38][D][adc:056]: 'Master Bed Lux': Got voltage=0.06V
[14:01:43][D][adc:056]: 'Master Bed Lux': Got voltage=0.01V

how did you solve the your problem? thanks!