πŸ”†

LM393 Light

Just light or dark

Page 49 of 64 MCP / API open OTA updates

Page 49 reads the DO pin of an LM393 photoresistor module on GPIO18 and turns it into a light/dark verdict, showing the raw level and a flip counter. The threshold comes from the module trimmer.

This is not the BH1750 on page 39: it gives a switch, not a lux value.

Screen

On-screen interface

A recreation of this page on the 2.41-inch AMOLED display (600 Γ— 450). Actual interaction and layout follow the latest firmware.

Peripheral LM393 Β· GPIO18
StatusDarkDO = low
Flips6 today
Thresholdtrimmer
PinGPIO 18
Health88
Digital only β€” BH1750 (p.39) for lux
Screen Β· Page 49
May differ from the actual interface; the screen of the real device is the final reference.
Highlights

Key capabilities

πŸ”†

Light/dark

High/low level mapped to a plain verdict.

🎚

Trimmer

Sets how dark counts as dark.

πŸ”’

Flip count

How many times it toggled today.

🩺

Health score

Stuck-high or stuck-low is flagged.

Specifications

Technical specs

PinGPIO 18
OutputDigital DO (3-pin version has no AO)
Supply3.3–5 V
Firmware pagePage 49
Use Cases

Typical scenarios

Dusk detection

Trigger a reminder or lamp when it gets dark.

Beam break

An interrupted light path flips the level.

Commands

Related commands

page 49  Open the LM393 page
lm  Read level and verdict

Read the full API & command reference β†’

⚠ Boundaries & notes
  • Digital only β€” no lux value; use the BH1750 on page 39 for that.
  • Photoresistors are slow (tens of ms), not for fast light signals.

Other feature pages