Arduino Forum

Using Arduino => General Electronics => Topic started by: MrGlasspoole on Dec 22, 2015, 01:10 am

Title: PWM cable lenght
Post by: MrGlasspoole on Dec 22, 2015, 01:10 am
I'm using PT4115 drivers for the LEDs in my shower wall and dim them with PWM:
http://www.micro-bridge.com/data/CRpowtech/PT4115E.pdf

The thing is the location for the Arduino for accessing him easy.
From the driver to the LED i guess its best to make the distance as short as possible
because the driver goes up to 1MHz (datasheet).

Is it a problem to make the PWM cable from the Arduino to the drivers ~3 meters (10ft) long?
The PWM pin will be split into 3...

Then i have 18 3.2V/20mA LEDs i also need to PWM.
4 connected directly to the Arduino and 14 connected to a PCA9685.
Here i need 4-5 meters (13-16ft) and CAT cable would be best - problem?

Title: Re: PWM cable lenght
Post by: DVDdoug on Dec 22, 2015, 01:29 am
I'm going to guess that you'll be fine..   The 1MHz switching frequency is filtered through an inductor anyway, and the PWM from the Arduino isn't running anywhere near that fast.
Title: Re: PWM cable lenght
Post by: cmiyc on Dec 22, 2015, 02:26 am
because the driver goes up to 1MHz (datasheet).
The key here is "up to."

That's the speed the chip supports. The actual frequency is whatever you drive it with. If you're using then Arduino's default PWM, its in the range of 400-600Hz.
Title: Re: PWM cable lenght
Post by: MorganS on Dec 22, 2015, 03:04 am
Put a freewheel diode close to the driver chip. (Not close to the LED load.) This will help avoid the problems of inductive voltage spikes in the long cables.

Diode D in the aplication circuit shown on the first page of the datasheet.
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 22, 2015, 05:06 am
The actual frequency is whatever you drive it with.
Thats something i could not figure out from the datasheet.
That means if i use 200Hz PWM on the DIM pin the output is the same?

But the sheet says you can use up to 20KHz and output max is 1MHz...

Put a freewheel diode close to the driver chip.
The diode is there. This are kit's for self soldering:
http://led-stuebchen.de/index.php?page=product&info=7

So you guys think it is save to use 3 meters (10ft) from driver to LED without killing my neighbours radio or my phone?

What about the other thing: 4-5 meters (13-16ft) from Arduino (PWM) through CAT to the 20mA LEDs?
Title: Re: PWM cable lenght
Post by: cmiyc on Dec 22, 2015, 05:22 am
Thats something i could not figure out from the datasheet.
That means if i use 200Hz PWM on the DIM pin the output is the same?

But the sheet says you can use up to 20KHz and output max is 1MHz...
Oh, I misread it.

So the buck converter is running at 1MHz. However, the LEDs are still switched ON and OFF by the DIM pin, which has a max PWM frequency of 50KHz. So you're still going to see mostly the PWM frequency across your wires.
Title: Re: PWM cable lenght
Post by: Wawa on Dec 22, 2015, 05:54 am
I have made custom boards with a PCA9685 and 16x PT4115E LED drivers.
The boards run on 24volt and can drive upto 16 downlights each. Most LED downlights are 12watts@~19volt.
There is ~7.5meters of Cat-6 between the Arduino and two of these boards (I2C protocol and supply).
And the "PT4115E to LED" wiring varies between 3 and 10meters.
I hear nothing on FM radio, and very little on AM radio.
Leo..
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 22, 2015, 08:20 am
7.5 meters I2C - do you use the P82B96?

And little is not nothing :)
Title: Re: PWM cable lenght
Post by: Wawa on Dec 22, 2015, 08:43 am
Yes, ~7.5meters of Cat-6.
Just a Mega connected to two PCA9685 chips. Nothing else.
One wire pair for clock and ground, another pair for data and +5volt.
System runs 24/7 without any problems.


