6
\$\begingroup\$

I'm building a mechatronic system that consists of 1)XY Gantry controlled with PIC32 and a DIY motor shield and 2)control box with PIC24 three potentiometers + room for expansion, typically located fairly far away. The two systems are to be connected using an XLR line because this is in an audio setting.

In designing the system, two big concerns have been to not introduce noise into the rest of the system, and to comprehend the ground loop problem. My knee jerk as an EE student was to use Op-amps to interrupt the ground loop. The plan was to send the three signal lines from the wipers of the pots over xlr, and to use the control system ground to measure the differential voltage at the system. I went to great pains to design something that would work with a true rail-to-rail swing. Works decently well on the bench, and I think this would work for the final system, but it seems like im turning into the guy who only has a hammer in the toolbox.

So I get to thinking about I2C. Allows plenty of room for expansion, and it only takes up two lines. Potentially, this means the system that was going to take two XLR cables might only need one now. So, here is the system I envision:

enter image description here

This image is ommiting the pull-up resistors on the bus AND the XLR's SHIELD. I plan on having pull-ups on the three segments of the bus (pre-buffer on both ends, and on the buffer.) The CLK will be operating relatively fast, so I don't want to introduce EMI into the audi0 lines as they will all be sharing an XLR bus, So im wondering how to properly connect the grounds. I've read the RANE notes, and from what I gather, to make a functioning faraday cage, I need to connect both chassis to the cable shield to make a complete enclosure.

My confusion is this: chassis ground is becoming an extension of the shield to keep out EMI. A lot of what people write assumes that you've got earth ground handy, and that you might tie earth, signal and chassis together at some point, via a direct, RC coupled, or diode coupled connection. First off, it has occurred to me that I don't have earth ground at my circuits via DC barrel because I'm sitting on top of two different power supplies via a switched and transformer coupled power supplies. So, do I tie the shield to the signal ground (barrel sleeve)? If so, with direct, RC or diode? My thoughts are yes, and to use an RC circuit with <= 100Ω. In a bad case - where the power supply grounds 1&2 are very different - will the offset at ground affect my logic levels? The P82B715's are supposed to be 'level translating'.

Thanks for the input.

\$\endgroup\$
7
  • 1
    \$\begingroup\$ I2C isn't great for long wires. How long are you talking about? \$\endgroup\$ – Scott Seidman Aug 2 '14 at 23:46
  • \$\begingroup\$ Yeah, I've definitely heard about this in the literature. I think 20m would be an average, with 50m really being the upper limit. From what I'm reading, the P82B can do distances like this. \$\endgroup\$ – RYS Aug 3 '14 at 18:07
  • \$\begingroup\$ Best grounding for i2c is to keep it on the same pcb.. How about rs485? \$\endgroup\$ – Erik Friesen Oct 3 '14 at 1:55
  • 1
    \$\begingroup\$ I think i2c is unsuited for this, why not do a little re think and use rs485 or some type of lvds? \$\endgroup\$ – Erik Friesen Oct 4 '14 at 23:04
  • 1
    \$\begingroup\$ Made the switch to RS485 shortly after this post; had it working for a while, but it has been broken for the last few weeks. Having a lot of fun figuring it out.. \$\endgroup\$ – RYS Oct 5 '14 at 7:32
1
\$\begingroup\$

There are a few options available.

The most industry-standard approach to this issue is to use a different bus instead of I2C. Many microcontrollers support CAN bus or ModBus natively. Another common choice is RS-232.

The other approach would be to use isolated transcievers. I recommend doing this regardless of which bus you use.

The third approach would be to pass power along with your communication. You specifically note that it's low power, but don't define how low, so I don't know if this is viable.

\$\endgroup\$
2
  • \$\begingroup\$ Hey Tom, thanks for the input. I switched to RS-485 some time ago. Humming along nicely now. \$\endgroup\$ – RYS Dec 10 '14 at 20:38
  • \$\begingroup\$ Probably a good choice. Do you have any remaining issues? I might be able to help you. Otherwise, please select an answer and mark it as accepted, so your question will not show up in the unanswered questions sort. \$\endgroup\$ – Tom Brendlinger Dec 11 '14 at 0:03
