Close

APA102

A project log for IoT POV Fidget Spinner

A WiFi fidget spinner, taken from concept to ordering parts in one weekend

matthiasMatthias 06/09/2017 at 16:311 Comment

As I was just asked about the ability to hit a sufficient refresh rate with the LEDs, here are my thoughts on the matter: With WS2812 and similar ones, it would be impossible, but apparently not with the APA102. From the information I gathered, the APA102 can be controlled with a clock of at least 8MHz. With 32 LEDs, I get at least 8(Mb/s)/(32b/w)/(32+2w/l)=7353l/s. That's well below the 19.2 kHz PWM frequency, so no worries there.

At 3000rpm (which should be close to the maximum you can reach by hand), you have 50 revolutions per second. That leaves you with at least 7353/50 = 147 lines per revolution. In other words, you get a angular resolution of about 2.5°. And that's assuming you cannot fit in more updates. For the outermost LED, we get a resolution of about 2mm. Measuring from the center, the LEDs are about 2.5mm apart.

Looking at https://github.com/FastLED/FastLED/issues/107, they are driving the LEDs at up to 24 MHz. So at least in theory, it should be possible to have a higher resolution, even though that only makes sense if you get to higher rotational speeds. 24MHz would give you the same resolution at 9000rpm. And 2.5mm on the outermost LED should be enough, so you could - at least theoretically - get up to 11250rpm.

There is one big caveat: I never used the APA102. For my last project involving addressable LEDs, I used the SK6812 mini LEDs. Before that were the WS6812. In a way, I am moving to smaller and smaller LEDs. But in this case, they are not only smaller, but also easier to control (I can just set the I2S of the ESP8285 to output 32 bit frames from RAM via DMA which are perfectly sized for the APA102). Compared to the way [cnlohr] developed for the WS2812, I only need 1/4 of the RAM. So assuming everything works as advertised - when does it every, though... - I should be able to have a "high" resolution at up to almost 12000rpm. That would be more than sufficient. My goal for this project is to get a "high" resolution up to at least 3000rpm.

One more thought I had was, that I could store a higher resolution image in RAM and then skip lines depending on the speed.

Btw: converting data from cartesian to polar will be done on the client in javascript. My requirement for this project is to get at least a single color on/off POV. RGB will be the next step (probably even after low power consumption).

Discussions

zakqwy wrote 06/09/2017 at 19:58 point

awesome. i figured you had done the calcs, and my assumptions were based on the tamer ws2812. seems like the apa102 is a great fit. if angular resolution is smaller than the LED size, all is well!

  Are you sure? yes | no