Basic LED Questions (Sorry!)

Hello all,

I am new to Arduino and microcontrollers in general.

I want to use about 6 meters of WS2812B LED (undecided if 30 or 60 LEDs/meter) to run at the side of my stairway. It will turn on and run up the stair similar to this. Please help me decide if 30 LED/meter will be enough or not.

I currently have an Uno. Will Nano do the job? It's smaller so thinking about it.

I have some questions regarding how to power it. If I go with 30 LEDs/meter, that's 180 LEDs and so a 5V 12A power supply will be sufficient. If I go with 60/meter, that's double so I guess 25A supply? Will need to check if they are available, don't want to go and get a metal enclosure supply box if I can avoid it.

Either case, how do I wire this all up? I got the gist of it that the 3 pins on the LED strip will hook up to a digital PWM pin on the board while the power and ground are joined to the respective pins on the supply (via a DC barrel plug). And a couple of lines going from the board's Vin to the power supply + line and GND to the - line. But:

  1. How do I connect the ground from board to the ground line running from power supply to LED? I just solder it at a midpoint on the line? Same question about Vin connection, solder anywhere on the line?

  2. Regarding power injections, I believe it is best to have a power injection every 150 LEDs. So, how do I do this? Is it a matter of taking a line from DC barrel plug and soldering it on the 5V point on the next LED strip, while data and ground is connected to the previous strip? Or am I carrying over ground from DC barrel plug too?
    For 6m, and at 30 LED/meter, I think I can get away with having no power injection? Or should I have a connection on each end to be safe? What about if I decide on 60 LED/meter?

It's a bit confusing when trying to explain this in words, but I hope it's understandable.

Thanks for bearing with me!

a)
Vin requires 7V; you're better of using the 5V pin on the Arduino to power it. It will be safe on the Nano when using USB for e.g. code uploads at the same time, you might want to disconnect the 5V when using USB on Uno when doing uploads.
b)
WS2812 does not need PWM; any pin will do.
c)
You can simply wire Arduino ground to external power supply ground
d)
Power approx. every 60 leds; use cable / wire that is sufficient to carry the max. current. It will run in parallel with your strips and you can tap at certain points (both 5V and GND).

// EDIT
e)
An Uno/Nano will probably do; it depends if you want to run different patterns and the amount of LEDs; 180 LEDs basically requires 540 bytes of RAM when using the standard libraries, just to store the data that you want to send.

Thanks sterretje.

a)
Vin requires 7V; you're better of using the 5V pin on the Arduino to power it. It will be safe on the Nano when using USB for e.g. code uploads at the same time, you might want to disconnect the 5V when using USB on Uno when doing uploads.

Ah, gotcha. What's that about Nano? We don't need to unplug USB when 5V pin as in like we do on Uno? Why's that?

c)
You can simply wire Arduino ground to external power supply ground

I guess my question was more in line with the physical components used. At the DC barrel plug, I will just join in the board's ground. So at the plug, it will have both board's ground and LED's ground.

d)
Power approx. every 60 leds; use cable / wire that is sufficient to carry the max. current. It will run in parallel with your strips and you can tap at certain points (both 5V and GND).

Noted. So that's 3x connections to the LED strip if I use 180 LEDs. When you say parallel, do I still connect the LED strips to one another via all three pins? Seems not right if each strip will be tapped in?

If I separate the strips into 60 LEDs each (total 180 LEDs), will that not create a little gap in between the strips and ruin the aesthetics when LEDs are on? I'll be doing same as video and use a cover to diffuse the light, however.

EDIT: A quick illustration of how I imagine it. Am I right?

Thanks again.

Please don't link to pictures on image hosting sites. Just attach your image to your post. It will be automatically embedded into your post.

The Nano has different power circuitry compared to Uno. It's simpler and has disadvantages but also advantages, one of which it that it protects your pc/laptop if the external psu is slightly higher voltage than the usb voltage.

