Share My Creation JG LEDStrip APA102

Hi,

Here is a small App that I wrote to control APA102 LedStrip.
APA102 are RGB leds that can be individually controlled via a SPI bus.
They are linked in a daisy chain so that a single SPI Master bus can address the whole strip.

A PIC24FJGB106 board takes care of sending the SPI data over the bus.
The Android App is simply reading a picture, converting it into RGB data and send them to the MCU over bluetooth or Wifi
The link between the Bluetooth or Wifi modules and the MCU is UART.

Apk is not yet published on the GooglePlay and too big to be uploaded...
BTW it needs my MCU board to work...

You can :
  • connect over wifi or bluetooth
  • choose the image
  • change the speed
  • change the brightness


Here is the result :

As you can see it works quite well, but the speed is not as fast I would have expected...
This is due to the UART protocol which is quite slow (115200 bauds max)
I can achieve much faster throughput via the SPI bus but the limitation is really the UART.

An idea would be to get a Wifi to SPI board and send raw data directly to the LedStrip without MCU board.

I have in mind the very cheap ESP8266 board with custom firmware. But I don't know yet how to change firmware !

Any other idea would be appreciated

[Edit october 2015] Here is a new version running with an ESP8266 (cheap) board.
This board is loaded with ESP8266 Arduino firmware. With it I could easily access to the hardware SPI bus.
The result is a much faster system.
Connecton is fully automatic, no parameter to enter. Simply UDP broadcast and then UDP connection between Android and ESP8266.

 

Attachments

  • LedStrip APA102.jpg
    LedStrip APA102.jpg
    32.5 KB · Views: 11,826
  • LedStrip.jpg
    LedStrip.jpg
    19.1 KB · Views: 513
Last edited:

JordiCP

Expert
Licensed User
Longtime User
Very nice !

Please tell us how to increase the SPI clock speed to 40 MHz.

Thanks!:)

When the SPI is initialized it sets 1MHz as default (find class initialization in SPI library code attached), but it seems (didn't test) that it can be changed. And according to some forums I have read, the max speed is the ESP8266 core speed / 2


B4X:
void setup() {
  // Initialise Serial connection
  Serial.begin(115200);

  SPI.begin();
  SPI.setFrequency(10000000);    // In this case, freq = 10MHz
  
  //....
}
 

Attachments

  • SPI_Arduino_ESP8266.zip
    4.5 KB · Views: 443

freedom2000

Well-Known Member
Licensed User
Longtime User
Thanks!:)

When the SPI is initialized it sets 1MHz as default (find class initialization in SPI library code attached), but it seems (didn't test) that it can be changed. And according to some forums I have read, the max speed is the ESP8266 core speed / 2


B4X:
void setup() {
  // Initialise Serial connection
  Serial.begin(115200);

  SPI.begin();
  SPI.setFrequency(10000000);    // In this case, freq = 10MHz
 
  //....
}

Great !

Yes I already tested this function and it works. But I tought that it was limited to 1MHz :)

Thank you
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
I guess these leds are not addressable, but if you break them into chunks they might be.

I need a ~ 50 character LED matrix display.
 

JordiCP

Expert
Licensed User
Longtime User
I guess these leds are not addressable, but if you break them into chunks they might be.

I need a ~ 50 character LED matrix display.
Well, in fact they are individually addressable through SPI
In my case I broke the strip into chunks to make a square panel, but connected the chunks between them (notice there are "home-made" cables at panel's left and right, connecting each row with the one below it)

For 50 chars, depending on the panel dimensions you want and the font size (in leds) you can calculate the aprox.cost doing it with led strips
 

freedom2000

Well-Known Member
Licensed User
Longtime User
Well the controller is shared into two parts :
- android App
- led driver (my ESP board)

if you want to control new kind of leds then the Android App will not change but the led driver must change.

I haven't found in the link that you have provided any information regarding the way to drive this led...
So my first answer is that it should be doable but I don't yet know how :cool:
 
Last edited:

dankoi

New Member
Hi,

Here is a small App that I wrote to control APA102 LedStrip.
APA102 are RGB leds that can be individually controlled via a SPI bus.
They are linked in a daisy chain so that a single SPI Master bus can address the whole strip.

A PIC24FJGB106 board takes care of sending the SPI data over the bus.
The Android App is simply reading a picture, converting it into RGB data and send them to the MCU over bluetooth or Wifi
The link between the Bluetooth or Wifi modules and the MCU is UART.

Apk is not yet published on the GooglePlay and too big to be uploaded...
BTW it needs my MCU board to work...

You can :
  • connect over wifi or bluetooth
  • choose the image
  • change the speed
  • change the brightness


Here is the result :

As you can see it works quite well, but the speed is not as fast I would have expected...
This is due to the UART protocol which is quite slow (115200 bauds max)
I can achieve much faster throughput via the SPI bus but the limitation is really the UART.

An idea would be to get a Wifi to SPI board and send raw data directly to the LedStrip without MCU board.

I have in mind the very cheap ESP8266 board with custom firmware. But I don't know yet how to change firmware !

Any other idea would be appreciated

[Edit october 2015] Here is a new version running with an ESP8266 (cheap) board.
This board is loaded with ESP8266 Arduino firmware. With it I could easily access to the hardware SPI bus.
The result is a much faster system.
Connecton is fully automatic, no parameter to enter. Simply UDP broadcast and then UDP connection between Android and ESP8266.


Hello!

Your project is awesome! It is exactly what I am looking for!
Would you please share the ESP8266 code and the Android app with me?

Thank you!
 
Top