Voltage drop + I2C - Page 1
Forum section: electronics / projects

author: Starlord
author_rank: Frequent Contributor
timestamp: July 26, 2015, 12:19:18 pm
content: Hey guys,I'm working on a design where I want to place a few LED drivers at the end of a 2.5M flat flex cable.Here is one of the drivers in question:http://ams.com/eng/Products/Lighting-Management/LED-Driver-ICs/AS1115Because I expected my peak current to be 1A or so, I thought it would be a good idea to calculate the voltage drop. The cable has 0.65mm wide 1oz traces and I dedicated four of them to power, so they're equivalent to a 1.3mm wide 1oz trace that's 2.5M long.http://www.eeweb.com/toolbox/trace-resistanceAt 30C/85F ambient, this calculator says that such a trace would have a resistance of .952 ohms.Using ohms law E = I X R, we can see that at 1A .952 ohms of resistance will lead to a .952V drop.Okay, that's not too bad. I've got a 5V supply, and the forward voltage drop of my LEDs are 3.9V maximum, and the minimum operating voltage of the chip is 2.7V... so I'm good to go, right?But wait... What about the voltage of the IO pins relative to Vdd? Oh shit...According to that datasheet, the IO pins can't be more than Vdd + 0.3V. Which could mean that if I have more than a 0.3V drop on my power lines, I'm screwed, because there won't be an equivalent drop on my data lines!But wait again... could I2C be here to save the day? I mean it's open-drain right? So... the outputs are either disconnected, or connected to ground... correct?So if I have 4.7K pullups to 5V on my microcontroller side, even if the voltage drop is insufficient to reduce that 5V any, the LED driver won't be harmed by it because its I2C pins will never see that 5V as they are either shorted to ground, or not connected... right?Btw, I don't have any pull ups on the LED driver side of the I2C bus. I hope that won't be an issue at 400KHz. I read up on I2C and I think others have said it should be fine for several meters with just the one set of pullups on the microcontroller side. I am wondering if it could be bad to have pullups to 4V on the LED side, connected to a data line being pulled up yo 5V on the other end though.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 26, 2015, 01:04:18 pm
content: Oh no. Wait...I2C is open-drain when TRANSMITTING. But when receiving...Does this mean I'm screwed? Or can I fix this by sticking pullups on both ends? What voltage will be seen by the pins then? I tried to calculate it, and I think with 4.7K resistors on each end, the pin between them would see 4.5V with the 1V drop causing the pull up on its side to be to 4V. But even 4.5V is too much if the pin is only rated for Vdd + 0.3V.

author: Ian.M
author_rank: Super Contributor
timestamp: July 26, 2015, 01:44:11 pm
content: You are totally screwed unless you have three or four times as much copper in your ground return trace as the voltage drop due to the load current will FUBAR your I2C logic levels.Just about the only way of saving this amazingly bad design would be to add an I2C optoisolator with a dedicated ground trace down the cable for it that doesn't carry any load current. Presumably you cant add more traces for power and ground, so you will also have to add a switching regulator at the LED end and send a higher voltage down the cable (e.g. 12V) to reduce the current and therefore the voltage drop.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 26, 2015, 02:30:28 pm
content: Wait, what's this about my ground traces? Are you saying that even if I say, boosted the supply to say, 12V (my battery voltage) and then stuck a 5V regulator where a 5V supply is needed, that I would still have a problem with I2C communication because of the shared ground?> Presumably you cant add more traces for power and groundWell, I didn't want to do that on the FFC for a few reasons, but one option I was considering was running a separate power line for the LEDs.In the interest of keeping the original post simple, I didn't describe the problem exactly as it exists. I have that driver, but also some high powered LEDs on a different driver. The high powered LEDs I could drive from a separate power line, which would reduce the current draw for the regular LEDs to less than 500mA. But while I can provide them with their own ground, they still have to share ground with the I2C line since the I2C will be driving an IO expander that than triggers their constant current drivers.But what you're saying about the ground scares me. It sounds like I'd have problems even if I ran some 26awg power and ground wires to the high power LEDs. (They'll only be drawing around 500mA themselves.)