Regarding your grounding question, you won't be using the barrel socket (or Vin pin). You will be connecting the 5V psu to the strip, and a separate feed to the 5V & GND pins on the nano or uno. Many strips come with a second pair of wires already soldered to the start of the strip. You could use those to power the Arduino (might have to extend them, but thin wires are ok as only enough power for the Arduino will flow through them, which is about as much as 2 leds).

When you say parallel, do I still connect the LED strips to one another via all three pins?

No, only 5V & gnd. If you short the data line to another part of the strip, it could be damaged, but probably you will just get either the same colours on both parts of the strip, or random unwanted colours on the second part.

The way I would try to use the extra power wires would be to separate the 5V and ground and strip off 5~10mm of insulation without cutting the conducting wires. Then tin the exposed wire and the pads on the back of the strip. Finally solder the exposed wires to the pads. That way, you don't need to cut the strip.

PaulRB:
No, only 5V & gnd. If you short the data line to another part of the strip, it could be damaged, but probably you will just get either the same colours on both parts of the strip, or random unwanted colours on the second part.

I'm confused more now! (My fault, not yours!)
Ok so, not sure if you saw my image but when tapping in 5v and ground:

  1. I am taking the two from the power supply, yes? So that's more wires coming from the power supply.
  2. After reading your posts, that means the LED strips don't need to be separated. So example, the second strip will still be connected to first strip via all three pins (5v, ground and data) even while there's another 5v and ground coming from power supply? Will that not be too much volts for second strip?

Simple enough. Here's the image:


OK, so everything about this is wrong!

Let's start with some basics.

An electrical circuit is a closed loop; it includes both supply and return connections. In electronics, we give one of these connections a special significance, we call it "ground". Why do we do this since the circuit always has two sides and they are of equal importance as both are always required?

Well, the reason is that electronic circuits consist of multiple individual circuits simultaneously serving different functions. One function is to provide operating power to the various devices, while another is to send control signals or "data" from one part to another. The "ground" is in general the common return to many circuits, it becomes a single wire that pairs up with many others to form different functional circuits.

So for starters, whenever we speak of "providing power" to anything, we always mean two wires, "power" and "ground". And in the same way, providing "data" means connecting both data and ground wires. If you are needing to provide both data and power, that means three wires, travelling together.

And the "travelling together" is also important here. Microcontrollers, like all computers, operate at Radio Frequencies ("RF"). A wire that is separate from its partnered ground wire, is called an "antenna" - it will transmit and receive any "RF" signal. We do not want that - we want all of the data generated by the Arduino to go to the LED strip and no other signals to be picked up by the LED strip, so the data wire and its ground reference wire must always be a pair using twin or "figure eight" cable. But since the power wires are carrying fluctuating currents due to the switching of the LEDs (which use PWM internally) and since the ground is also common to the data wire, then the power wires (supply and ground) must also travel as a pair. So in fact, all three must travel as a pair. :grinning:

Next, when we say "power every 60 LEDs" (3.5 Amps at full brightness), we mean to power at both ends of the 60 LEDs so the LEDs at each end are equally powered since the flimsy foils on the strips cannot carry much current without dropping voltage. This clearly means you do not cut or break the strip; you have the heavier power cable - preferably 2 mm2 gauge - travelling along with the LED strip (because it is paired with the conductors on the LED strip) and each 60 or so (the figure is not critical) LEDs, the power cable connects across to the 5 V and ground pads which are provided on the strip.

This is of course, somewhat inconvenient but necessary if you expect to operate the strip at anything near full power. Mind you, full power (white) will light up not just the stairway, but the whole room! :astonished:

So what do we have here? We have the LED strip(s) in a continuous run. Together with them we have a power cable alongside, and every so often, the 5 V and ground are bridged over to the strip. The power supply may be connected to this cable anywhere; either end or even somewhere in the middle if that was the most practical. At the "data in" end of the strip, the 5 V power and the data connect - three wires together - to the Nano.

