Hi All,
I'm a bit confused my a NeoPixel LED that I'm trying to light - it feels like it should be simple and it isn't lighting at all.
I wrote a very simple program just to test it, which is below. It is on a Mega, but it just doesn't seem to do anything, it's literally just plain off, not even a hint of light from it. What am I doing wrong?
Help please!!!! It's a bog standard 8mm Neopixel LED from the PiHut. I also bought cheaper ones ADA106? from eBay and it does the same nothing!
So, solved not solved really.
It works perfectly on a breadboard, with two LEDs. Granted it needs a lot more than that eventually, but with two it works fine.
However, I have now soldered it onto veroboard and the first LED lights perfectly, as programmed. The second LED is very hit and miss. Sometimes on at full brightness, sometimes blue, sometimes red, basically, erratic and certainly not what I'm asking it to be.
Is that likely due to the lack of the suggested 0.1uF capacitor? (Which I have ordered as I don't have any at the moment)
It's a bit odd that it works perfectly on the breadboard, but soldered it's a bit funky!
It's literally all wired up exactly the same from breadboard to veroboard, the program is the same etc. The only difference is that it's on a veroboard rather than breadboard.
Which is why I'm confused!!!
Could be, yes. If you look at neopixel/ws2812 strips or ws2812 LEDs in those tiny PCBs, they have 0.1uF caps for decoupling. APA106 LEDs, like bare ws2812 LEDs, do not have them built-in (such large caps can't really be made in silicon) so need them attaching externally.
Breadboards, with all their internal connection strips/clips, have a certain amount of "stray" capacitance. Sometimes this is a problem, like when trying to build high frequency circuits on a BB. Sometimes, it can be just enough to make circuits work which have missing decoupling caps, but you should never rely on that.
Sry, missed that part. Two work fine for a few different colours? And obvsly you upped the pixel number constant?
So, yeah, the decoupling caps. It can't hurt to get in the habit of using the recommended series resistor, 470 not a critical value, and the larger electrolytic cap on the supply lines.
What does the capacitor do exactly?
As I understand it, a capacitor is in effect a low capacity battery that discharges as soon as the 'power' stops, so how does that help?
Sorry for the daft question.
OK, so I'm back to being vexed again.
I've added two more LEDs (I need 70 in the end so this is currently looking rather laborious) and the second two don't light at all.... but, when I press upload to pop the code back up to the Arduino the first of the two turns on properly.
The power is getting there as I've checked using a multimeter. I have changed the code (shown below) so I don't know what I'm doing wrong.
I realise this isn't the best example of soldering, but frankly, you should've seen the previous attempt - it looked like a moose had sneezed solder on it.