author: Starlord
author_rank: Frequent Contributor
timestamp: July 26, 2015, 02:37:03 pm
content: Found this document on optoisolators for I2C and differing ground potential. Reading it now:http://www.nxp.com/documents/application_note/AN10364.pdf

author: nuno
author_rank: Frequent Contributor
timestamp: July 26, 2015, 02:52:01 pm
content: I like isolators like this, simpler hw than using opto couplers, although you need to take (low) power to the peripheral end:http://www.silabs.com/Support%20Documents/TechnicalDocs/Si841x-2x.pdfBut I have used them only to about 0.5m (actually, AD's version, which is even pin compatible but about 2x the price)... although at 500Kbps. Everything running on twisted pair, each line with its own GND line (connected at both ends).

author: Starlord
author_rank: Frequent Contributor
timestamp: July 26, 2015, 02:59:15 pm
content: Well after reading a few paragraphs of that I have a somewhat better understanding of the problem. I would prefer not to have to use an isolator though.I guess what I need to know is:1. At what current should I start to worry about my ground potentials drifting too far apart, when powering an I2C device over a 2.5M FFC?(1oz copper, 0.65mm wide traces, two for 5V, two for GND)2. Is there a way to salvage this amazingly bad design without resorting to an isolator or ditching the FFC for the I2C bus?I can run separate lines to supply power. I can supply up to 12V. But said power line would still need to share GND with the ICs.I mean, my high powered LEDs are going to be common anode... so their grounds will be switched. I guess that means I could route their grounds through the power line and use the grounds on the I2C cable for the logic. I don't think I could run the smaller LEDs without allowing them to share the ground of the ICs though.

author: nuno
author_rank: Frequent Contributor
timestamp: July 26, 2015, 03:18:26 pm
content: My opinion is, if you want to be "safe", no worries and no weird events, sleep well at night, you'll have to galvanic isolate the communication. When you start having multiple GND connections, things get more complex, ground loops, unexpected interactions, ... there are already enough bugs in I2C implementations to worry about

author: Kleinstein
author_rank: Super Contributor
timestamp: July 26, 2015, 04:05:36 pm
content: A 0.9 V drop on the GND line may still just work with I2C. It some what depends on the chips - but 5 V powered I2C chips might well live with a 1 V low level and 4 V high.But you will have trouble with the LEDs: you have two times 0.95 V of drop so only 4.1 V left from initially 5 V. Thats to little for a LED that might need 3.9 V.A 12 V supply might save the day as current is only half.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 26, 2015, 04:47:15 pm
content: Quote from: Kleinstein on July 26, 2015, 04:05:36 pmHow do I calculate that drop? If I put in 5V and the trace specs into that calculator and it tells me there's a 1V drop, does that mean there's a 1V drop on the ground line or what? And when you say "drop", would the ground of the LED drvier be at a lower or higher potential than the microcontroller?Because if it's higher, and the 5V line is lower, then wouldn't the difference at the LED driver end be 3V? So either each has to be 0.5V or the ground potential at the LED driver has to be -1V relative to the microcontroller.But if the ground potential at the LED driver were at -1V and the 5V rail was at 4V, then again that's a 5V difference, so there'd be no "voltage drop".Just trying to understand what's going on here.QuoteSo it sounds like you're saying the LED driver ground would be at a higher potential. But then if those numbers are right, wouldn't that mean there'd be only 3V available on the LED driver side?QuoteWhy is that? When I said the voltage drop for the LED was 3.9V max, I meant it. That's the maximum. The typical value is lower. Of course I don't want the LEDs to sometimes not work, so I need to make sure I have at least 3.9V.QuoteNot really. The plan was to use cheap linear drivers. I figured at 5V they wouldn't be wasting too much power. Or perhaps you meant if I regulate down to 5V at the other end? I was talking linear regulators for that as well, for the IC logic. I don't have room on some of these boards for a switching regulator. But that's something to consider.I want to keep this cheap though, and simple. I've been working on this design for months and I really can't afford to spend any more time on it than I absolutely have to. So I really don't want to mess with isolators because I will have to spend a lot of tine studying datasheets and making footprints and routing only to find out when I get my prototype back I screwed something up. And the 12V supply thing isn't really ideal ether, because it screws up my plan to use cheap linear current regulators. I'd have to throw a buck regulator on there. I mean it's not out of the question but...Ideally, I would like to just be able to run two wires alongside my I2C ribbon to lower the voltage drop when needed. I assume I can do this... if I use a sufficiently large wire gauge? Hm... I don't want to have to run 16AWG though I just want a little JST connector. So maybe a 12V supply and single 5V buck converter would be the way to go....