And yes, the Nano is far more practical than the UNO, you do not need to disconnect (only) the 5 V wire from the "5V" pin when you connect via USB to a PC as you do with the UNO. It is also cheaper, smaller and you can either solder to a bare Nano board or use header pins to connect to a "solderless breadboard"for prototyping and then stripboard or a "terminal adapter" for the final design. (Or even a custom PCB.) Connecting to the header sockets on the UNO is quite inconvenient unless you use a suitable "shield".

Noting that for the stair lights application, you will want to connect other things such as sensors to control the animation. The "Vin" and "barrel jack" are not useful for power connections, just a novelty for playing with the Arduino alone, or with a few simple LEDs or such.

Paul__B:
....

Thanks Paul_B,
Very detailed reply. Appreciate the patience.
The little lesson about RF was really interesting. Learned a bit there.
Okay so, I think I understand the majority. I'm still needing confirmation on how connections happen though. Again, apologies for my disgusting illustration but is it like this?

The LED strip is going to be one long 5m strip. I won't need to break them up. Every 2m (30 LEDS/m), I will have ground and power (5v) soldered on to the respective points on the strip ends.
I just don't know what to imagine regarding the power cable running along withwith the LED strip. I imagine this being quite heavy with wires. Is there an image I can look at perhaps because it's quite difficult thinking about what will connect where from power supply to the different points on LED strip.
Thanks again. Typed on my phone or I would elaborate but hopefully you understand me.

yamiprem:
is it like this?

That looks about right.

Maybe you could get away with 1 mm2 power cable running alongside. 1 mm2 is what is used where I live for house wiring to the lighting circuit, but that is double insulated so is quite heavy. For 5 V, you do not need any heavy insulation at all, so you are generally looking at "speaker cable". Now while you can buy some ridiculously heavy speaker cable, you only want the conductors to be the suitable rating without heavy insulation - I understand that is about "16 AWG".

Paul_B,

How is the bridging off that occurs every 60 LEDs on the power cable done? Is there a name perhaps I can search on Google Images to get a visual understanding?

Thanks.

Why is it that having 5V on BOTH ends of a LED strip not cause problems? If that's no problem, then theoretically thinking, having two (or more?) 5V connections at one end will also cause no problems?

Thanks.

yamiprem:
Why is it that having 5V on BOTH ends of a LED strip not cause problems? If that's no problem, then theoretically thinking, having two (or more?) 5V connections at one end will also cause no problems?

You need to study some basic electrical theory. School physics.

You can think of current flowing in a wire as being a little like water flowing in a pipe. Electrical current is like the flow of the water. Voltage is like the water pressure pushing the water along the pipe.

Imagine you have 2 pipes with the same pressure inside. You connect the two pipes to either end of a valve. When you open the valve, how will the water move?

Redundant supply of electricity is a critically important principle. The power lines in your street are wherever possible, fed at both ends and at any branch in order to ensure that a failure of one transformer (which does happen from time to time) causes the least - if any - interruption to your supply. You will notice (at least where there are overhead power lines which are an unfortunate legacy of "doing it on the cheap and nasty") many isolation switches between sections, perhaps every half km or so to manage the alternate supply paths.

In Britain, "ring wiring" of power outlets in houses has apparently been common, where both ends of a chain of outlets are fed from the switchboard. The concept is similar to what we describe for your LED strips, it permits the use of relatively lightweight conductors along the string.

And the same is probably - should in fact be - true of water mains. :grinning:

OMG :o

Say it’s not so.

It is so.

I only learned a few years back that this is not the way it is done in other countries, had always assumed it was.

Thanks all.

I got it.

Question, I read it's suggested to add a capacitor of up to 1000 microfarads between the power and LED strip.

Is this for all injection points or just one at the beginning at power supply point before all injection cables bridge off?

Thanks.