TLC5940 LEDs turn off after few seconds or doesnt even turn on also flickers sometimes

Hey,

I’m trying to get a TLC5940 working with an Arduino but I’m running into some weird issues and I’m not sure what I’m missing.

What I have connected

Power:

  • 9V battery → Arduino VIN
  • Battery GND → Arduino GND
  • Arduino 5V → TLC5940 VCC
  • Arduino GND → TLC5940 GND

Pins:

  • Pin 11 → SIN
  • Pin 13 → SCLK
  • Pin 10 → XLAT
  • Pin 9 → BLANK
  • Pin 3 → GSCLK

IREF:

  • IREF → 10kΩ → GND

LEDs (just testing with 2):

  • 5V → 180Ω → LED → OUT0
  • 5V → 180Ω → LED → OUT1

(long leg to 5V, short leg to the TLC outputs)

Capacitor:

  • One 100µF electrolytic between 5V (+) and GND (–)

I don’t have a 0.1µF ceramic capacitor right now.


Code

Just using the basic TLC library and setting everything to max:

#include "Tlc5940.h"

void setup() {
  Tlc.init();
}

void loop() {
  for (int i = 0; i < 16; i++) {
    Tlc.set(i, 4095);
  }
  Tlc.update();
  delay(10);
}

The problem

  • Sometimes the LEDs turn on, sometimes they don’t
  • When they do turn on, they go off again after about 4 seconds
  • It’s really inconsistent, like it randomly works

What I’m unsure about

  • I don’t have the small 0.1µF cap near the chip — could that cause this?
  • I’m powering it from a 9V battery — is that too weak?
  • Is 10kΩ on IREF okay or too high?
  • Does my LED wiring look correct for this chip?

Any ideas what I should check or fix?

If it a PP3 then yes.

If it's not brand new

  • Is 10kΩ on IREF okay or too high?

To high, try 2K 3.3K

  • Does my LED wiring look correct for this chip?

NO. You do not need the 180 ohm resistors

I think you have BLANK and XLAT swaped.
Why not try the BasicUse.ino exampe sketch

ill try to remove the 1800 ohm resistors im not sure if i have a 2k ohm resistor i do have 1k ohm which i can connect in series. Also im not sure if its okay or not but is it okay to use the 100µF. I want at least 21 green leds connected to 4 of these tlc5940.

I actually changed it to 3.3K but for testing anything between 2K and 5K will be OK. The larger the resistor the dimmer the LED.

You should have one 0.1uF capacitor for each TLC5940.

For 21 LEDs you will need a separate 5V power supply for the LEDs , do not use the Arduino 5V output.

So the 100uF will not work right?

Is the 0,1uF required for it to work because it looks like the led turns on but dimmed and like turns a bit off etc like it looks like it isnt getting sufficient power + it sometimes turns on and does nothing

I think you completely missed the replys to this statement.
If it is a 9V smoke detector battery, there is your problem.

It is not capable of providing the current required to drive your project.

Do you have a DMM? Digital MultiMeter?

What model Arduino are you using?

Tom.... :smiley: :+1: :coffee: :australia:

    Basic Pin setup:
    ------------                                  ---u----
    ARDUINO   13|-> SCLK (pin 25)           OUT1 |1     28| OUT channel 0
              12|                           OUT2 |2     27|-> GND (VPRG)
              11|-> SIN (pin 26)            OUT3 |3     26|-> SIN (pin 11)
              10|-> BLANK (pin 23)          OUT4 |4     25|-> SCLK (pin 13)
               9|-> XLAT (pin 24)             .  |5     24|-> XLAT (pin 9)
               8|                             .  |6     23|-> BLANK (pin 10)
               7|                             .  |7     22|-> GND
               6|                             .  |8     21|-> VCC (+5V)
               5|                             .  |9     20|-> 2K Resistor -> GND
               4|                             .  |10    19|-> +5V (DCPRG)
               3|-> GSCLK (pin 18)            .  |11    18|-> GSCLK (pin 3)
               2|                             .  |12    17|-> SOUT
               1|                             .  |13    16|-> XERR
               0|                           OUT14|14    15| OUT channel 15
    ------------                                  --------

Look at the difference between your wiring for BLANK and XLAT and the wiring in the code example.

i have a 9v energizer battery where i use a buck down converter to make it into a 5v also i do have a multimeter yes

i did try to the the wiring from the example but i can try again to see if i did anything wrong

Do you see the difference between your wiring and the correct way from the example? You have reversed BLANK and XLAT.

also its a arduino mega im using

i copied the setup completly and it still doesnt turn on or nothing in the picture you can see my setup. The 9v battery should be fine for powering 1 led no?


am i missing something?

I can't tell anything from that picture.

Does D10 go to pin 23?
Does D9 go to pin 24?

im sorry for the bad picture yes the D10 goes to the pin 23 (BLANK) and the D9 to pin 24 (XLAT)

I can't tell if it wired correctly from your pictures.

Sorry, I give up.

i can try to wire it better up tomorrow and send a better picture

That's a good idea.

Wiring in a picture:

A basic sketch, with wiring instructions.