Little as in a few birdies on AM radio when dimming, but nothing when the lights are on full, because the LED drivers output almost pure DC without PWM.
I have used a 100n ceramic cap across the LED outputs on the board to try to limit radiation.
Leo..
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 22, 2015, 11:45 am
Ok i did forget to ask about at how much Kbaud?
Title: Re: PWM cable lenght
Post by: Wawa on Dec 22, 2015, 12:13 pm
Standard 100k.
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 22, 2015, 12:23 pm
Thats cool.

Since you know the PCA9685 maybe you can answer this:
http://forum.arduino.cc/index.php?topic=367229.0
Title: Re: PWM cable lenght
Post by: Wawa on Dec 22, 2015, 12:44 pm
The source/sink part?

Sourcing is when the PCA powers the LED (LED connected to ground).
Sinking is when the PCA switches a powered LED to ground (LED connected to supply).

Arduino's 10-bit PWM sucks at dimming home lighting LEDs to a low level (course steps).
But the 12-bit PCA9685 has smooth dimming to very low light levels.
I use a library with 255 lineair brightness steps (12-bit CIE conversion) .
https://github.com/brunnels/PCA9685
I think Adafruit also has a library.
Leo..
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 23, 2015, 03:07 am
Ok after clarifying that long cables from drivers to LEDs and also I2C can work out of spec...
What about PWM from the Arduino directly to 20mA LEDs or the drivers?

If this also works I'm free with the Arduino placement and can layout everything in a way that i can save money on cables.
Title: Re: PWM cable lenght
Post by: Wawa on Dec 23, 2015, 11:23 am
Ok after clarifying that long cables from drivers to LEDs and also I2C can work out of spec...
What do you mean with out of spec.

From the datasheet:
The PCA9685 is in the new Fast-mode Plus (Fm+) family. Fm+ devices offer higher
frequency (up to 1 MHz) and more densely populated bus operation (up to 4000 pF).

Cat-6 is 53pf/meter.
Leo..

