I am working on my first LED project and am trying to clean things up now before soldering everything together.
The project is very basic. The arduino only controls 3 leds in one color moving from left to right in a loop. All is powered by a powerbank which goes into the micro usb port of the arduino.
I have a 100nF capacitor between 5V and Ground and am wondering if this is really needed as it also runs well without it. Is there any risk removing this from the setup?
It looks more like a100 microFarad capacitor to me but it is not strictly necessary for it to be there. The main purpose of such a capacitor would be to help remove any spikes in power to the circuit but they are unlikely to occur when using a power bank as opposed to a mains power supply
A more important consideration would whether you have current limiting resistors in series with the LEDs and I would have expected to see them on the breadboard. You may, of course, have then in the circuit but out of view in the 'photo
What is the purpose of the resistor than can be seen ?
Now we learn its a WS2812 strip.... Could have said this up front as this explains the need for capacitor and resistor. You cropped the photo removing the strip from sight too!
The electrolytic cap works to reduce the noise on the supply from the rapid current changes pulled by the strip - for a long strip I'd make it bigger, and perhaps use a separate supply for the strip too.
It dose two things.
First it acts a an impedance matcher you you don't get any reflections on the line which would cause distortion of the data signal. That is close to what you said but got cause and effect the wrong way round.
Second it acts as protection for the first LED in the list if the Arduino is powered up but the strip is not.
That capacitor is supposed to be placed across the power and ground right at the very start of the strip for maximum effect. Yes it is needed, the longer the strip the more it is needed.
Thank you @Grumpy_Mike for the explanation. Makes sense.
In regards to the capacitor. The strip is only 0.5m and there are only 3 leds on at the same time. Do i understand correctly that in this case the need for the capacitor is rather small?
It is called phantom powering and can cause latch up, or other damage. It is when the signal from a powered up device feeds into say an input of an unpowered device. The unpowered device will draw current through the ESD protection diodes and attempt to power the device. A series resistor will limit the amount of current the unpowered device will use thus limiting any damage.