author: Mad ID
author_rank: Regular Contributor
timestamp: July 26, 2015, 07:01:19 pm
content: Quote from: nuno on July 26, 2015, 03:18:26 pmGround loop worry on a flat cable with multiple ground wires? Ohhh..that's not the right reasoning.As for the original question, you can use AWG 26 flat cable and half your worries, it's not unusual. I have done it multiple times to reduce the voltage drop.

author: nuno
author_rank: Frequent Contributor
timestamp: July 26, 2015, 07:08:10 pm
content: Quote from: Mad ID on July 26, 2015, 07:01:19 pmNot if you have only that cable, but the discussion includes having a separate power supply for the LEDs, but with common GNDs everywhere.

author: Ian.M
author_rank: Super Contributor
timestamp: July 26, 2015, 07:26:24 pm
content: Show us your schematic so far, including those high current LEDs. It may be possible to handle the ground offset between the I/O expanders and the LED drivers.Optoisolating I2C is a mess - unless you are bit-banging it and can split each signal to separate in and out pins on your MCU. Have you considered SPI I/O expanders as they are easy to optoisolate?

author: Starlord
author_rank: Frequent Contributor
timestamp: July 26, 2015, 08:50:13 pm
content: I don't have a schematic for what goes on the end of the cable. I'm still designing that part.I also don't want to switch to SPI. The whole point of using I2C was to simplify the wiring and configuration. With I2C each satellite board has an address. I don't need to connect them in a specific order, or route multiple CS lines, and only two IO pins are required for communication. For stuff mounted near the board, it's a perfect solution. The ribbon cable is super cheap, as are the connectors. And if I could have gotten away with it for this long run I'd have gone with FFC that had four lanes instead of six. But I'd calculated what the voltage drop would be at these higher currents and figured out that it would be too high for some of the LEDs. What I hadn't realized until today was that my logic levels would be unaffected by the voltage drop and that could fry the chips.Also the I/O expander is the least of my worries, since theoretically I could isolate its ground and power, and it doesn't draw much current.The LED drivers on the other hand...I've got the A1115 which can multiplex 64 LEDs but should draw less than 350mA (though the datasheet indicates 500mA is the absolute maximum). I can't do anything to isolate it from itself.And then I've got this TI I2C LED driver chip which can drive 8 LEDs at 20mA each. I probably won't have more than 5 on at a time, so that would be drawing around 100mA, but again I can't isolate it from itself, the LEDs are grounded through it.And then I've got the high power constant current low side linear LED drivers:http://diodes.com/datasheets/BCR420UW6_BCR421UW6.pdfThey've got an enable pin I planned to toggle with an I2C I/O expander. They too probably can't really be isolated they have to share a ground with the logic, but if they do and that ground lifts... I don't know what problems that might cause.I want to keep things simple. And cheap. The point of using the FFC was to keep things cheap. If I have to add a bunch of isolators all over the place that defeats the purpose. At that point I may as well look into connecting the I2C devices with some 24awg wire. That would keep the voltage drop to .42V @ 1A. That may be barely sufficient if I can cut corners on the current here and there. Or maybe I could use a two pin 'supplemental' power connector with 22awg wire for the long run, and make sure the power hungry boards don't connect the 5V and GND pins on the I2C connector. But I2C is supposed to have ground or 5V and ground running between the two data lines and that wouldn't be the case if I didn't connect those at one end.But anyway, I'd much rather move to a different kind of cable than use a different data bus or mess with isolation chips. But I'm also kinda attached to the flat flex cables and their small cheap connectors. I'd like to still use those if I can, even if I need to supplement them in this one case where I have a long run.One option I'm considering is making an adapter of sorts, so I can keep the flat flex connectors for short runs and have an adapter with a flat flex connector to allow me to run large gauge wire over longer distances when needed.