Title: Re: PWM cable lenght
Post by: raschemmel on Dec 24, 2015, 12:42 am
I use these. (http://As there is a 2:1 voltage divider, the MOSFET will be switched off when Vin > 6.6V.)

You can send a 5V signal 4000 FEET (http://cds.linear.com/docs/en/product-selector-card/2PB_RS485fd.pdf) (3/4 MILE)
Title: Re: PWM cable lenght
Post by: Wawa on Dec 24, 2015, 01:44 am
I think it's best if OP draws up a diagram, so it can be checked.
Cat-6 (or Cat-5), cable resistance and capacitance have to be taken in account.
e.g when a PWM pin will be driving LED, it's wise to have the current limiting resistor on the Arduino side.
So the Arduino pin does not drive the cable capacitance.

If it was me I would use two PCA9685 boards where the lights are, and have 32channels available there.
Could also be less wiring.
Leo..
Title: Re: PWM cable lenght
Post by: raschemmel on Dec 24, 2015, 02:46 am
Quote
driver goes up to 1MHz (datasheet).
 
I don't see how this is relevant when driving leds. Standard video minimum is 26 frames per second.
Recent technology has gone from 60hz to 240 hz, None of these require 1 Mhz for pwm. The human eye can only distinquish so much. What good does 1 Mhz do you ? Do you have a 1000 leds you need to pwm ?
Title: Re: PWM cable lenght
Post by: Wawa on Dec 24, 2015, 02:57 am
1Mhz is the max I2C data transfer rate.
That short data burst sets the 16 PWM registers.

PCA9685 has a default PWM frequency of 200hz. Perfect for 12-bit PWM.

Default I2C data rate is 100khz.
At that rate, and with the right value pullup resistors, Fm+ bus (wire) capacitance can be 4000pF.
AFAIK the original I2C standard was 3mA/400pF.
Leo..
Title: Re: PWM cable lenght
Post by: raschemmel on Dec 24, 2015, 03:10 am
I'm not seeing how I2C got in the discussion. I looked at the datasheet and see the "DIM" input but didn't see any reference to I2C nor any SDA & SCL pins on the driver. So why are you talking about I2C ?
What did I miss ?

FYI,
I know the PCA9685 is I2C but how does that help ? It doesn't OUTPUT PWM. It PWMs the LED loads (16 of them). So if the  reference to 1 Mhz is in reference to the PCA9685, and the OP is not driving 1000 leds with 63 PCA9685s, how would the 1 Mhz capability be in any way relevant to the OP's application ?

With 63 PCA9685s, using the 1 Mhz frequency, that would allow over 15 khz /PER PCA9685.
PWMing LEDS with anything over 200 hz is pointless. The human eye will not distinguish the changes.
Title: Re: PWM cable lenght
Post by: Wawa on Dec 24, 2015, 03:32 am
Post#0 already mentioned the use of a PCA9685.
OP asked in post#9 for the baud rate.
Question about I2C being out of spec in Post#13 was answered with the Fm+ specs (here the 1Mhz popped up).

The chip does output a PWM signal, much like the Arduino PWM pins, with source and sink capabilities.
PWM frequency can be set between 40 and 1000hz, but defaults to 200hz on power-up.

1Mhz bus speed is not relevant to OP's project. Most I2C libraries I know default to 100khz.
I2C speed can be important e.g. for fast dimming.
Every dim step has to be written to the chip.
Leo..
Title: Re: PWM cable lenght
Post by: raschemmel on Dec 24, 2015, 03:41 am
Quote
The PCA9685 is an I2C-bus controlled 16-channel LED controller optimized for
Red/Green/Blue/Amber (RGBA) color backlighting applications. Each LED output has its
own 12-bit resolution (4096 steps) fixed frequency individual PWM controller that operates
at a programmable frequency from a typical of 24 Hz to 1526 Hz with a duty cycle that is
adjustable from 0 % to 100 % to allow the LED to be set to a specific brightness value.
All outputs are set to the same PWM frequency.
Each LED output can be off or on (no PWM control), or set at its individual PWM controller
value. The LED output driver is programmed to be either open-drain with a 25 mA current
sink capability at 5 V or totem pole with a 25 mA sink, 10 mA source capability at 5 V 
The source capability is only 10mA. I suppose that's more than enough for the led driver he linked.

Is he using this ? (https://github.com/kasperskaarhoj/PCA9685-Arduino-Library)
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 24, 2015, 04:24 am
The PCA9685 is in the new Fast-mode Plus (Fm+) family.
Ok, did not know there are different standards for I2C cause normally I2C is short distance and thats the reason things like P82B96 exist.

Thats is what i found:
Quote
Shielded 22 AWG twisted pair cables have capacitance in the range of 100-240 pF/m. So the maximum bus length of an I2C link is about 1 meter at 100 Kbaud, or 10 meters at 10 Kbaud. Unshielded cable typically has much less capacitance, but should only be used within an otherwise shielded enclosure.
AND NOW ATTENTION PLEASE
Stop mixing the I2C question with the question about cable length to drive LEDs directly via PWM from the Arduino.

If it was me I would use two PCA9685 boards where the lights are, and have 32channels available there.
Sure but then i use only 2 pins on the Arduino and the others are wasted.
And then i have the situation that brought up my question: I need to put the PCA9685 in a location where it is not accessible.

From a craftsman view (me) who has to lay the cables the ideal solution would be:

PT4115 > 3 meters 16AWG > LED (9.75V/1A)
Arduino > 4 meters CAT6 > 6x LED (3.2V/20mA)
PCA9685 > 4 meters CAT6 > 14x LED (3.2V/20mA)
Title: Re: PWM cable lenght
Post by: Wawa on Dec 24, 2015, 05:47 am
The source capability is only 10mA. I suppose that's more than enough for the led driver he linked.
The PT4115 LED driver OP linked to has a 200k pullup resistor to the LED driver's own 5volt rail.
So the LED driver only uses a sink current of 25uA. Nothing.

OP should use the larger sink capability of the PCA9685, so all LED anodes to 5volt.

Posting a diagram could prevent mistakes.
You should look at a piece of cable as a part with resistance and capacitance.
Where that part is in the circuit could be important.
Leo..
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 24, 2015, 10:59 am
Just to be clear: The PT4115 has nothing to do with the PCA9685.
The PT4115 question is already answered.

Schematic in the attachment...
Title: Re: PWM cable lenght
Post by: Wawa on Dec 24, 2015, 12:45 pm
Why the relay/drivers.
A single 10k resistor from each PT4115 DIM to ground does the same (or 3k3 for all).
A PT4115 draws <100uA when dimmed to zero.
Why not drive them from three separate PWM outputs.
Why two MCUs.

Drawing mistake in the 12volt detector circuit.
Leo..
 

Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 24, 2015, 01:54 pm
<100uA is not nothing. I prefer to have a real switch. Here some mA and there some mA and the power bill crows. Everywhere it is recommended to turn your stuff really off because of standby power consumption, unplug your chargers...

Often you can read in forums that people laugh about others why they think about the power consumption of there hard drives. But the people who are laughing think the electricity price is everywhere the same.
In Germany electricity is not cheap...
Electricity costs in Germany is like Hawaii and is rising...

Two MCUs because this are two different applications.
Also I'm not a programming god and scared the code will not fit on one.

Why not drive them from three separate PWM outputs.
Something i did not think about because they all get the same PWM.
Also i see no benefit driving them separately.
Title: Re: PWM cable lenght
Post by: aarg on Dec 24, 2015, 05:52 pm
You are joking, right? You think you could see 100uA on your electricity bill? Do the math.
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 24, 2015, 06:42 pm
Sorry was reading/thinking mA.

Hm, somehow I'm old school and don't feel good if the connection is not really cut *lol

My head is still thinking analog most of the time and i tend to overcomplicate.
But hey if you guys say i don't need the relays i remove them -> attachment

D10 and D11 are connected to read the dimming level (PWM feedback).
Title: Re: PWM cable lenght
Post by: Wawa on Dec 24, 2015, 07:50 pm
Running one MCU could save the most power.
Programming two sequences into one MCU is not that hard, and there is plenty of help here.
Using Cat-6 for the Cree LEDs could also save you some money for power. 1.5mm for <1Amp is overkill.

Why did you connect D10 and D11 to the LED drivers.
One ~500hz PWM pin is enough.
Leo..
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 24, 2015, 09:18 pm
Programming two sequences into one MCU is not that hard, and there is plenty of help here.
It's not the sequences it's the space i'm worried.

Using Cat-6 for the Cree LEDs could also save you some money for power. 1.5mm for <1Amp is overkill.
How does that save money on power? The bigger the cable the less power loss.
1.5-2.5mm2 is standard in Germany for 230V in house installation and the cheapest cable and you never know what you want to change someday.

And for DC you normally take bigger cables.
Most people use 0.75-2.5mm2 (depends on the length) for there 12V installations (halogen/LED).

I'm not below 1Amp - my drivers are exactly 1Amp.
At the moment i have 9.75V/1Amp LEDs.
Lets say 8 meters cable (4 meters towards/4 meters backwards).
AWG23 is ~0.25mm2
That is 0.5 watts power dissipation on such a cable -> efficiency bellow 95%

With 1.5mm2 the dissipation is 0.09 watts -> efficiency 99%

And you can already buy 2-3Amp LEDs and you never know if you change them one day.

Then this is just the shower wall and i have to do also some ceiling lamps and others (~10 meters)
and don't want to use different cables everywhere.
There i have then 5Amps or more and then CAT cable is a no go.

Why did you connect D10 and D11 to the LED drivers.
As i wrote: to read the dimming level (PWM feedback)
Title: Re: PWM cable lenght
Post by: Wawa on Dec 24, 2015, 09:49 pm
PWM feedback...
Sounds like an analogue idea to me.

Use a variable that holds the PWM value.
Then you know what the PWM value is when you need it again.
Leo..
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 24, 2015, 11:47 pm
That only tells me what the pin should be:
Quote
Reading the internal register will always return for you what the controller is trying to put on the pin, not the actual pin value.
I control this thing from different places: physical button also browser, app...
Everything talks MQTT (even my HTPC).
I want to see what the light is set to in % in my browser (WebSockets, JavaScript, Python).
I already did this with a potentiometer on the mixing valve of our central heating system and also with other sensors (live data).

Also a variable/boolean maybe gets out of sync.

BUT:
After thinking and thinking and again thinking about it :D
i take now the two PCA9685 and but them in the ceiling.
That means there are 12 pins wasted and it hurts with this cool chips.
But I paid 2,85$ for one (the same that the second 328 would cost) also i need just
one CAT cable to the ceiling and also save on the MAX 485.

I guess i never need access to the PCA9685 and you said 5 meters I2C is not a problem.
I always thought a bus buffer like the P82B96 is needed.

And if the code is to big for the 328 i need to change to a 2560.

But now let me change my schematic so you guys can shoot it down in flames again *lol
Title: Re: PWM cable lenght
Post by: raschemmel on Dec 25, 2015, 12:14 am
What about pulseIn() ?
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 25, 2015, 12:36 am
@raschemmel, need to check what that is :D

New schematic in the attachment.
Damn does that look clean compared to the old one *lol

Do i need a extra power supply on the PCA9685 LEDs (20-22 3.2V/20mA)?

And MERRY CHRISTMAS from Germany to everybody!
Title: Re: PWM cable lenght
Post by: Wawa on Dec 25, 2015, 11:37 am
Tip:
An old 19volt laptop supply is a good/efficient/safe LED supply.
19volt is good for a string of three or four power LEDs.

A (micro) buck converter could efficiently lower that 19volt to 5volt.
The 5volt supply could be used to power the 22 other LEDs (440mA), the PCA (6mA) and the MCU (40mA).

Also a Merry Christmas to all from New Zealand.
Leo..
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 25, 2015, 04:36 pm
I should have said power source instead of supply.
There are no power supply's in different locations.
I have 12V everywhere and just use buck's.


New Zealand - thats cool cause i have a face tattoo :)
Title: Re: PWM cable lenght
Post by: raschemmel on Dec 25, 2015, 05:25 pm
Quote
@raschemmel, need to check what that is 
Pulsein() (https://www.arduino.cc/en/Reference/PulseIn)
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 26, 2015, 04:42 am
Ok now I also connected the mirror and ceiling lights to this Arduino.
Neither do i dim from the Arduino. Ceiling needs no dimming and the mirror lights
are dimmed on the left mirror lamp via the potentiometer.
Voltage dimming on the PT4115 is done with 0-2.5v

I will put a switch in the ceiling lamp on the dimming line.
This is if i need to do something on the Arduino or it fails i can turn on the light (cut pull-down).

@Wawa, how did you came up with the 3.3 or 10k for the PT4115 pull-down?
The ceiling will have a "Mean Well MW LDD-1500L" driver and i need to know what pull-down
i need there: www.meanwell.com/mw_search/ldd-l/LDD-L-SPEC.PDF
To bad the specs only list the off current for 24v :-(

The MAX RS485 is gone...
There is a second Arduino (flow meters, temp, humidity, 2 servos, small OLED) and first
i wanted to do the network communication of both Arduinos trough this one.
But one WIZnet W5100 cost the same as 2 MAX chips.

I guess a electrolytic cap in some places would be a good idea?
Title: Re: PWM cable lenght
Post by: Wawa on Dec 26, 2015, 06:38 am
The PT4115 has an internal 200k pullup resistor to it's internal 5volt supply.
So the voltage on the DIM pin is 5volt when you disconnect/float the DIM pin (full brightness).
e.g with a switch.

A resistor (or pot) to ground creates a voltage divider with the internal resistor.
VOLTAGE dimming 0-100% is ~0.5 to ~2.5volt.
PWM dimming is fast switching between <0.5volt and >2.5volt (max 5volt).

A 10k resistor from the DIM pin to ground gives <0.25volt on the DIM pin, so the chip must be off e.g. when the MCU is booting (floating output pin).

Beware of the W5100. It is power-hungry.

I run a W5100 shield on a Mega for the home lighting.
It gives me Ethernet and WiFi/smartphone control through the router.
I also have a 433Mhz RF receiver connected.
Keychain remote control.
And voice control with an EasyVR shield on top of an UNO with 433Mhz transmitter.
And ofcourse walk-in PIR sensors and daylight sensors.

5k (2x10k) on the I2C lines might not be low enough.
Change R23-R26 to 4k7.
Leo..
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 26, 2015, 02:12 pm
Ok that means my Potentiometer calculation is wrong?

For the Mean Well there is nothing in the datasheet like that.

You where talking about the dimming levels.
That was my question here: 8-bit vs 12/16-bit LED PWM (http://forum.arduino.cc/index.php?topic=363062.0)
But i thought you can change somehow the timer for PWM?
So i have free pins on the PCA9685 and it is 12-bit maybe it would be better to also connect the shower lights PT4115 to him.
The Problem is i am really scared about the code. I never did something I2C and want to control dimming with one button.
I started a thread here but did not have the time yet to check the code BulldogLowell gave me:
One Button Dimmer (http://forum.arduino.cc/index.php?topic=366874.0)

OFF TOPIC:
I have 5 W5100 here and 2 ENC28J60.
I never checked the power consumption of them and don't know if they are different.
But since the W5100 has TCP build in...

Today so many devices have ethernet and low power consumption so why is the power consumption of the W5100 high? Is there an alternative because i need several of them.

For RF i have a URC MX-780 remote: LINK (http://www.universalremote.com/product_details.php?id=6&s=commercial&c=user_interfaces&p=MX-780)

First time i heard of the EasyVR shield. How good is it?
I'm running VoxCommando: VoxCommando - Scenario: Coming Home from Work (https://www.youtube.com/watch?v=ewCRJZKFW34)

Edit:
Did check the W5100 and ENC28J60 without connection to anything.
W5100 = 195mA
ENC28J60 = 145mA
Not much difference and with the ENC28J60 the ATmega has to do the work.
Thats 1 watt for the W5100 - wow

And then a question came to my mind.
Is IEEE802.3az just plug and play or does the board need to be designed for it or maybe you need to program the ATmega that it works?

Edit #2:
Damn just bought 2 W5100 and now see there is the newer W5500 and they are just 2-3$ more.
Looks like they also consume a little bit less power.
Title: Re: PWM cable lenght
Post by: Wawa on Dec 26, 2015, 09:28 pm
So i have free pins on the PCA9685 and it is 12-bit maybe it would be better to also connect the shower lights PT4115 to him.
The Problem is i am really scared about the code. I never did something I2C and want to control dimming with one button.
As said, 12-bit PWM gives smoother low level dimming.

After including the library, and declaring the board and PWM frequency in setup (three or four lines of code), you can use easy commands like this:

board_0.PWM(0, 15, 0); // board_0 (I named it that) is the first PCA, Set output 0-15 (all 16) to 0 (off).

board_0.PWM(3, 255); // set output 4 on board_0 to full brightness

board_1.PWM(7, 9, 128); // set output 8-10 on the second PCA board to half brightness (not half power).

This uses a CIE lighting lookup table. 0-255 is converted to 12-bits by the library.
Leo..



Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 27, 2015, 03:09 pm
I just saw the the PCA9552.
Is there any difference to the PCA9685 beside that its 16-bit.

I had the 9685 from eBay from private person who had 2 of them.
Our two big electronic shops in Germany don't have them.
But they have the 9552 and they are cheaper then the 9685.

Also the 9552 is easier to solder because they are SO24.
Title: Re: PWM cable lenght
Post by: raschemmel on Dec 27, 2015, 04:20 pm
I know it's just a technicality but if you  convert 256    8- bit  lighting levels to  256   12- bit  lighting levels , what happens  the other  3,840
12- bit valuea that weren't part of the original 256  8-bit values that were converted ?  Do they still exist ?
Title: Re: PWM cable lenght
Post by: Wawa on Dec 27, 2015, 08:05 pm
Lineair 0-255 spacing is converted to 0-4095 log spacing.
Leo..
Title: Re: PWM cable lenght
Post by: raschemmel on Dec 27, 2015, 08:14 pm
Well now that's a huge improvement.
Code: [Select]
//lookup table for 256 CIE lab brightness corrected values with 12 bit resolution
const uint16_t CIEL_8_12[] PROGMEM = {
  0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 18, 20, 21, 23, 25, 27, 28, 30, 32, 34, 36, 37, 39, 41, 43, 45, 47, 49, 52, 54, 56, 59, 61, 64, 66, 69, 72, 75, 77, 80, 83, 87, 90, 93, 97, 100, 103, 107, 111, 115, 118, 122, 126,  131, 135, 139, 144, 148, 153, 157, 162, 167, 172, 177, 182, 187, 193, 198, 204, 209, 215, 221, 227, 233, 239, 246, 252, 259, 265, 272, 279, 286, 293, 300, 308, 315, 323, 330, 338, 346, 354, 362, 371, 379, 388, 396, 405, 414, 423, 432, 442, 451, 461, 471, 480, 490, 501, 511, 521, 532, 543, 554, 565, 576, 587, 599, 610, 622, 634, 646, 658, 670, 683, 696, 708, 721, 734, 748, 761, 775, 789, 802, 817,  831, 845, 860, 875, 890, 905, 920, 935, 951, 967, 983, 999, 1015, 1032, 1048, 1065, 1082, 1099, 1117, 1134, 1152, 1170, 1188, 1206, 1225, 1243, 1262, 1281, 1301, 1320, 1340, 1359, 1379, 1400, 1420,1441, 1461, 1482, 1504, 1525, 1547, 1568, 1590, 1613, 1635, 1658, 1681, 1704, 1727, 1750, 1774, 1798, 1822, 1846, 1871, 1896, 1921, 1946, 1971, 1997, 2023, 2049, 2075, 2101, 2128, 2155, 2182, 2210  2237, 2265, 2293, 2322, 2350, 2379, 2408, 2437, 2467, 2497, 2527, 2557, 2587, 2618, 2649, 2680, 2712, 2743, 2775, 2807, 2840, 2872, 2905, 2938, 2972, 3006, 3039, 3074, 3108, 3143, 3178, 3213, 3248,3284, 3320, 3356, 3393, 3430, 3467, 3504, 3542, 3579, 3617, 3656, 3694, 3733, 3773, 3812, 3852, 3892, 3932, 3973, 4013, 4055, 4095 };

Title: Re: PWM cable lenght
Post by: Wawa on Dec 27, 2015, 08:22 pm
RS Components Germany has the PCA9685 (http://de.rs-online.com/web/p/led-anzeigen-treiber/7275649/?searchTerm=PCA9685&relevancy-data=636F3D3226696E3D4931384E4B6E6F776E41734D504E266C753D6465266D6D3D6D61746368616C6C7061727469616C26706D3D5E5B5C707B4C7D5C707B4E647D2D2C2F255C2E5D2B2426706F3D313326736E3D592673743D4D414E5F504152545F4E554D4245522677633D424F5448267573743D5043413936383526).
Not too hard to mount with very small amounts of solder paste and a hotplate.
A soldering iron is a bit tricky, unless you're experienced.

Adafruit (https://www.adafruit.com/product/815) has the chip mounted on a board with all the supporting parts and address solder bridges.
Maybe not ok as sinking LED driver, because of tiny 220ohm resistors in series with each output.

Not many libraries for the PCA9552.
Leo..
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 28, 2015, 04:11 am
I always forget RS. There shipping costs are barely ok.
Digi-Key for example is to expensive.

Does the PT4115 connected to the PCA9685 need a pull-down?
I guess not and you switch in the code from PWM out to sink?
Title: Re: PWM cable lenght
Post by: Wawa on Dec 28, 2015, 04:44 am
RS has free shipping (here in NZ).

No extra parts between PCA and the PTs.
No changes in the library/code I use for the PTs (Brunnels@github).

I guess you have to invert the outputs for the individual LEDs.
I will look through the library to see if there is a command for that.
Leo..

Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 28, 2015, 05:29 am
Adafruit is using 10K pull-up on SDA/SCL?
And whats the reason they use 10K on the address selection?

Is there a reason you did not choose to use GND (VSS) on every bus line like i see in the I2C-bus specification:
Quote
If the bus lines are twisted-pairs, each bus line must be twisted with a VDD return.
Alternatively, the SCL line can be twisted with a VSS return, and the SDA line twisted with
a VDD return. In the latter case, capacitors must be used to decouple the VDD line to the
VSS line at both ends of the twisted pairs.

If the bus lines are shielded (shield connected to VSS), interference is minimized.
However, the shielded cable must have low capacitive coupling between the SDA and
SCL lines to minimize crosstalk.
I also ordered some WIZnet W5500 cause I'm curious if i can get power usage down to more then the half.
Some calculation: W5500 power saving (WoL) - Ethernet power consumption (W5100, W5200, W5500) (http://forum.arduino.cc/index.php?topic=367999.msg2537454#msg2537454)
Title: Re: PWM cable lenght
Post by: Wawa on Dec 28, 2015, 06:31 am
10k on each I2C line is ok for short wires, e.g. inside an enclosure.
More bus capacitance (cables), and higher speeds (if needed), require lower value pullup resistors.
Not sure if there is a calculator for that.
I have seen upto 3mA pullup current used for 400pF (@100khz).
I would start with 3k3 (total resistance) for 5meters of Cat-6, and lower to 2k2 if needed.
That could be 10k on each PCA module, and the remaining 10k (or less) resistance near the Arduino.

10k pullup (or pulldown) on the address lines is not needed if you connect the line directly to ground or VCC.
Don't leave the pin 'floating".
I use 100k and a solder bridge on my boards.

Do NOT use clock and data on the same twisted pair (crosstalk).
Ok to combine one with ground and one with VCC, if you decouple VCC at both ends of the cable.
Exactly as in your post.
You should ofcourse always decouple VCC near any chip.
If you have enough pairs, you could combine each I2C wire with a ground wire.
Leo..




 
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 30, 2015, 11:13 am
How do i calculate R701 do have the 0-2.4 volt range on DIM through the potentiometer.
R706/R707 are the internal resistors of two PT4115 connected parallel.
Title: Re: PWM cable lenght
Post by: Wawa on Dec 30, 2015, 11:36 am
You basically only need a 100k pot (as variable resistor) to ground for two PTs.
The PT already has a 5volt source inside.

Another way is to provide an external control voltage.
That could be a 10k resistor from 5volt to one pin of a 10k pot, and the other pin of the pot connected to ground.
The wiper will have 0-2.5volt.
Maybe best to use a log pot for lineair brightness.
Leo..
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 30, 2015, 12:31 pm
Isn't that what i have in the attachment?

The 5 volt source is the arduino.
But since the two PT parallel are 100k i was not sure if the 10k to ground pull low enough
to turn the PT off in that circuit?

Or didn't you see the attachment?

And a big thank you Wawa for all your help!
Title: Re: PWM cable lenght
Post by: Wawa on Dec 30, 2015, 08:18 pm
No, your attachment shows a 10kpot and a 10k resistor in parallel.
They should go in series, so 2.5volt is across the pot.

Connecting the pot directly to 5volt will work, but then only half the rotation of the pot will change brightness.
Leo..
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 31, 2015, 12:42 pm
So it was already right how i had it in my big circuit?
Title: Re: PWM cable lenght
Post by: Wawa on Dec 31, 2015, 09:19 pm
Yes.
R708 has no function here.
It just loads the 5volt rail.
Leo..
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Dec 31, 2015, 10:16 pm
I don't need a pull down here to completely turn it off?
Title: Re: PWM cable lenght
Post by: Wawa on Dec 31, 2015, 10:26 pm
The wiper of the pot can travel between the 10k resistor (2.5volt full brightness) and ground (LEDs off).
Try to remove R708, and flip the drawing upside down.
Leo..
Title: Re: PWM cable lenght
Post by: MrGlasspoole on Jan 01, 2016, 05:07 pm
Happy new year!

Upside down?
Title: Re: PWM cable lenght
Post by: Wawa on Jan 01, 2016, 08:39 pm
Haha, no.
Remove the top ground symbol.
Swap the 10k resistor and pot.
Leo..