Skip to content
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

Complete circuit diagram showing ESP8266 connected to both the TCS34725 colour sensor and an RGB LED module
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

Quick Reference

ESP8266ComponentPin
VinColour SensorVin
GNDColour SensorGND
D1Colour SensorSDA
D2Colour SensorSCL
D7RGB LEDRed
D8RGB LEDGreen
D3RGB LEDBlue

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.