author: nuno
author_rank: Frequent Contributor
timestamp: July 27, 2015, 12:31:02 am
content: I guess you'll have to do some experiments and scoping.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 27, 2015, 05:19:16 am
content: I don't have a scope, and I don't have any more time to experiment. I need to have this finalized by the end of August and it takes three weeks to turn a prototype.

author: Ian.M
author_rank: Super Contributor
timestamp: July 27, 2015, 06:09:25 am
content: You are nearly totally screwed.* Your first mistake was to use I2C for an off-board bus that exits the enclosure.* Your second mistake was to choose flatflex* Your third mistake was to have inadequate test equipment.* Your fourth mistake was to start an over-ambitious project with a short deadline (I'm assuming you didn't piss away 90% the time before asking for help).There is one way out that doesn't involve optoisolation or running heavy copper ground wires.Use an *ISOLATED* DC-DC converter at the LED board end, with a separate ground signal trace in the cable for the I2C bus. That way, voltage drops in the power and power ground traces cant shift the remote ground voltage. Such converters aren't cheap but they are available as off-the-shelf parts.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 27, 2015, 07:35:43 am
content: QuoteI've been in worse scrapes.QuoteYou know Ididresearch this before jumping in headfirst.There are discussions here about using I2C over 10, 25, and 100M cables:http://electronics.stackexchange.com/questions/106265/maximum-i2c-bus-lengthI'm only looking to transmit over 2.5M of cable.And if worst came to worst, there's this buffer which can do 25M:http://www.nxp.com/documents/data_sheet/P82B96.pdfIt'll add $5 to the cost of my design, but it's easy enough to implement, if I have no other option.QuoteYou'd be surprised what one can accomplish through sheer determination.But it was done out of necessity, not masochism. I haven't been able to afford one yet. I've been eying the newest Agilent entry level scope for a while though.QuoteYou would assume wrong. I've been working on this for seven and a half months off and on. It was supposed to take two. It's probably going to take ten or eleven. I'm hoping to get it done in nine.And I didn't ask for help because I didn't know I needed help.I knew I needed to worry about voltage drop. And I calculated what the voltage drop would be. What didn't occur to me was that my logic levels would remain the same even as the IC's power supply drooped and that this would cause the voltage at the I/O pins to exceed their ratings and mess with the logic levels.One thing I still don't understand is how the ground potential figures into all this. From what people have said, it sounds like the voltage drop caused by high current draw will affect the ground potential. But I don't understand in what way. I'd assumed that my 5V supply would become 4V - relative to my microcontroller's ground, but now I'm thinking it will be 4V relative to the LED driver ground? And the LED driver ground will be what? Lifted by 0.5V? While the 5V supply drops by 0.5V? Resulting in the 1V drop the calculator indicated? Is that right?

author: Jeroen3
author_rank: Super Contributor
timestamp: July 27, 2015, 09:27:16 am
content: The PCA9615 maybe?

