Using Propeller to display video on ws2812's
ratronic
Posts: 1,451
While working with colored object tracking using my Activitybot I was distracted by seeing if the Propeller could display video
from the Pi camera to an 8 x 8 matrix of 64 ws2812 led's from Adafruit. I first tried Spin (my preferred language for the Propeller)
but sadly it couldn't keep up with what the Pi was spitting out. So I ended up using David Betz ws2812 library in C to keep up with
the Pi. The C++ program on the Pi captures an 80 x 80 pixel color video frame then proceeds to isolate an 8 x 8 pix of the pixels
in the middle of the video then send a long of color data for each pixel (256 byte packet). So the display looks like a magnified
display of whatever is in the middle of the video. I had to scale back the output of the camera by 10 because the led's are so bright.
https://www.youtube.com/watch?v=NJw2vto3AtM&index=1&list=UUtHTG82Nn83T5JSdWdTgkAg
Edit: 2/3/15 Proper C++ source file for the Pi and cleaned up C code for the activity board in zip file "Activitybotdisplay.zip"
from the Pi camera to an 8 x 8 matrix of 64 ws2812 led's from Adafruit. I first tried Spin (my preferred language for the Propeller)
but sadly it couldn't keep up with what the Pi was spitting out. So I ended up using David Betz ws2812 library in C to keep up with
the Pi. The C++ program on the Pi captures an 80 x 80 pixel color video frame then proceeds to isolate an 8 x 8 pix of the pixels
in the middle of the video then send a long of color data for each pixel (256 byte packet). So the display looks like a magnified
display of whatever is in the middle of the video. I had to scale back the output of the camera by 10 because the led's are so bright.
https://www.youtube.com/watch?v=NJw2vto3AtM&index=1&list=UUtHTG82Nn83T5JSdWdTgkAg
Edit: 2/3/15 Proper C++ source file for the Pi and cleaned up C code for the activity board in zip file "Activitybotdisplay.zip"
#include <simpletools.h> #include <fdserial.h> #include <servo.h> #include "ws2812.h" void getPix(void); #define CENTER 1500 #define LED_PIN 0 #define LED_COUNT 64 #define PAN 8 #define TILT 9 #define PSRV 16 #define SCALE 10 uint32_t ledColors[LED_COUNT]; ws2812_t driver; fdserial *ser; int n; int main() { set_directions(27, 26, 0b11); ser = fdserial_open(6, 7, 0, 115200); if (ws2812b_init(&driver) < 0) { return 1; } ws2812_refresh(&driver, LED_PIN, ledColors, LED_COUNT); servo_set(PAN, CENTER); servo_set(TILT, CENTER); servo_set(PSRV, CENTER); for (;;) { toggle(26); n = 0; while(n < 64) { ledColors[n++] = 0; } getPix(); ws2812_refresh(&driver, LED_PIN, ledColors, LED_COUNT); pause(10); } return 0; } void getPix(void) { n = 0; while(1) { if(fdserial_rxCheck(ser) == 33) { if(fdserial_rxTime(ser, 1) == 38) { toggle(27); while(n < 64) { ledColors[n] |= fdserial_rxChar(ser) / SCALE; ledColors[n] |= fdserial_rxChar(ser) / SCALE << 8 ; ledColors[n++] |= fdserial_rxChar(ser) / SCALE << 16; } break; } } } }
Comments
This sounds really cool. I really want to see this.
I've displayed monochrome video on a 12x10 LED array once but color sounds really interesting.
Edit: Ok finally got it fixed https://www.youtube.com/watch?v=NJw2vto3AtM&list=UUtHTG82Nn83T5JSdWdTgkAg
Can someone let me know if the video is viewable?
I love it. Very cool.
Edit: And of course I use Parallax boxes for the heavy stuff.
Reminds me of TV when I was a kid, but with colour !
and cleaned up the C code for the Activity board.
How it works?
PC software: http://www.live-leds.de/
Propeller:
DMX-in library (by JonnyMac)
WS2812 library (by JonnyMac)
Some small SPIN code.
LED panel: http://rgb-123.com/product/143/
Leds Need ~ 6.5 Ampheres @ 5 VDC. I am using ATX PSU for LEDs.
PC software reads, play and transform (with FFMPEG???)video file to DMX
DMX is send to PropPulu (FT232RL)
Propeller receive DMX data.
Propeller convert DMX buffer content to WS2812 format.
Propeller show data on 16x8 WS2812B LED panel.
It all could be coded much better, but... It's just proof of concept. So, technically it is possible for raspberry PI, but you need some coding.
dmx_ws2812b.zip
BTW: One WS2812B LED need 50 mA current. Size ~ 5x5 mm.
If you want to build FullHD LED screen, you need:
1920x1080 pixels. It is 2*073*600 LEDs.
2*073*600 leds will cost 1*036*800 USD + shipments, if 1 LED cost 0.5 USD.
If pixel (LED) size is 5x5 mm. Minimal screen size is 9.6 meters x 5.4 meters.
If one LED need 50 mA current then screen need 103*680 Amperes current @ 5 VDC. ~ 518*400 W ( 518 kW) power.
What is weight for this constructin with frames?
If one propeller can handle 1920 LEDs, you need at least 1080 propellers to control all leds.
Any kickstarter project to build this?