Driving an Adafruit Neopixel Ring (24 LED)

I just got a Neopixel ring (WS2812B). I then soldered a wire to one of the GND holes, another wire to one of the +5V power holes, and finally a wire to the IN hole.

Next, I put my Spark Core in a Shield Shield so I could get up to the 5V. I plugged a wall wart into the shield shield and everything fired up. I flashed the Spark Core with the example library you can find in the web IDE for controlling a Neopixel ring and included that in my app, then copied the rainbow code to my main application and flashed the Spark Core.

I have pin D2 going to the Neopixel IN. I have 5V power from the shield shield going to +5V power on the ring. I have GND on the shield going to GND on the ring.

Basically everything works, the spark lights up and “breathes” blue so I know it’s at least running the loop, but none of the LEDs turn on.

Given my newbness I’m assuming I’m doing something stupid here. Can someone please give me some tips on this?

I have done some serial debugging and I’m printing out trace statements. My loop() is still running and the spark core hasn’t crashed. I have a trace statement right before it attempts to do a rainbow and a trace statement after. It takes a very long time to do a rainbow, but it has no visible effect on my neopixel ring.

Quick check; how many amps is your power supply rated for? I’m not sure if I read the files correctly, but if so, then this should be the voltage regulator on the shield shield. If that’s the case, then you’re probably under-powering your neopixels. According to Adafruit, the pixels can draw anywhere between 20 and 60 mA. That would translate to 480-1440mA depending on brightness. Your core can draw up to 300mA when its transmitting data.
300+480=700~ish mA with the lowest brightness. The voltage regulator has a typical rating of 950mA, with a maximum of 1300mA. Your neopixels alone could require more than that (potentially damaging it).
Not only that, but it could be you’re using a power supply which isn’t capable of delivering enough current.

I’m going to assume the examples in the library work, and that there’s an electrical (power) issue somewhere. Try to check those values, and let us know.

What I had plugged into the shield shield was a 9V/3A adapter (what I power my guitar pedals with). I double-checked two different tutorials and I saw one guy running a Neopixel ring (smaller than mine) off the USB power supply (running VIN to the ring’s power) and it worked like a champ… 3 wires, just like mine.

In the “According to Adafruit” link, it suggests that you multiply the number of pixels by 20, then divide by 1000 for the “rule of thumb” current requirement. In my case, 24 pixels x 20 / 1000 is 0.48A. They suggest doing 60 times the number of pixels for absolute safety, which gives me 1.44A. A 3A power source should have absolutely been able to power that pixel ring, Adafruit says you can power a 3m strip (way more than what I have) with a 2A power source.

Unless I read that wrong… it should’ve worked?

If it is a power issue, it might rather be one of the Shield shield voltage regulator (LD1117DT50CTR) and not primarily of your power supply.

As I’ve just quickly browsed the Shield shield BOM it states 5V min. 800mA (max. 1300mA datasheet extra info). Taken off all the juice the Core needs you might or might not have enough.
But usually if you run the Core low, you should also see some odd behaviour on the Core itself (e.g. unexpected RGB LED color codes).

Like

If it is blue that might be an indicator, since it should actually be cyan (green + blue sub LEDs)

Yeah, sorry, that’s just my own laziness. It breathes cyan. As I mentioned, the code inside the core continues to execute, dumps serial trace messages, everything appears to work except the actual Neopixel ring. I’m going to show the soldering connections to a friend of mine and see if maybe I got a blob somewhere that messed it all up.

It’s probably not your connections but rather a lack of power. Your supply might be able to go up to 3A, but the voltage regulator can’t. You could use a 100A supply if you wanted, but it wouldn’t make a difference, since it has to be converted by the regulator, which can handle a maximum of 1300mA. You need to power it without using the shield shield regulator, since that won’t be able to manage it.
You could try a regular USB adapter, as long as it can provide enough current (2A should suffice). I’ve once cut up an old USB cable and used that to power my Core/peripherals. Not ideal, but it worked.

I also powered the Core directly with USB coming from my computer, with no voltage regulator because there was no shield shield. This also produced the exact same effect - no shiny lights. Is there something about that arrangement that is also power limiting? (because that’s also the wiring shown in several tutorials).

I have a smaller ring coming so I can test another theory. If I did want to externally power the ring and just use the Core for the logic input, what would I use to power the ring?

Have you run the Core off USB and the ring off another 5V power source?
If you tried to run both off USB you’ll have even less current available (typ.500mA).

You could use a 5V wall wart (as @Moors7 said about 2A) to power your ring and only the digital signal comming from the USB powered Core, but then you should tie both GND rails (Core and ring) together.

1 Like

@ScruffR - I had thought about it, but I don’t have access to a known 5VDC source. I’ve got the 9V/3A plug that I can power my shield shield with (because the shield shield can drop voltage to 5). What would you suggest I use to power the ring?