author: Ian.M
author_rank: Super Contributor
timestamp: July 27, 2015, 10:05:35 am
content: An old but good working order 50MHz dual channel analog scope with a delay timebase is quite adequate for debugging gross I2C bus problems, nearly any analog circuit up to 10MHz, and digital to 5MHz provided no rare events or glitches are involved. That's the sort of spec that gets given away nowdays. They are still useful to have around if you are doing low noise stuff as it doesn't have the internal RF noise sources a modern dogital scope has.Voltage drop calculations just involve applying Ohm's law. Assuming the power and ground tracks are identical, and taking the supply end 0V as the reference point, you have 0.952 ohms resistance for both the power and ground traces. At 1A, the LED end ground will be 0.952V positive with respect to the supply end and the supply will be 0.952V less than the supply end 5V rail which only leaves you just over 3V for the LEDs and FUBARs your I2C bus as the supply end is trying to pull the LED end SDA and SCL signals nearly a volt below ground. To work as-is, you need an order of magnitude more copper in the ground connection as tolerating more than 0.1V (at 1A) difference in the grounds will be problematic. I haven't even allowed for the connection resistance at the flat flex connector at each end.Or to view it another way, if you are only interested in the total voltage drop and both traces are the same width, take the trace length as there and back again, i.e. double the cable length.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 27, 2015, 01:29:47 pm
content: QuoteThat's the bit of knowledge I was missing. Nobody ever mentions the ground lifts as much as the supply drops.And that means the I2C communication issues are the least of my worries. This design is screwed six ways to Sunday if I can't get more copper in there because I won't have sufficient voltage to drive the LEDs.Luckily, I have a plan! And I think Jeroen just handed me the last piece of the puzzle.My original plan, before settling on FFC, was to use Cat5 cable. Cat5 is cheap. And I can buy the cables pre-assembled. It's also sturdy.The downside is, it's bulky. The connectors are bulky. And it's not nearly as cheap as FFC. It's also no good for connecting two boards sitting right next to each other in a tight space, which is what would be happening at the other end of the cable where I want to connect several boards. This is why I chose FFC. It seemed like a perfect solution. Tiny connectors. Cheap. Sturdy. And I can get it in any length.But as we've seen FFC also has a drawback. Insufficient copper.On a 0.5mm pitch cable, I'd need a shitload of traces to get me where I need to be.So, what to do? Well, I'm thinking I can combine the two approaches. I can either stick an RJ45 jack on my main board, or on a small satellite board and run a short length of FFC to it. Short length = low resistance, as long as I don't burn my traces up I should be good.Then on this satellite board (which I can leave out of the equation when I only want to connect other satellites nearby), I stick the buffer that Jeroen pointed out:http://www.nxp.com/documents/data_sheet/PCA9615.pdfThis buffer is interesting because it uses differential pairs to make it immune to noise and ground lift!But ground lift won't be as serious an issue with the Cat5, because it has 24awg wire. Four pairs of 24awg wire. And if I calculate what the voltage drop would be if I dedicate a pair each to 5V and ground:http://www.calculator.net/voltage-drop-calculator.html?material=copper&wiresize=84.22&voltage=5&phase=dc&noofconductor=2&distance=3.05&distanceunit=meters&amperes=2&x=62&y=8I find that for a standard 10ft 3.05M cable, the voltage drop at 1A would be 0.26V.And if I want to do something crazy at 2A the voltage drop is still only 0.51V.Which means I'd have 4V at the other end of the cable. Which is sufficient to drive the LEDs. And should be sufficient to maintain I2C communications as well, since that chip states it works with a ground offset up to 1/2 the supply voltage, an that the line side works down to 3V.Of course there still may be some issue with the I2C chips sharing that ground, but I'm pretty sure the ground lift when pulling 1A won't be sufficient to cause problems. The datasheet for that LED driver did state that Vdd + 0.3V was within spec. And the logic level of the I2C coming from the buffer I assume will be Vdd anyway, so I shouldn't even need that headroom.So, yeah... I think with this setup, a 2A draw might be possible! But again, that's is not a requirement for this project.Oh, and I think I missed a step above. There would be a second one of these buffers at the other end of the cable. Obviously that's necessary.

author: Kalvin
author_rank: Super Contributor
timestamp: July 27, 2015, 01:54:50 pm
content: How about adding an isolated DC/DC at the power supply end of the flat cable and running the LED power supply lines V+ and GND separately from the I2C lines so that the separated grounds meet only at one point? That should solve your problem.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 27, 2015, 04:17:44 pm
content: Quote from: Kalvin on July 27, 2015, 01:54:50 pmI'm not familiar with isolated DC/DC supplies, and are you suggesting I run a high voltage supply and have some kind of isolated buck converter to get to 5V?

