0

I'm relatively new to hardware. I have some basic concepts down and I've only done some basic circuitry, but I really want to jump into the deep end - it's how I learn best. I'm not sure how simple this project is, but I like a good challenge.

Essentially I want to build an RGB LED display, perhaps 32 columns of 18 LED's (a total of 576 bulbs). I'm hoping to control the display by sending data through a program I'll create on my Raspberry Pi (512 MB, model B) - in other words, I want to control each LED and not simply feed it a video stream.

I need to be able to control each individual LED and it's brightness. I'm looking at buying the "RL5-RGB-C-2 Clear TriColor" LED's, where each bulb has three inputs for red, green, and blue respectively.

I have found some basic tutorials on creating single colour LED displays, but none that show me how to create an RGB display of this size using the GPIO (or any other bus, for that matter) on the Raspberry Pi, as well as allowing me to control brightness of each LED.

I'm just wondering where I should start or if anybody could point me in the right direction. I'm also open to suggestions regarding the Arduino.

Chetan Bhargava
  • 4,612
  • 5
  • 27
  • 40
  • A "video stream" is in fact one way to control the color and brightness of each LED, so I don't understand the distinction you're trying to make. – Dave Tweed Dec 09 '12 at 05:59
  • What I meant was that I don't want to supply an movie file and/or use video out. I want to manually light up each LED using a HEX value that I specify, say, in a text file. The only reason being that I don't want to have to render videos to get my display working. – Sam Wilson Dec 09 '12 at 06:31
  • @Sam Wilson To me it seems that you at the moment don't actually understand how "layers" of control work. Once you have everything running fine on the physical layer and can control each LED, that layer isn't interested in what's generating the signal. That's job for software on a higher layer. For example sound card's driver doesn't care if you play music using VLC or Winamp or if you're playing the music from a hard disk or a flash drive. – AndrejaKo Dec 09 '12 at 11:42
  • That is more LEDs than you can PWM with the pi, so you will need outboard PWM drivers which you can update either sequentially or addressably. – Chris Stratton Dec 09 '12 at 22:04
  • @AndrejaKo perhaps I don't. It's the physical layer that I don't know how to build/set up. I'm fine with software and can figure out how to control each LED once I've got the hardware setup, it's just that I don't know where to start with the hardware. – Sam Wilson Dec 10 '12 at 03:34
  • @ChrisStratton outboard? Does that mean essentially connecting multiple systems together? – Sam Wilson Dec 10 '12 at 03:35
  • Probably yes, either chips which can handle a number of LEDs each, or even individual RGB pixels which can daisy chained and be fed with a serial data stream to update them each in turn. The key point being that the command/update rate will be slower than the PWM switching frequency, so there has to be a intensity starage and PWM timer driven by it for each LED, external to the pi. – Chris Stratton Dec 10 '12 at 03:46
  • @ChrisStratton Thanks for pointing that out. I'm not even sure what type of chips I'd have to get. Maybe this project is a little too advanced for a beginner like me. I obviously don't want to buy a dozen Raspberry Pi's to get it working, and I'm sure I wouldn't have to. My original idea is that I'd have to have multiple chips that control perhaps 16 or 32 LED's each, and then perhaps use a multiplexer to split the bit stream up every 16/32 bytes (assuming 1 LED requires one byte of information to light up), if that makes sense. – Sam Wilson Dec 10 '12 at 11:46
  • You don't need a multiplexor with chips actually designed for this because they get an effective address from their position in the logical string. However they drive fewer leds per chip because they are designed for high current leds. You could try using cheap microcontrollors as custom drivers, or even CPLDs but the latter would require more learning. – Chris Stratton Dec 10 '12 at 12:16
  • http://electronics.stackexchange.com/questions/18330/feasibility-of-controlling-a-dimmable-led-matrix?rq=1 seems relevant here. Also, google for "WS2801": you can get prebuilt addressable strips of LEDs with drivers, which would be useful if you wanted a matrix on a ~5cm grid. – pjc50 Dec 10 '12 at 15:05

2 Answers2

1

If you really want to controll each of the LEDs then practically you have to use shift registers, as there are 576*3=1728 pins to be controlled and the pis dont have more than 17 GPIO pins.

Lets assume that we leave out the brightness part (but the approach is same, you would need 1728 more PWM outputs to controll the brightness), then the number of shift registers needed will be 1728/8=216. I would reccomend using the 74hc595 ones as they are cheap and has quit many resources.

So the basic idea is to feed in the state of each colour of each led of all leds as either ON or OFF to all the shift registers (since we are not dealing with brightness now, only three bits for each led is enough) and then latch all registers to display the image.

Nilanjan
  • 73
  • 1
  • 9
1

Did you ever have a look at WS2812 LEDs? Those are RGB LEDs with built-in 8 Bit PWM controlled constant current sources for each color. They contain a 24bit shift register and can be daisy-chained. Due to the constant current source, they can be supplied with 3.5 to 5V, and due to the daisy chained shift registers, only a single output of a micocontroller or the Raspberry pi is needed to clock in the RGB data for all LEDs. Oh, and you can run 1024LEDs at 30fps.

One only has to keep in mind, that the RGB data for all LEDs has to be written with tight timing and without break. Not a problem for a microcontroller, but the pi is a computer with interrupts etc. But I guess there are libraries out there for those LEDs.

sweber
  • 8,580
  • 1
  • 15
  • 35