arduino-rgb-led-controller-shield-with-led-strip

This Arduino shield is designed to drive RGB (Red Green Blue) LED strips by using PWM (Pulse Width Modulation) method. It can brighten up and down each color independently by changing the duty cycle of PWM.You can produce any color by mixing the different percentage of colors. The endless turn rotary encoder on the board allows the user select the channel and change its brightness. Low Rds-on resistance MOSFETs, which are the switching elements, generate very low heat dissipation even used with large number of LEDs.

Circuit Design

arduino-rgb-led-controller-shield-schematic-620

arduino-rgb-led-controller-shield-single

RGB (Red Green Blue) LED is a very common type of LED which includes red, green and blue LED chips in a single package. Although they are in a single package, each LED chip can be controlled independently. Thanks to this feature, we can generate huge number of different colors by using RGB LEDs and of course the resulting color can be changed dynamically using a RGB LED controller.

The main controller of the board is Arduino Uno. It reads the input data from the rotary encoder and according to that information, it switches the MOSFETs. The MOSFETS are driven by pins 9, 10 and 11 which have internal PWM functionality. The direction signals of the rotary encoder, A and B, are read by using pins 2 and 3 which are connected to the internal interrupt module. The pushbutton on the encoder is used for channel selection and it is connected to pin 1 set as input.

arduino-rgb-led-controller-shield-with-arduino

The PWM module of Arduino is very easy to use. Just setting the pin as output and changing the duty cyle with analogWrite() function is sufficient.

The rotary encoder generates two signals during rotation. The waveforms of that signals define the direction. They are connected to the External Interrupt pins, 2 and 3. By using the Interrupt Service Routine, we can handle the encoder signals. There is also a push button on the encoder which helps to select the active channel.

The IRF540 MOSFET has a low Rds-on resistance, 77 mΩ. The junction to ambient thermal resistance of IRF540 is denoted as 62 °C/W in its datasheet. This means when one of the channels of your LED strip draws 3.6A (P=I2 x R), the temperature of the MOSFET switching that channel will increase 62°C.

arduino-rgb-led-controller-shield-powered

PCB Design

arduino-rgb-led-controller-shield-PCB

Assembly And Test

The components of the board are listed below.

Parts

Quantity Part Description Designator
3 IRF540 Power MOSFET D2PAK Q1 Q2 Q3
3 SMD LED White 0805 D1 D2 D3
1 SMD LED Blue 0805 D4
1 SMD LED Green 0805 D5
1 SMD LED Red 0805 D6
1 Rotary Encoder with Push-On Button U1
3 100R 5% 0805 Resistor R7 R10 R11
4 300R 5% 0805 Resistor R4 R5 R6 R8
1 680R 5% 0805 Resistor R9
1 750R 5% 0805 Resistor R12
3 2k 5% 0805 Resistor R1 R2 R3
3 100nF 50V 0805 X7R SMD Ceramic Capacitor C1 C2 C3
1 1×6 2.54mm Female Header J4
2 1×8 2.54mm Female Header J1 J3
1 1×10 2.54mm Female Header J2
4 1×2 Terminal Block J5 J6 J7 J8

You can see the RGB LED controller shield in action in the video below.

Software

The Arduino sketch is given below. Please feel free to ask your questions in the comments section.