TCS3200 colour sensor (GY-31) with ESP32
Supply 3.3-5 V
Bus GPIO
Measures color
Pins and ESP32 wiring
| Pin | Role | ESP32 pin | Notes |
|---|---|---|---|
| S0 | Input (the ESP32 drives it) | D25 | Output frequency scaling bit 0 |
| S1 | Input (the ESP32 drives it) | D26 | Output frequency scaling bit 1 (S0 HIGH, S1 LOW = 20 %) |
| S2 | Input (the ESP32 drives it) | D27 | Colour filter select bit 0 |
| S3 | Input (the ESP32 drives it) | D32 | Colour filter select bit 1 |
| OUT | Output (the part drives it) | D33 | Square wave: its frequency follows the light level. Level = VCC: power from 3V3 |
| OE | Input (the ESP32 drives it) | D23 | Output enable, active LOW. Can be tied to GND |
| VCC | Power | 3V3 | Use 3V3 so OUT stays at 3.3 V |
| GND | Ground | GND |
Suggested wiring for the 30-pin ESP32 DevKit, avoiding flash, input-only and strapping pins. BoardPilot checks it for you as you wire.
Sources
- TAOS TCS3200 datasheet, S0/S1 frequency scaling, S2/S3 photodiode type, OE active LOW; supply 2.7 to 5.5 V
- TAOS TCS3200 datasheet, Output is a frequency, not I2C; header order varies between boards
Try it in 3D in BoardPilot
Related parts
A02YYUW waterproof ultrasonic distance (UART)A3144 hall effect switchAM312 mini PIR motion sensorATGM336H GPS/BeiDou moduleBeitian BN-220 GPS moduleBenewake TF-Luna LiDAR (UART mode)
Part data: CC BY 4.0, free to reuse with credit to BoardPilot.