Module: Hardware
Wiring
The Chameleon Lamp connects two components to the ESP8266: a TCS34725 colour sensor (to read colours) and a common-cathode RGB LED (to reproduce them). That means seven wires total.
Tip
Already built the Colour Picker? The colour sensor wiring is identical — just add the three RGB LED wires and you are good to go!
Circuit Diagram
1
Colour Sensor (I2C)
Connect the TCS34725 colour sensor using four wires — two for power and two for the I2C data bus.
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 data wire where colour readings travel between the sensor and the microcontroller.
D2 → SCL (Clock)
The clock wire that keeps the sender and receiver perfectly in sync.
2
RGB LED (PWM Output)
Connect the common-cathode RGB LED module using three signal wires. Each wire carries a PWM signal that controls the brightness of one colour channel.
D7
Red
GPIO 13
D8
Green
GPIO 15
D3
Blue
GPIO 0
Pin Reference
// Colour Sensor (I2C)
#define SDA_PIN 5 // D1
#define SCL_PIN 4 // D2
// RGB LED (PWM output)
#define LedR 13 // D7
#define LedG 15 // D8
#define LedB 0 // D3
#define SDA_PIN 5 // D1
#define SCL_PIN 4 // D2
// RGB LED (PWM output)
#define LedR 13 // D7
#define LedG 15 // D8
#define LedB 0 // D3
Quick Reference
| ESP8266 | Component | Pin |
|---|---|---|
| Vin | Colour Sensor | Vin |
| GND | Colour Sensor | GND |
| D1 | Colour Sensor | SDA |
| D2 | Colour Sensor | SCL |
| D7 | RGB LED | Red |
| D8 | RGB LED | Green |
| D3 | RGB LED | Blue |
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.