Skip to content

LDR Module DO Pin Not Responding to Lux Slider in Simulation #1030

@gbtucson

Description

@gbtucson

I'm using the wokwi-photoresistor-sensor module in a simulation with an ESP32 DevKit. I’ve connected the DO pin to GPIO22, and expected it to output HIGH when bright, LOW when dark, based on the ambient light simulated by the lux slider.
However, I’m seeing that the DO pin remains stuck at a fixed value (usually HIGH), regardless of how I adjust the lux slider. The serial monitor shows no response, and the code using digitalRead() on GPIO22 doesn't detect transitions. The module is properly powered (VCC and GND), and wiring was verified.
What I tried:

  • Swapped from DO to AO with a voltage divider (LDR + 10kΩ resistor) wired to GPIO22 — this setup works perfectly.
  • Re-tested DO pin with a minimal sketch that prints digitalRead(22) — still no change as lux slider moves.
  • Verified that the module is connected to esp32, and the rest of the simulation is functioning (switch input, relay output).
    Expected behavior:
    DO pin should respond to lux changes based on its internal comparator, and flip states accordingly.
    Request:
    Could you confirm whether the DO pin is currently simulated to respond to ambient light changes? If there's a fixed internal threshold or missing configuration for the comparator, exposing that or clarifying the behavior would help. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions