Colour-Matching Mood Light

Requires , ,

This project creates an interactive light display that detects and responds to colours in its environment.

The mood light uses a colour sensor to detect nearby objects, then drives an RGB LED to create different lighting effects based on the detected colour. Four different modes can be selected with a button:

  • Match Colour: Directly displays the detected colour
  • Complementary: Shows the opposite colour
  • Pastel: Displays a lighter version of the detected colour
  • Animated: Cycles between the detected colour and its complement

Parts List

  • Arduino Uno board
  • RGB LED (common cathode)
  • TCS34725 colour sensor
  • Momentary push button
  • 220Ω resistors (3)
  • 10kΩ resistor
  • Jumper wires
  • Breadboard

Assembly Instructions

  1. Connect the RGB LED to the Arduino:
    • Red pin to digital pin 9 (PWM)
    • Green pin to digital pin 10 (PWM)
    • Blue pin to digital pin 11 (PWM)
    • Common cathode to GND
    • Place a 220Ω resistor in series with each LED pin
  2. Connect the push button:
    • One leg to digital pin 2
    • Other leg to GND
    • Add a 10kΩ pull-up resistor between pin 2 and 5V
  3. Connect the TCS34725 colour sensor:
    • VIN to 5V
    • GND to GND
    • SDA to Arduino SDA (A4)
    • SCL to Arduino SCL (A5)