TLC5947 adafruit convert output to current source

Hello,

At first I'm new to this forum so I hope this is the right place to ask this question.

I'm working on a project to control 21 rows of 4 1w leds for my aquarium.
I had this working via SoftPWM. This library can create 20 PWM extra PWM channels at any digital port.
After having this setup running for a while I noticed the light jittered a lot, especially when I'm sending data to my other arduino via i2c. At this point I decided to change things up and bought myself a TLC5947 from adafruit at this point not knowing that this module is build for current sink. The 1w led drivers I bought have a pwm terminal if that input is HIGH the output is LOW so with a constant current this doesn't do anything.

So I was trying to find a solution for this situation and thought of placing a 10k resistor between v+ for each output (~5v) and the PWM signal. This way I supposed when the PWM signal is 100% HIGH and no current is flowing to the driver (LEDS on) and when the PWM signal is 0% the current flows to the driver (LEDS off)

Now my question will this work? if not what could be a solution with the least amount of parts (limited space)

Thanks,
Stefan

Now my question will this work?

Yes. :slight_smile:

stefanfr:
The 1w led drivers I bought have a pwm terminal if that input is HIGH the output is LOW so with a constant current this doesn't do anything.

So I was trying to find a solution for this situation and thought of placing a 10k resistor between v+ for each output (~5v) and the PWM signal.

Now my question will this work?

Depends on the LED drivers.
Some work with a 0-10volt PWM signal, others with a 0-3.3 or 0-5volt PWM signal.
Some already have a pull up resistor to an internal 5volt or 10volt.
Post a link to the driver.

Another option is a 16-channel 12-bit PCA9685 board (Adafruit or ebay).

Picture of a homegrown board with PCA9685 and 16* 1-3watt CC LED drivers.
Max 7 LEDs per string.
Leo..

I forgot to add a picture of the LED Driver:

I tried the 10k resistor solution without any succes, the V+ is always going straight to the led.

The problem with option 2 is that I need 21 Channels so I have to buy 2 of those boards. With the limited space I have to work with this is not a option.

Today I found this image:

Would this be a solution that can work out for my situation?

Would this be a solution that can work out for my situation?

No.

I tried the 10k resistor solution without any succes, the V+ is always going straight to the led.

How did you wire this up, did you connect the grounds? Diagram please.

That diagram (linear regulation) is not an option for 3watt LEDs.
You would need a massive heatsink for the 21 power transistors, a whole bank of 10watt resistors, and a bigger supply to compensate for the extra losses.

Q: When you connect a 9volt or 12volt supply and a 3watt LED to that LED driver board.
Is the LED fully on, and does it have 5volt on the PWM terminal? (educated guess)

If so, then you can use that 24-channel TLC5947 board without any extra parts.

Just connect the outputs and ground of that TLC5947 board to the PWM inputs of the LED drivers.
Don't connect V+ to anything.

Q: How are you going to supply this board and the Arduino.
The regulator on that TLC5947 board could power both from a 12volt? supply for the LEDs.
Post a hand drawn diagram of the whole setup.
Leo..

I think that I didn't explain it that great so I made this 2 schematics to make it hopefully more clear.


This is the one I mentioned in the first post with connecting the PWM to OUTx with pullup resistor to 5v


This is the one I mentioned last with the PNP

The LED driver works as followed. If the PWM pin is LOW the LEDs are ON, if the PWM is HIGH(~5v) the leds are off

In both those circuits you do not show the Gnd on the LED driver connected to the Arduino Gnd.

All the blue labels are arduino in/outputs center bottom is the arduino ground connected to the driver ground and the power supply ground

This is like pulling teeth. Please cooperate.

Where is this connected?

Ahh sorry, that one isn't connected.
This wasn't needed when I used it straight with the arduino so i didn't connect it

This wasn't needed

Yes it is. Connect it to the Arduino ground. Do not connect the -Ve input to the Arduino ground.

That module needs a positive voltage to turn off according to this youtube video.

So the first diagram with just the 10k pull up resistor should work.
Leo..

Thank you all for helping me out with this situation. At the and I had connected the 10k resistor wrong. It's ether that or 10k was a little to much. Now I have wired everything up with 21 2K resistors and it works great. But there is only one small problem when I plug a cable in my arduino (in the motion of plugging it in) all the leds randomly flash and stay in at points they shouldn't. Does anyone no why this is?

stefanfr:
But there is only one small problem when I plug a cable in my arduino (in the motion of plugging it in) all the leds randomly flash and stay in at points they shouldn't. Does anyone no why this is?

Be specific. What cable, and where.
Leo..

Usb cable to update the program. Looks like a reaction on static energy

Looks like a reaction on static energy

Sorry that is rubbish.

There is no defined start up state for the LEDs.
When you power up a system there is a delay before the program starts to work while the Arduino sees to see if it needs to be programed. The the setup function starts. The first thing you must do is to set all the LEDs to off.

Okay let me explain it better.

I've my arduino connected to a power supply and everything works fine.
But as I connect te usb to my laptop the light flicker random until the usb is al the way in. Then the lights stop at any random state and stay that until I reset the arduino

Ok as you put the plug in the auto power switch over circuit switches the power between the USB and the Vin power source. This is due to the contacts making intermediate contact as the plug is inserted. This generates very short drop outs on the power supply which in turn generates spurious signals on the output pins. This puts noise out on the data line of the LEDs which results in flashing.
To stop this don't power the Arduino from two sources at the same time.

How do you power the Arduino.
Leo..