If I need to tie the core and ring grounds together, that really implies that I need something that’s a wall adapter on one end and a pair of loose wires on the other. Again, pardon my inexperience, but, what component would I acquire to make this happen?

It doesn’t have to be specialised equipment, I use iPhone/iPad adapters for example. Any USB adapter will work as long as you’ve got 5V/2A. Lower voltages will also work as is stated in the Adafruit guide, but 5V is common in adapters, so try that.
The 9V/3A is nice, but since you route it through the shield shield regulator, it’s limited to the output of that. You can try looking for a different regulator with a greater output.

You always have to tie the grounds together. You’re doing it with the shield shield as well, but there it’s routed on the PCB. An adapter with loose wires on one end isn’t as scary as it sounds. You’ve also got loose wires on your ring, haven’t you? You could also opt for a breadboard barrel jack, if you prefer that. That way you could plug in adapters without the need for loose wires. Of course you’ll have to get the power from the barreljack to the Core/ring, for which you probably have to use wires as well :wink:

The most important thing you’ve got to do is find a decent power supply, be it converted from 9V, or a USB adapter, or a hamster in a Ferris wheel. It has to be able to supply sufficient current (aim for 2A), as well as a nice 5V. We explain how to best hook it up, should you require help with that.

1 Like

Just for having it said.
If you’ve got a decent power supply (propperly filtered 5V 2A) you can power both (Core and ring) off just this one without the need to power the Core via USB.

So
+5V to Vin on Core and PWR +5V on ring
GND to GND of Core and ring

For serial com you can still plug in USB, but there’s no need for powering the Core.

1 Like

OK. So the goal is to power the Spark Core and the Neopixel ring separately, but have them share the ground since the digital pin is going to the ring.

I have a 9V adapter that I can use to power the core while it’s sitting in the shield shield, so that leaves a means of powering the ring…

Can I plug a 5V/2A adapter into this, and then run wires, including shared ground?

If so, what wires do I run for this thing? This looks different than the little tiny wires I’ve been using for my breadboard stuff.

This is all eventually going on a motor-driven 4-wheel drive done, so I am going to need to figure out a better power management strategy when it comes to powering everything from batteries.

You don’t need to power them separately. Like we mentioned in the above posts, you can run the Core and your Neopixel ring from the same supply, provided it can deliver enough current. Your Core can use around 300mA, and your ring 1440mA, which makes a total of 1740mA. If you have a 5V supply that can deliver 2A, you can power both of them simultaneously.

The signal wire would go from the Core to the Ring, obviously.
<amazing paint skillz>

</amazing paint skillz>

It doesn’t really matter how you get the power to your board. You could use the adapter you linked to, but also the barrel jack I mentioned. Yours is easy since you can change wires easily, the barreljack is easy since it plugs into a breadboard (after which you can also easily change wires). Just make sure your adapter fits into the jack, there are different sizes. Like I said before, you can also use any old cut-up USB cable and a USB power supply for a quick hack.

2 Likes

Thank you so much for the information. I didn’t realize that the Core could take 5V input directly on the breadboard (I thought I had to use the shield shield for that). I am traveling next week, so I will have to wait until April 10th or so to give this a try after finding a 5V/2A power supply to split across the core and the ring.

Thanks again, especially for the wiring diagram.

1 Like

Yes, of course you can power the Core with 5V.
5V is the USB voltage which goes via a diode to Vin pin.
From both these 5V terminals the power goes to the 3V3 voltage regulator from there to the 3V3 pin and via a filter to the 3V3* pin.

2 Likes

Thank you for this. It’s been super frustrating trying to get simple answers. I’ve found some really complicated crap that I figured out, but getting simple stuff like what voltage the core expects, people just assume everybody knows that already and software guys like me simply have no clue what we’re doing :smile:

Just FYI, I’ve powered my Core via USB, and run power from the Core Vin/Gnd pins to a string of WS2812B’s, and I was able to light over 100 pixels. Granted, that was running varying patterns, so they were never all fully on for more than a fraction of a second at any time.

See, it’s stuff like this that makes me think my original assertion, that I messed up the soldering, is right.

That’s why it’s explained in the docs. Check the hardware section, it’s explained over there :wink:

Regardless of whether or not it’s technically possible, you really shouldn’t do it. The effort required to set it up correctly is so small that you really shouldn’t risk damaging anything.

2 Likes

I’ve been reading the docs, but I guess I’ll have to go re-read it. I think I just assumed that since the core has two output power wires label 3.3 and 3.3* that I assumed it could only take 3.3V in directly.

In any case, once I get the little adapter deals that I need, I will be focusing on powering the LEDs and the core separately. As you say, even if it’s technically possible to power the LEDs from the power output of the core, it feels cleaner (and safer) to give the LEDs their own isolated source.