Amplifying voltage to increase number of LEDs in series

Hi there,
I'm currently working on a project that allows me to dim RBG LEDs using analogue inputs. The endgame of the project is to make a light paintbrush for artistic purposes. My current issue is with getting enough voltage to my LEDs. Right now I can only power a single RGB LED (the type from the link listed below) using the arduino. I am using the PWM output pins 9, 10, and 11 to power each individual color channel. These pins only produce a high voltage of 5V, so they can only power one of my LEDs because the highest voltage drop (the blue and green color channels) is 3.2 volts. I have 20mA constant current drivers wired in series with each color diode in the RGB LED, and they can handle MAX 50Vdc. I want to increase the brightness by increasing the number of RGB LEDs I wire in series. I would like to have 9 LEDs wired in series, so I would need about 30V High to pass through the current driver and 'satisfy' the LEDs so to speak. I also want to keep the PWM control of the LEDs' brightness, so I cannot have any inversion of the voltage (the voltage must remain positive). Ideally I could just change the high value on the PWM to 30volts and keep the low value below 2.1 volts (the lowest voltage drop on the RGB LEDs ). Thanks very much!

A makeshift schematic is attached to this post.

Here are links to the parts listed:
Constant current driver

RGB LED

Potentiometer

Here's my code. I'm not experiencing difficulties with it, but it may help whoever reads this:

[quote]
[color=#7E7E7E]/*[/color]
[color=#7E7E7E]  Analog input, analog output[/color]
[color=#7E7E7E] [/color]
[color=#7E7E7E] Reads three analog input pins, maps the results to a range from 0 to 255[/color]
[color=#7E7E7E] and uses the result to set the pulsewidth modulation (PWM) of 3 output pins that apply to 3 different color channels.[/color]
[color=#7E7E7E] [/color]
[color=#7E7E7E] The circuit:[/color]
[color=#7E7E7E] * potentiometer connected to analog pin 0.[/color]
[color=#7E7E7E]   Center pin of the potentiometer goes to the analog pin.[/color]
[color=#7E7E7E]   side pins of the potentiometer go to +5V and ground[/color]
[color=#7E7E7E] * LED connected from digital pin 9 to ground[/color]
[color=#7E7E7E] * repeat for analog pins 1 and 2 and PWM pins 10 and 11[/color]
[color=#7E7E7E] [/color]
[color=#7E7E7E] created 29 Dec. 2008[/color]
[color=#7E7E7E] modified 9 Apr 2012[/color]
[color=#7E7E7E] by Tom Igoe[/color]
[color=#7E7E7E] This modification Oct. 20, 2014[/color]
[color=#7E7E7E] by Gabriel Jacobson Copyright[/color]
[color=#7E7E7E] [/color]
[color=#7E7E7E] */[/color]

[color=#7E7E7E]// These constants won't change.  They're used to give names[/color]
[color=#7E7E7E]// to the pins used:[/color]
[color=#CC6600]const[/color] [color=#CC6600]int[/color] redPot = A2;  [color=#7E7E7E]// Analog input pin that the potentiometer is attached to[/color]
[color=#CC6600]const[/color] [color=#CC6600]int[/color] redLed = 11; [color=#7E7E7E]// Analog output pin that the LED is attached to[/color]
[color=#CC6600]const[/color] [color=#CC6600]int[/color] greenPot = A0;  [color=#7E7E7E]// Analog input pin that the potentiometer is attached to[/color]
[color=#CC6600]const[/color] [color=#CC6600]int[/color] greenLed = 9; [color=#7E7E7E]// Analog output pin that the LED is attached to[/color]
[color=#CC6600]const[/color] [color=#CC6600]int[/color] bluePot = A1;  [color=#7E7E7E]// Analog input pin that the potentiometer is attached to[/color]
[color=#CC6600]const[/color] [color=#CC6600]int[/color] blueLed = 10; [color=#7E7E7E]// Analog output pin that the LED is attached to[/color]

[color=#CC6600]int[/color] redPotValue = 0;        [color=#7E7E7E]// value read from the pot[/color]
[color=#CC6600]int[/color] redLedValue = 0;        [color=#7E7E7E]// value output to the PWM (analog out)[/color]
[color=#CC6600]int[/color] greenPotValue = 0;        [color=#7E7E7E]// value read from the pot[/color]
[color=#CC6600]int[/color] greenLedValue = 0;        [color=#7E7E7E]// value output to the PWM (analog out)[/color]
[color=#CC6600]int[/color] bluePotValue = 0;        [color=#7E7E7E]// value read from the pot[/color]
[color=#CC6600]int[/color] blueLedValue = 0;        [color=#7E7E7E]// value output to the PWM (analog out)[/color]

[color=#CC6600]void[/color] [color=#CC6600][b]setup[/b][/color]() {}

[color=#CC6600]void[/color] [color=#CC6600][b]loop[/b][/color]() {
  [color=#7E7E7E]// read the analog in value:[/color]
  redPotValue = [color=#CC6600]analogRead[/color](redPot);            
  [color=#7E7E7E]// map it to the range of the analog out:[/color]
  redLedValue = [color=#CC6600]map[/color](redPotValue, 0, 1023, 0, 255);  
  [color=#7E7E7E]// change the analog out value:[/color]
  [color=#CC6600]analogWrite[/color](redLed, redLedValue);                     
  
    [color=#7E7E7E]// read the analog in value:[/color]
  greenPotValue = [color=#CC6600]analogRead[/color](greenPot);            
  [color=#7E7E7E]// map it to the range of the analog out:[/color]
  greenLedValue = [color=#CC6600]map[/color](greenPotValue, 0, 1023, 0, 255);  
  [color=#7E7E7E]// change the analog out value:[/color]
  [color=#CC6600]analogWrite[/color](greenLed, greenLedValue);     
  
    [color=#7E7E7E]// read the analog in value:[/color]
  bluePotValue = [color=#CC6600]analogRead[/color](bluePot);            
  [color=#7E7E7E]// map it to the range of the analog out:[/color]
  blueLedValue = [color=#CC6600]map[/color](bluePotValue, 0, 1023, 0, 255);  
  [color=#7E7E7E]// change the analog out value:[/color]
  [color=#CC6600]analogWrite[/color](blueLed, blueLedValue);       
  
  [color=#CC6600]delay[/color](1);                     
}

[/quote]

I am struggling with uploading my schematic that can hopefully illustrate some of my details. I am attempting to attach it as a jpeg file, but the form claims that it is not passing security protocols. I scaled it down to 257KB, but it still won't pass. If you are interested in seeing my schematic I would love some help getting it posted!

Chicken_Boy:
I am attempting to attach it as a jpeg file, but the form claims that it is not passing security protocols.

That's a new one to us!

Perhaps you had better post the exact message you are getting.

Let me see. To wire RGB LEDs in series, you need to have ones that have six terminals, both anode and cathode for each colour. You are confusing "analog" with PWM, it would be best to stick to the term PWM as that is what the Arduino is executing.

Given that you actually do have six-pin RGB LEDs, you would want something like a ULN2003 to buffer the PWM outputs for your series chains of LEDs and current drivers.

Scale the image to no more than 1000 pixels wide and then try again with the attachments.

Note that if the RGB LED is common anode or common cathode you can not connect them in series.

Also when posting code DO NOT use the "format for forum" option in the Arduino IDE, as this produces the rubbish you see and we can't copy that into our own systems.

The current limit device you refer to

is pretty neat - I wonder what it actually consists of?

Back to your original question - you need a boost regulator to get the 5V supply up to 12V, 15V, whatever is needed for your LED string.
You can find them at www.pololu.com under Regulators.
Then a high voltage/high current capable buffer to sink current from the supply thru the LEDs the current limit device to Gnd.
ULN2003/ULN2803 is one way. TPIC6B595 shift register is another.

Click "Attachmetns and other options" below to browse to your locally stored drawing and Attach it.

Thanks Grumpy_Mike for the advice on sizing down the image, it worked!

Chicken_Boy:
Thanks Grumpy_Mike for the advice on sizing down the image, it worked!

Still can't see it though?

Thanks very much to all who replied. The attachment titled Schematic1 represents the current circuit I am working with. It functions fine and I can control all color channels from 0-100%. The second attachment Schematic2 shows the circuit I designed based on CrossRoads post. I used 9-30V step-up voltage regulator U3V50AHV from pololu.com. Here's the link Pololu Adjustable 9-30V Step-Up Voltage Regulator U3V50AHV . Does it require an external power source other than the arduino? I can't imagine it can magically turn 5V into 30V without an external power supply.

CrossRoads:
Then a high voltage/high current capable buffer to sink current from the supply thru the LEDs the current limit device to Gnd.
ULN2003/ULN2803 is one way. TPIC6B595 shift register is another.

Are those separate pieces from the voltage regulator? I'm a bit confused about what they do and how I should wire it.

Arduino can only supply a few hundred mA of 5V current. External supply with a splitter cable would be better so you do not overwhelm the reverse polarity protection diode (Vin is after the diode).

You are supplying PWM into the enable signal into 3 boost regulator?
I was envisioning more 1 regulator to source current into the anodes of the LED strings, and then the PWM into the ULN2003/current sink to turn the LEDs on.

The devices on the left side the potentiometers? They need their outer "legs" connected to +5 & Gnd also so the wiper can have 0-5V to go to the analog inputs.

The Boost regulators also.
I figure that is not shown for clarity.

CrossRoads:
You are supplying PWM into the enable signal into 3 boost regulator?
I was envisioning more 1 regulator to source current into the anodes of the LED strings, and then the PWM into the ULN2003/current sink to turn the LEDs on.

I drew Schematic3.jpg to match my vague understanding of this statement. Is the ULN2003 the current sink? Do I still require my current regulators (Dynaohm things)? I know the wiring of the voltage regulator doesn't make sense in that situation, but it's the best I could think of. I'm still not confident about the purpose of the ULN2003.

CrossRoads:
Arduino can only supply a few hundred mA of 5V current. External supply with a splitter cable would be better so you do not overwhelm the reverse polarity protection diode (Vin is after the diode).

I've never heard of a splitter cable before, so I'm not sure what to be looking for with that. All the searches I did showed what looked like large cables that forked off. Would I put one of these forks in the Vin and gnd on the arduino (which would only really put 5V across the slide pots) and the other into the light circuit whatever that may be. wouldn't my power then overwhelm the arduino.

Schematic4.jpg shows what I was hoping I could do to amplify voltage. The purple boxes with yellow Ts represent voltage amplifying transistors if those even exist. It may help you get an insight into my intention.

CrossRoads:
The devices on the left side the potentiometers? They need their outer "legs" connected to +5 & Gnd also so the wiper can have 0-5V to go to the analog inputs.

The Boost regulators also.
I figure that is not shown for clarity.

Yes. Spot on.

Regarding schematic 4.

  1. It is not a schematic, it is a physical layout diagram. It is hard to read, I have to turn it into a schematic in my head.

  2. you have no base resistors in those transistors and anyway they are wired up wrong, it will not work

I'm still not confident about the purpose of the ULN2003.

It is a current sink that can stand that high voltage that would otherwise kill the Arduino. You could do the same with those transistors if you wired them up correctly. That is emitter to ground, collector to constant current device, then to the LEDs and finally the LEDs to the high voltage. Do not forget the base resistors and please post schematics not those things.

Regarding schematic 3.
No just very wrong.

FYI, those are not schematics, those are pictorial diagrams.

Hi can you draw a circuit diagram and take a picture of it please. jgp png or pdf format is fine.
Or use a CAD package such as EXPRESS...
Thanks..

Tom...... :slight_smile:
PS 3/4 hr in fetal position this time.. go the shakes and all......

#3, just what is needed.
Or #4, if the transistors are wired as Grumpy Mike noted.

CrossRoads:
#3, just what is needed.

For the current sinks yes. But the boost regulator is wired wrong and the LEDs are wired wrong.

Sorry for posting a stupid diagram but this is the correction to "schematic" 3.

The voltage regulator was not wired right and the slider pots were connected to the high voltage which will ensure you burn out the analogue inputs.

And you had no ground on the darlingtons, and you had the rails on the left hand side swapped over with regard to colours, you still have but that caused some editing.

Figure 4 suggests that the PNP transistors are controlling the 30V supply but this would mean that the Arduino outputs would (even with the essential resistors) need to go up to that voltage to turn them off. That cannot happen.

Diagram 3 is the closest to the truth - you can use either a ULN2003 or discrete transistors and resistors, but I specified the ULN2003 for simplicity.

CrossRoads:
TPIC6B595 shift register is another.

No it isn't (a way to drive it). He specified PWM.

Missed Mike's latest posting while I was composing this. Now he has lost the ground connection on the power converter! :o

So you're thinking shiftPWM can not drive the TPIC6B595?

CrossRoads:
So you're thinking shiftPWM can not drive the TPIC6B595?

Don't know it, but it is necessarily software PWM requiring continuous execution of code, the original intention was I gather, to use the hardware.

With regard to the power converter, what you do not want to do is to up-convert a voltage you have already converted down, so you power it from whatever is the original source voltage, presumably from Vin unless that is regulated from some higher voltage in which case you would of course, use that voltage.

And that said, except for using more of the constant current drivers, once you are using the ULN2003, you might just as well put the LEDs in series-parallel, three in series if your actual source is 12V. For 20 mA, carefully chosen resistors would generally do instead of the constant current drivers - which I suspect are simply a variant of this circuit:

with the input resistor going to the second collector.

Of course, it also follows that you could use that circuit for each of the three channels; its drop-out voltage is less than 1V.

Hi,I think this will help.

Feel free to criticize and offer changes.

Tom...... :slight_smile:
PS. That felt so good, therapy, drawing a CIRCUIT DIAGRAM