Module: Hardware
Wiring
The Colour Picker uses just four wires to connect the ESP8266 microcontroller to the TCS34725 colour sensor via the I2C protocol.
Circuit Diagram
The 4 Connections
Vin (Power)
Supplies voltage to the colour sensor. Connect ESP8266 Vin to Sensor Vin.
GND (Ground)
Completes the circuit. Connect ESP8266 GND to Sensor GND.
D1 → SDA (Data)
The "talking" wire where actual color data travels back and forth between the sensor and the microcontroller.
D2 → SCL (Clock)
The "metronome" wire that keeps the sender and receiver perfectly in sync.
Quick Reference
| ESP8266 | Colour Sensor |
|---|---|
| Vin | Vin |
| GND | GND |
| D1 | SDA |
| D2 | SCL |
Note
Always double-check your wiring before powering on! Swapping SDA and SCL is the most common mistake and the sensor simply will not respond.
Tip
These two wires (SDA and SCL) use a protocol called I2C. Want to understand how devices talk on a shared bus? Check out the I2C module in the main Candy Sorter course!