1
\$\begingroup\$

I would ask the following question: is your low power linear supply transformer-isolated? (They usually are.) That is, does it use a transformer to convert mains voltage to a low AC voltage, then convert to DC and regulate? If so, and if you can float the low voltage lines, simply tie your two DC grounds together with a convenient gauge wire. The step-down transformer will isolate the output from the input.

If you do this, there remains the possibility that the low-power chassis may still be connected to a different ground line than the high-power chassis, with the potential for hazard. And it will be necessary to look at the linear supply schematic to see if you can actually disconnect supply common from ground. It will also be a truly excellent idea to verify that both mains connectors are properly wired. If not, the two circuit grounds may actually have mains voltage across them.

\$\endgroup\$
2
  • \$\begingroup\$ Yes, it's your standard transformer, filter cap, regulator PS setup. This was definitely part of my confusion about the grounding of my system (It is a 2 prong plug, not a 3 prong plug as stated in the diagram.) I'm less familiar with switching power supplies, but I'm wondering if it's the same situation on the SMPS side - a quick look showed that these almost always use transformers too. \$\endgroup\$ – RYS Aug 3 '14 at 18:15
  • \$\begingroup\$ [Also by RYS. Second part of an answer converted to a comments.] So I'm transformer isolated on both ends, but possibly above different grounds. If I hook the shield of my wire to the chassis on both ends, I'm assuming I'll need to connect this to my signal ground (both ends). What's the best way to do this? A resistor would definitely limit the current through the shield... \$\endgroup\$ – Nick Alexeev Aug 3 '14 at 18:36
0
\$\begingroup\$

In a bad case - where the power supply grounds 1&2 are very different - will the offset at ground affect my logic levels?

Worse: It will destroy the I²C buffers. They only allow voltages from 0 to VCC (max 12V) on bus lines.

I would rather use RS485 as a bus. There are transceivers with a higher common mode voltage range, and the bus is not as sensitive to noise as I²C is.

If the ground potential difference can get high, you might have to use optocouplers.

\$\endgroup\$
2
  • \$\begingroup\$ P82 design notes state that the chip will do 50-100m depending on line capacitance, which is plenty for my needs. RS485 looks interesting though. My question remains; I'm seeing that rs485 can refer to local ground or send ground with the twisted pair. If we're doing the latter, how should grounds be connected? \$\endgroup\$ – RYS Aug 3 '14 at 5:08
  • \$\begingroup\$ DMX uses RS485 at 250kbaud on 120ohm specialized cable or 100ohm Cat-5, with the proper termination. You might look that up. \$\endgroup\$ – AaronD Oct 16 '14 at 3:11
0
\$\begingroup\$

If robustness is more important issue than cost, possibly consider the following:

1) I2C Isolator IC to isolate signals and power. See numerous ICs from Analog / Clare / Linear / NXP / Silicon Labs / TI / ...

and/or

2) I2C "Long-Distance" Driver, such as NXP PCA9600, NXP P82B96, or similar.

\$\endgroup\$
0
\$\begingroup\$

I2C is notoriously difficult to maintain signal integrity over any type of distance because it relies on passive pull-up resistors. Since you only have two ends of your communication bus, the better approach would be to use RS-232, which is made specifically for this purpose. It will also be much easier to troubleshoot. If noise is a concern then consider using optically isolated RS-232. It's much easier on RS-232.

If you insist on using I2C, then best bet is to route it through an isolator: http://www.analog.com/en/interface-isolation/digital-isolators/adum1250/products/product.html

\$\endgroup\$
1
  • \$\begingroup\$ I've switched to rs485. Had it going for a while, but have run into some problems - your name comes to mind.. Any tips on how I might use rs 232 in half-duplex mode? I know that 232 uses a higher differential signaling voltage - any advantage over rs485 with respect to common mode? \$\endgroup\$ – RYS Oct 17 '14 at 5:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.