How to Design LED Driving Circuit for RGB LEDs

Thread Starter

kenn2323

Joined Jul 18, 2019
17
I am trying to connect 2 RGB LEDs (R:2.25V, G/B: 3.3V) to Arduino so that I can control the intensity and colour through an app. The LEDs should be powered by a battery (12V 4Ah) and the battery should be solar charged. I am unsure on how to design a LED driving circuit for it. Can anyone provide a circuit diagram for this? Many Thanks!
 

dl324

Joined Mar 30, 2015
16,846
Welcome to AAC!

Do you want both LEDs to have the same brightness and color?

Which Arduino?

How much external circuitry do you have in mind?
 

Thread Starter

kenn2323

Joined Jul 18, 2019
17
Welcome to AAC!

Do you want both LEDs to have the same brightness and color?

Which Arduino?

How much external circuitry do you have in mind?
Hi,

Yes, both LEDs are controlled to have the same brightness and color. I will be using an Arduino Uno. I am thinking about a buck converter circuit.

Thanks.
 

dl324

Joined Mar 30, 2015
16,846
Arduino Uno has 6 PWM capable digital outputs.

Since you're going to be adjusting brightness from the Uno, you'll want to operate the LEDs at a relatively high current. Do you have a datasheet for the LEDs?

You can operate the LEDs from the 12V battery directly. You'll need a voltage regulator for the Uno, but a linear regulator will probably suffice.

Do you have a preference of device for switching the LEDs? What is the common LED terminal? Anode or cathode?
 

djsfantasi

Joined Apr 11, 2010
9,156
Arduino Uno has 6 PWM capable digital outputs.

Since you're going to be adjusting brightness from the Uno, you'll want to operate the LEDs at a relatively high current. Do you have a datasheet for the LEDs?

You can operate the LEDs from the 12V battery directly. You'll need a voltage regulator for the Uno, but a linear regulator will probably suffice.

Do you have a preference of device for switching the LEDs? What is the common LED terminal? Anode or cathode?
The Uno can also be powered by the 12V battery. It has a voltage regulator onboard and can be powered from 7-20V.

So no linear regulator needed. If you insist of using one and are using the onboard voltage input, I’d regulate to 9VDC.

You could regulate to 5VDC, but you have to be careful what pins you use to connect power to the Arduinos. Vin is often used to power the Arduino, but the supplied power has to be greater than 7VDC.
 

djsfantasi

Joined Apr 11, 2010
9,156
Addendum:

You’ll need 3 PWM pins on the Arduino Uno. One goes to two resistors connected to the red pins (one per LED), one to two resistors connected to the green pins. And the third connected to two resistors connected to the blue pin. We need extra resistors because RGB LEDs can’t be connected in series.

The common pin of the two LEDs connects to ground.

The resistors for the red pins should be 470Ω. The resistors for the other RGB pins should be 300Ω.

Your Arduino sketch can adjust the PWM values to fine tune the brightness.
 

dl324

Joined Mar 30, 2015
16,846
The Uno can also be powered by the 12V battery. It has a voltage regulator onboard and can be powered from 7-20V.
I keep forgetting about that. I've only been using Arduino for about a month or so and I haven't gotten past the stage where it's connected to the laptop for uploading or testing circuits.
 

dl324

Joined Mar 30, 2015
16,846
If you want to drive the LEDs at their maximum DC current rating, you'll want to use a transistor or MOSFET because the outputs are only good for 20mA sink/source. The 40mA you see frequently mentioned is the absolute maximum parameter which is a do not use and expect the device to survive spec.
 

Thread Starter

kenn2323

Joined Jul 18, 2019
17
Arduino Uno has 6 PWM capable digital outputs.

Since you're going to be adjusting brightness from the Uno, you'll want to operate the LEDs at a relatively high current. Do you have a datasheet for the LEDs?

You can operate the LEDs from the 12V battery directly. You'll need a voltage regulator for the Uno, but a linear regulator will probably suffice.

Do you have a preference of device for switching the LEDs? What is the common LED terminal? Anode or cathode?
I will be using Cree® XLamp® XM-L® Color LEDs. Their normal current is 350mA. I do not have a preference for switching the LED so far. How do you determine whether anode or cathode is the common terminal? I am sorry, I am new to this.

Thanks
 

djsfantasi

Joined Apr 11, 2010
9,156
I will be using Cree® XLamp® XM-L® Color LEDs. Their normal current is 350mA. I do not have a preference for switching the LED so far. How do you determine whether anode or cathode is the common terminal? I am sorry, I am new to this.