author: Kalvin
author_rank: Super Contributor
timestamp: July 27, 2015, 04:27:40 pm
content: Quote from: Starlord on July 27, 2015, 04:17:44 pmThere are low voltage isolated DC/DC converters available, for example- 12V in, 5V out- 12V in, 12V outshould be quite inexpensive. Just select the input/output voltages according to your needs and what you have available. Anyway, when you keep the led power supply+ led ground separated from the logic signals and logic ground, and just connect them at one point at the LED end, you shouldn't have any problems with the ground loops. There will be a voltage drop in LED power supply at the LED end, but it doesn't affect the logic levels at the LED end.

author: AndreasF
author_rank: Frequent Contributor
timestamp: July 27, 2015, 06:41:40 pm
content: I think CAT5 cable is the best option. I would use 3 pairs for power and ground, and the last one for I2C (not sure if you need another signal).I'm not sure why you think RJ45 connectors are bulkier than FF connectors. Either way, nobody forces you to use RJ45 connectors with CAT5 cable. You could easily connect it to a FF connector - probably not too sturdy, though.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 27, 2015, 08:04:09 pm
content: Quote from: AndreasF on July 27, 2015, 06:41:40 pmIf I use that buffer chip which converts the signals to differential and corrects for ground lift then two pairs are required for I2C. Are you suggesting I could do without the buffers? I want to keep my costs down, but... peace of mind is worth something.QuoteBecause they are?http://www.molex.com/pdm_docs/sd/438600025_sd.pdf16x15mm footprint. Huge!http://portal.fciconnect.com/Comergent//fci/drawing/hfw01lf.pdfhttp://www.molex.com/pdm_docs/sd/528082071_sd.pdf8.8x6.5mm and 9x4.5mm I could almost fit four of these in the same amount of space!And that's not even counting the cable itself whose connector sticks out 40mm from the socket, and requires 60mm of clearance if you immediately bend the cable 90 degrees. Not ideal for space constrained applications!QuoteI'm designing a board I want to sell, so the cable has to be sturdy and it needs to be readily available, because I've gone the route of hiring someone in China to assemble special round ribbon cables for me in the past and 25% of the things failed wasting hundreds of dollars and making me look bad.Now, I'd have had to order the FFC from China to get it in 2.5M lengths, but that's a bit harder to screw up and the cables are much cheaper to replace.The Cat 5 cable on the other hand I can get per-assembled here in the US for $4. And the two sockets are $1 apiece. 2-3x as expensive as the FFC would have been but at least nobody will think I'm being cheap.

author: AndreasF
author_rank: Frequent Contributor
timestamp: July 28, 2015, 10:08:45 am
content: Yes, I suspect if you use 3 pairs for power and ground, the voltage drop/ground lift would be small enough to not require extra components to deal with this drop. The DC loop resistance is <0.188 Ohm/meter, so for 3 pairs at 1A approx 150mV drop.You are right, RJ45 connectors are a lot bulkier (I was confusing flat flex with ribbon cable), but if sturdiness and reliability is a concern then I think that is yet another argument for RJ45 connectors and CAT5 type cables. FFC aren't exactly sturdy to begin with. The simple fact is, you're trying to transmit a good amount of power over some distance, and unless you want to add a number of extra components at both ends to get around the resistive losses, you simply need a certain amount of copper to do that.These cables are also commodity items, so your potential customers could easily adapt them to their needs (only need 1.5 meters between the modules? - no problem!). That wouldn't be so easy with FFC.Anyway, it's your project and your (tight) timeline. Good luck!

author: Kalvin
author_rank: Super Contributor
timestamp: July 28, 2015, 11:08:28 am
content: Here is my idea which will break the ground loop for the LED power supply thus eliminating the ground bounce and the problems in the I2C bus.