Arduino Color Mixing Lamp using RGB LED and LDR

What if we can generate different colors using a single RGB led and make our room’s corner more attractive? So, here is a simple Arduino based color mixing lamp which can change color when there is change in light in the room. So this lamp will automatically will changes its color according to the light conditions in the room.

Arduino Color Mixing Lamp using RGB LED and LDR

Every color is the combination of Red, Green and Blue color. So we can generate any color by using red, green and blue colors .So, here we will vary PWM i.e. intensity of light on LDRs. That will further changes the intensity of red, green and blue color in RGB LED, and different colors will be produced.

Below table shows the color combinations with respective change in duty cycles.

Materials required:

  • 1 x Arduino UNO
  • 1 x Breadboard
  • 3 x 220-ohm resistors
  • 3 x 1-kilohm resistors
  • Jumper wires
  • 3 x LDRs
  • 3 x colored strips (red, green, blue)
  • 1 x RGB LED

LDR:

We will use photoresistor (or light-dependent resistorLDR, or photo-conductive cell) here in this circuit. LDRs are made from semiconductor materials to enable them to have their light-sensitive properties. These LDRs or PHOTO RESISTORS works on the principle of “Photo Conductivity”. Now what this principle says is, whenever light falls on the surface of the LDR (in this case) the conductance of the element increases or in other words, the resistance of the LDR falls when the light falls on the surface of the LDR. This property of the decrease in resistance for the LDR is achieved because it is a property of semiconductor material used on the surface.

Here three LDR sensors are used to control the brightness of individual Red, Green and Blue LED inside RGB Led. Learn more about controlling LDR with Arduino here.

RGB LED:

There are two types of RGB LEDs, one is common cathode type (common negative) and other is common anode type (common positive) type. In CC (Common Cathode or Common Negative), there will be three positive terminals each terminal representing a color and one negative terminal representing all three colors.

Arduino Color Mixing Lamp using RGB LED and LDR schematics

In our circuit we are going to use CA (Common Anode or Common Positive) type. In Common Anode type, if we want RED LED to be ON in, we need to ground the RED LED pin and power the common positive. The same goes for all the LEDs. Learn here to interface RGB LED with Arduino.

Read more: Arduino Color Mixing Lamp using RGB LED and LDR


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top