How many LEDs can CPX support?

My student wants to use 4 sets of 8 sewable LEDs to be run by the CPX using MakeCode. That's 32 external LEDs. Is that possible? Thanks!

mikhosert

Posts: 4
Joined: Tue May 25, 2021 12:21 am

Re: How many LEDs can CPX support?

No problem, You mean a solution like this:

Even simple boards like a 32U4 powered board can already run hundreds of them.

blnkjns

Posts: 663
Joined: Fri Oct 02, 2020 3:33 am

Re: How many LEDs can CPX support?

Thanks!
Kinda like that but with single-color sewable LEDs. He wants to make a torch with a square top that has 8 LEDs on each side face and with the CPX on the top face. That would be 4 different circuits that could be connected to 4 different pins, but each with 8 LEDs for a total of 32 single-color LEDs.
IMG_0827 2.jpg (42.04 KiB) Viewed 323 times

mikhosert

Posts: 4
Joined: Tue May 25, 2021 12:21 am

Re: How many LEDs can CPX support?

8 LEDs wired in parallel like that would overload the CPX pins. You would need to add a transistor on each of the 4 channels to handle the current.

Posts: 81533
Joined: Sat Feb 07, 2009 10:11 am

Re: How many LEDs can CPX support?

Super! That's the kind of info I'm looking for. How many LEDs in parallel can one pin handle? How about total for all pins?

mikhosert

Posts: 4
Joined: Tue May 25, 2021 12:21 am

Re: How many LEDs can CPX support?

I'm assuming that the sewable LEDs you are referring to are the sewable LED sequins: https://www.adafruit.com/product/3377
These have built-in current limiting resistors. When powered from 3.3V each sequin draws about 5mA. If you wire them in parallel, the current draw multiplies.

The older Circuit Playground "Classic" use an Atmega32u\$ processor which could source 20mA per pin, so you could safely drive 4 sequins per pin.
The M0 processor in the Circuit Playground Express can source at most 7mA per pin. So with just 2 LEDs per pin you would be stretching the limits.

A small transistor like the PN2222 can handle several hundred mA, so you could easily drive 8 or more of the LED sequins in parallel per pin.

The Neopixels have their own internal drivers, so you can control hundreds of them from a single pin.

Posts: 81533
Joined: Sat Feb 07, 2009 10:11 am

Re: How many LEDs can CPX support?

Thanks!

I'm using these Lilypad LEDs: https://www.sparkfun.com/products/14012 but I think they may be similar to the one previously posted. I have blue, red, yellow, white, and green. How can I find out how much these pull and if it has an internal transistor?

Based on your info, I went to the Adafruit guide for the CPX and it says (pg 23) each pin can provide ~20mA. Can you confirm which is correct?

mikhosert

Posts: 4
Joined: Tue May 25, 2021 12:21 am

Re: How many LEDs can CPX support?

The Lilypad LEDs are similar in design to our Sequins and would draw similar current. They do not have an internal transistor.

The 20mA number is accurate for the Circuit Playground Classic, which was based on a different processor. I suspect that the text was just copied from the old guide.

The Circuit Playground Express GPIO pins can source at most 7mA.