TCS3200 colour sensor (GY-31) with ESP32

Supply 3.3-5 V Bus GPIO Measures color
S0S1S2S3OUTOEVCCGND

Pins and ESP32 wiring

PinRoleESP32 pinNotes
S0Input (the ESP32 drives it)D25Output frequency scaling bit 0
S1Input (the ESP32 drives it)D26Output frequency scaling bit 1 (S0 HIGH, S1 LOW = 20 %)
S2Input (the ESP32 drives it)D27Colour filter select bit 0
S3Input (the ESP32 drives it)D32Colour filter select bit 1
OUTOutput (the part drives it)D33Square wave: its frequency follows the light level. Level = VCC: power from 3V3
OEInput (the ESP32 drives it)D23Output enable, active LOW. Can be tied to GND
VCCPower3V3Use 3V3 so OUT stays at 3.3 V
GNDGroundGND

Suggested wiring for the 30-pin ESP32 DevKit, avoiding flash, input-only and strapping pins. BoardPilot checks it for you as you wire.

Sources

Try it in 3D in BoardPilot

BoardPilot Part data (JSON)

Related parts

Part data: CC BY 4.0, free to reuse with credit to BoardPilot.