TLC5940 with Common Cathode

Hi,

I want to build an 4³ LED cube that is controlled by a TLC5940 (and an Arduino Uno).

I just assembled this circuit to test the IC:

I already soldered the LEDs together and all cathodes of a layer a connected to turn on and off the layer.
So the anodes of the LEDs will be connected to the IC.

In the example the cathodes are connected to the IC and the anodes go to 5V.
My idea was to connect the LEDs vice versa between GND and the TLC5940 and invert the values.
However, as soon as I disconnect an LED (or connect it vice versa) there is no more voltage at the ouput pins.

Is it possible to run my LED cube with the TLC5940?

marian42:
I already soldered the LEDs together and all cathodes of a layer a connected to turn on and off the layer.
So the anodes of the LEDs will be connected to the IC.

In the example the cathodes are connected to the IC and the anodes go to 5V.

The example is correct, the cathodes should go to the TLC5940.

The anodes are connected together in each layer, not the cathodes. Time to start again...

Probably best not to solder things until you're sure it works... and do as the example does :slight_smile: Made the same cock-up myself before, so don't feel too bad!

Im sure that it works!

I followed a tutorial that instructed me to do like this.

I definitely know that it is possible to use this setup but control it with something else than the TLC5940.
The Arduino outputs LOW to the Layers and the LEDs that light up get HIGH from their other pin (connected to the IC).
This would work with a 7HC595 (or two of them) what I intended to do first. But this solution is not able to do PWM (or not fast enough).

The problem I have is that the voltage drops if I disconnect the LED.

The TLC5940 cannot drive common cathode LEDs, it is a current sink driver. The 74HC595 has push-pull outputs so can source or sink.

The only way to get it to drive a common cathode display is to provide an eternal driver from the output of the TLC5940. However this needs to be a non inverting driver and you then need to limit the current in the output because you loose the constant current control of the TLC.

MarkT:
The TLC5940 cannot drive common cathode LEDs, it is a current sink driver. The 74HC595 has push-pull outputs so can source or sink.

so the 595 is push/pull? so it can drive an Anode AND Cathode RGB leds? (How?)

cjdelphi:

MarkT:
The TLC5940 cannot drive common cathode LEDs, it is a current sink driver. The 74HC595 has push-pull outputs so can source or sink.

so the 595 is push/pull? so it can drive an Anode AND Cathode RGB leds? (How?)

It's not constant current so using it to drive LEDs is a bad idea.

It's not constant current so using it to drive LEDs is a bad idea.

What is constant current and why cant I use it to drive LEDs?
Since the TLC seems not to work with my LED cube, thats what I would do instead.
I made lots of prototypes with the 7HC595 with LEDs, which worked quite well (I even manged to do "fake PWM" through it).

Another idea is to put the LED cube LEDs directly to the Arduino, since it has 20 pins and the LED cube needs 16+4 pins. But this seems to me to be the least beautiful solution and it keeps me from using inputs such as a button or a remote control.

cjdelphi:

MarkT:
The TLC5940 cannot drive common cathode LEDs, it is a current sink driver. The 74HC595 has push-pull outputs so can source or sink.

so the 595 is push/pull? so it can drive an Anode AND Cathode RGB leds? (How?)

To drive common anode LEDs connect the anode to the +ve an the cathodes to the chip's output. To drive common cathode LEDs connect the cathode to the ground and the anode to the chips output. In each case you need a seriese resistor.

You can use constant current to drive LEDs without a resistor, without constant current you need a resistor. A constant current driver is one that automatically adjusts the voltage coming out of it until a set current is reached.
You only have 40 mA max output from an arduino so don't connect it directly.

Will lighting 16 LEDs at a time with a 7HC595 damage the Arduino?
Because if it is limited to 40mA it could probably only take two LEDs (with 20mA each)?

marian42:
Will lighting 16 LEDs at a time with a 7HC595 damage the Arduino?
Because if it is limited to 40mA it could probably only take two LEDs (with 20mA each)?

The LEDs are not being powered from the arduino they are being powered from the 595.

I dont understand what the problem is. Will it damage the 595? Will it damage anything? Or should I just try it? Because the 595s are almost for free (0,25€)

How are you proposing to drive 16 LEDs from 8 outputs, series or parallel?

I would use two 595s. They use one clock and one latch pin and two data pins and they will receive data simultaneously.

That is very unusual but I suppose it will work, I can't see any reason why not.

marian42:
I would use two 595s. They use one clock and one latch pin and two data pins and they will receive data simultaneously.

Thats exactly how I did it.
http://arduino.cc/forum/index.php/topic,123495.0.html

My first 4x4x4 cube was 4 220 ohm resisters, 64 LEDs (white LEDs from 4.5v flashlights) It has 4 planes (resistered connected to the anodes)of 16 LEDs. I later changed it to using 2 74HC595 (16 bit) to control the cathodes.