Thanks
350mA! You’re definitely going to need a MOSFET or transistor driver. 350 is a lot more than 20!

You determine which is common by reading the datasheet. Or, which polarity is connected to the RGB terminals... if it’s positive, you have a common cathode which should be connected to ground and you’ll need a logic level p-channel MOSFET rated for 0.5A or more. Without looking at the datasheet, that is. Each pin may only draw 1/3 of the current, and a MOSFET rated for 120mA or more (a 200mA rating may be safer). Actual ratings should be obtained from the datasheet.

If the RGB pins are connected to ground, you have a common anode. To drive them, you’ll need logic level n-channel MOSFETS, rated for the same current as above.

Seriously, the Cree datasheet is a must to have.
 

djsfantasi

Joined Apr 11, 2010
9,156
Here it is...

I haven’t read it yet. I’m eating dinner!

Ok, I read a little. These ain’t your fathers LEDs. There is no common connection to the LEDs. And, the LEDs are individually addressable and the leads are not polarity sensitive!

We’ll have to analyze this product carefully. It’s more than lighting an LED with an Arduino!
 

Attachments

Last edited:

Thread Starter

kenn2323

Joined Jul 18, 2019
17
350mA! You’re definitely going to need a MOSFET or transistor driver. 350 is a lot more than 20!

You determine which is common by reading the datasheet. Or, which polarity is connected to the RGB terminals... if it’s positive, you have a common cathode which should be connected to ground and you’ll need a logic level p-channel MOSFET rated for 0.5A or more. Without looking at the datasheet, that is. Each pin may only draw 1/3 of the current, and a MOSFET rated for 120mA or more (a 200mA rating may be safer). Actual ratings should be obtained from the datasheet.

If the RGB pins are connected to ground, you have a common anode. To drive them, you’ll need logic level n-channel MOSFETS, rated for the same current as above.

Seriously, the Cree datasheet is a must to have.
I have attached the datasheet for it. So what type of circuit will I be looking at?

Thanks
 

Attachments

Thread Starter

kenn2323

Joined Jul 18, 2019
17
Here it is...

I haven’t read it yet. I’m eating dinner!

Ok, I read a little. These ain’t your fathers LEDs. There is no common connection to the LEDs. And, the LEDs are individually addressable and the leads are not polarity sensitive!

We’ll have to analyze this product carefully. It’s more than lighting an LED with an Arduino!
What does it mean? Does it mean it cannot be done?
Thanks
 

Analog Ground

Joined Apr 24, 2019
460
This is a really interesting set of LEDs. I think a bit of a challenge to drive. For one thing, it looks to me that higher operating current reduces the efficacy a lot. This can be seen by the Relative Luminous Flux vs Forward Current graph in the data sheet. So, I think operating with PWM is not a good idea. This would require operating at a higher current all the time it is "on" which reduces the efficiency. This looks to me like a good candidate for a commercial LED driver. Anybody know a suitable one?
 

Analog Ground

Joined Apr 24, 2019
460
So what LED driver do you recommend
In my post just before the one you replied to, I ask if anyone knew of one. I am not familiar with them at all. My comment is about the possible inefficiency of PWM for this particular set of LEDs. Seems to me the optimal driver would be some programmable combination of buck converter and current source (four channel, of course!) to be power efficient in the driver and optically efficient in the LEDs. I am anxious to see if such a thing exists without doing the work of finding one.
 

Sensacell

Joined Jun 19, 2012
3,432
Here it is...

I haven’t read it yet. I’m eating dinner!

Ok, I read a little. These ain’t your fathers LEDs. There is no common connection to the LEDs. And, the LEDs are individually addressable and the leads are not polarity sensitive!

We’ll have to analyze this product carefully. It’s more than lighting an LED with an Arduino!
They are polarity sensitive- the extra diodes inside protect the LED's from damaging reverse voltages.
The package has 8 leads- all the connections are available so you can configure the drive any way you need.

An LM3414 for each color will be very efficient and relatively simple- each one can be controlled by a PWM input via the DIM input.

To drive two LED's- connect them in series.

The biggest challenge is mechanical- these beasts need proper SMD mounting with a significant heatsink.
 

Attachments

djsfantasi

Joined Apr 11, 2010
9,156
They are polarity sensitive- the extra diodes inside protect the LED's from damaging reverse voltages.
The package has 8 leads- all the connections are available so you can configure the drive any way you need.

An LM3414 for each color will be very efficient and relatively simple- each one can be controlled by a PWM input via the DIM input.
That’s the problem reading datasheets on a mobile device. It looked to me that the diodes were LEDs. My bad! You’re absolutely correct.
 
Top