ESPHome ESP32 Photoresistor

Success.
Short: Don’t fully understand what I did wrong before. Probably holding the hand over photoresistor wasn’t enough. Needed to put a finger on it!

Thanks everyone for all the great pointers :heart:

So I’ve setup a regular Photoresistor, figured out how to use the multimeter and getting “lux” differences. Connected it with 10k resistor to esp32. As soon the esp32 turns on the multimeter stops working on the ‘headphone 20k’ setting so changing to ‘v “with straight line” 20’ and getting some kind of differences.

Putting it on GPIO32 and ESP32 board D32 and getting 1.1v. However when I put my finger over the photoresistor something actually changes. I’m getting lower voltage.

Tried @picohassiotts suggestion and getting better values. This might actually work. getting around 50 - 255 in difference.

@Hellis81 to my understanding the board should be a 10k resistor.

Back to the board I got. First the multimeter measure gnd and data with ‘ohm?’ and getting values. Now connect it with esp32 (not changing any settings). The multimeter still works and now getting differences with 0 - 35.

@zoogara after using the suggested attenuation the lux values got even better due to reading of voltage higher than 1.1v. Lux now varies from 20 - 700 when using a simple photoresistor and 10k resistor. Will use this instead of the “boards”.

My final config

  - platform: adc
    pin: GPIO32
    name: "Skylight Illuminance"
    update_interval: 10s
    unit_of_measurement: lx
    attenuation: 11db
    filters:
      - lambda: |-
          return (x / 10000.0) * 2000000.0;
2 Likes