Go Down

Topic: Software PWM using daisy chained 74HC595s / SPI (Read 25 times) previous topic - next topic


Oct 05, 2010, 12:41 am Last Edit: Oct 05, 2010, 01:26 am by tmartins Reason: 1
Sorry for multiple posts. Here are some usefull links:

How to make a current limiting circuit I mentionded earlier. Tested and works!


Cheapest 3w RGB leds you can find:

Nice stuff about BAM:

Other problems:
How an earth to get a tight beam from a rgb led with good color mixing. Lenses show the colors separate. Maybe a reflector with a bit wider base? Dunno....


@Tomppu - nice updates - thanks for contributing improvements.


Honestly, I think it's easier and nearly as cheap to drive power LEDs with dedicated ICs. There are many out there on the market, like the STP04CM05 I mentioned earlier. I got those for $2.20 a pop from Mouser. There are also single-channel drivers with PWM input that you can run from the TI PWM chips like the TLC5940, which you can combine for hardware PWM control (3000+ levels). I like the STP04CM05 with software PWM because it minimizes the PCB size and BOM.

If you are using the TLC5940, you don't want to drive LEDs directly with it, but instead control a constant-current IC or a transistor (you may find a hex inverter IC useful in that case since 'on' is LOW on the TLC).

I'm actually using the DealExtreme LEDs in our projects. They have good consistency and you can't beat the price. The are very sensitive to overcurrent situations though.

As far as beam concentration, I recommend a reflector over a lens for most uses. As you have found, the collimating lenses essentially project a huge image of the LED pads onto your target surface. Personally, I like the SO27XA reflector but I'm not sure about it's availability outside of the States. A diffusing material can help as well; frosted window film is cheap and works quite nicely.


Oct 05, 2010, 06:21 pm Last Edit: Oct 05, 2010, 07:13 pm by PostOfficeBuddy Reason: 1
Tomppu, the thread you linked to actually contains the explanation and the solution to the flickering problem you encountered. Start at this post to see what I mean. The solution is to output the BAM waveform followed by a mirror image of it.

I don't have time to modify the code right now, but I might later this week. If you can get a working version using MIBAM (mirror image bit-angle modulation) I would be glad to test it!

Edit: There is a dedicated MIBAM thread here. After reading through, on the Atmega328 at 16MHz, I think it is possible to drive 64 channels at 120Hz with 11-bit resolution (2048 levels). At 10-bits you could drive 128 channels, etc. Then again that is based on assembly performance so I'm not sure what the difference would be using the Arduino IDE. But it's encouraging!


I saw the mirror thing and I tried it but it did not seem to solve the problem. And is a bit the same thing done differently. The problem are the "long" bits 6, 7 and anything that splits them to pieces (mirror = each of the bits in two time slices.

Assembly would help but at least for me it makes the code slow to write and difficult to understand so I try to avoid it.

I am building a mood/disco light with 16 RGB=48 channels and the BAM seems to solve that.

Lets keep the thread open and post when ever new links or info comes or somebody gets new code working!

Go Up