 # Messed up my Lego project - need 8V to power set of LEDs

Hi There,

I've been working on this big Lego spaceship wiring in lots of LEDs and testing with a Lego power supply. On one circuit I discovered I could connect 3 LEDs in series and they wouldn't need a resistor.

When I hooked up the Arduino this one circuit didn't work. It turns out the Lego power supply is at around 8V while the Arduino is 5V and I guess it isn't enough to fire the LEDs.

Is there something fairly simple I could do to power up these LEDs? I'm pretty ignorant of electronics but should be able to follow some basic instructions.

On one circuit I discovered I could connect 3 LEDs in series and they wouldn't need a resistor.

While this might "work" it's a BAD IDEA.*

Here is an [u]online LED resistor calculator[/u]. This is based on [u]Ohm's Law[/u] which defines the relationship between voltage, resistance, and current.

Note that in this case Ohm's Law is applied to the resistor, not the LED. Ohm's Law is a law of nature and it's ALWAYS true, but the resistance of the LED is not constant so we calculate the resistor value from the voltage across the resistor and the current through it.

In a series circuit, the same current flows through all series components and the voltage is divided across the series components. i.e. You might have 5V applied with current of 20mA, with 2V across the LED and 3V across the resistor. (From Ohm's Law, 3V @ 20mA would require a 150 Ohm resistor.)

LEDs are non-linear (like all diodes). As you reach the operating voltage ("breakdown voltage" for a regular diode) the resistance drops dramatically. If you go above the operating voltage you'll suddenly get too much current and potentially burn-out the LED or something else...

LEDs are normally powered by a constant current source, not a constant voltage source. With a constant current source, the voltage across the LED "falls into place". A resistor can approximate a constant current source (if the voltage is constant and high enough).

You can put LEDs in series with the appropriate voltage and the appropriate resistor. As a rule-of thumb, the resistor should "drop" at least as much voltage as the LEDs. A standard LED is usually rated at about 2V, so a 12V power supply with 3 LEDs in series would give you 6V total across the LEDs and 6V across the resistor and that would be OK.

* Some cheap LED flashlights don't have a resistor because they rely on the internal resistance of the battery to limit LED current. That can work with a known battery but if you were to replace the AA cells with D cells, you'd probably fry the LED. And if you try that with a regular power supply, you'll either blow the power supply or the LED. Better flashlights use a switching constant-current regulator, which is more efficient than a resistor and it gives constant light output throughout the life of the battery.

Thanks for the information DVDdoug, sounds like I really messed up.

Unfortunately I can't change the fact that they are wired in series (they are built and glued in the Lego) but I can add the resistor.

Is it possible to use the Arduino to supply the 12V or will I have to add another power supply and have the Arduino control it with a relay?

Nexonic: Is it possible to use the Arduino to supply the 12V or will I have to add another power supply and have the Arduino control it with a relay?

You never use the Arduino to "supply" power for LEDs (other than an indicator or two), relays, motors or such, so that question has no actual meaning.

You provide a 12V or similar supply, (regulation is not so important for powering LEDs,) you determine what current is required for the LEDs (look it up in their specification), and what voltage they drop. It may in fact be easier to simply supply them with 12V through a 1k resistor in order to measure the voltage drop across them, then calculate the correct resistor according to the supply voltage you will be using minus that voltage drop.

To control them with the Arduino, you need an NPN transistor with its emitter to ground and its collector to the negative side of each chain with the resistor between the positive side and the supply. You have a resistor from an Arduino control pin to the base of each transistor, probably 330 ohms. Within the current handling capacity of the transistor, you can control a few such chains from the collector so that all light together. Need I say it, the power supply to the LEDs must have its negative connected to the emitters of all the transistors which is also the negative terminal of the Arduino.

Thanks for the help. I got it working using a transistor as Paul__B described.

Here is the Arduino. All the leds are running straight off the Arduino except the one circuit i soldered in series.

Here is the ship. It seems circuit 1 (running lights) is turning on automatically I’ll have to look into that.

This is the trouble area. I ended up using 1 resistor for 2 circuits of 3 leds in series. I know it wasn’t the right way to do it now but I soldered and glued myself into a corner and at least it’s working.

Nice spaceship!

One way to recover is to use a dedicated LED driver chip. I like the Maxim range and I’ve used the MAX6971 as a convenient current-controlled port multiplier. You could probably use one of these to operate your entire spaceship. It doesn’t need any resistors on the LED strings and it doesn’t even need the same number of LEDs in each string. Just give it enough voltage to be able to drive the longest string, a resistor to set the current for all outputs and go to town with the Arduino making pretty patterns.

If you do find you need to share the current between two LEDs (maybe you want two dim ones for the control panels or something) then you must have a separate resistor on each LED. Otherwise the one with the slightly lower voltage (random manufacturing variation) will take all the current and will be much brighter. It looks like this might be what is happening in the second photo. If you have access to any of those LED wires, you can add the resistors anywhere. They don’t have to be ‘before’ the LED. A low value like 10 Ohms on each LED string will be enough, and it won’t change the overall brightness too much.

DVDdoug: Ohm's Law is a law of nature and it's ALWAYS true

Unfortunately you are misinformed. Ohm's law is an emergent behaviour of charge carriers in a dissipative medium. It applies to uniform conductors and semiconductors at current densities below some maximum value (before avalanche breakdown). Generally a very accurate model for metals, uniformly doped semiconductors and ionic liquids at constant temperature.

It doesn't apply at all to insulators, gasses, plasmas, a vacuum, superconductors, quantum tunneling materials and various other more complicated situations.