OTS Opto-Isolator for UART Ground Loop

Just recently read the write up on ground loops and we have plenty of them :smile:

Specifically, we have several arduinos connected to odrives uart pins tx/rx/gnd. Assuming the ground is necessary we will need to decouple these lines.

Looking for an off the shelf isolator and found this one from Sparkfun but only operates at 9600bps https://www.sparkfun.com/products/9118

Two Questions:

  1. Is there a way to turn down the UART baud rate on the ODrive to 9600? I have been looking through the firmware and I canā€™t find an easy way to do that.

  2. Are there any recommended GPIO/UART isolators to use available on breakout boards?

Have you considered using CAN instead? Itā€™s designed for this specific application. :slight_smile:

1 Like

Weā€™re using Sparkfunā€™s differential i2C breakouts to create a CAN alternative for ease of use and are planning to roll that into our production model. CAN just wasnā€™t ready for us on ODrive based on our timeline and the cost of integration was too high for our situation.

If anyone has recommendations on UART decoupling weā€™d greatly appreciate it.

1 Like

For anyone else following along, looking at the ODrive docs recommendation of the TI ISO7762F it does look very strait-forward. They have a dev board for $50 here. Way too expensive for production but worth a look. We might dive deeper into this and make a quick breakout board, will post links to eagle files here if thatā€™s the direction we go. Would love to see this chip integrated into the ODrive for communications isolation it looks great for $3.80 in single quantities.

1 Like

We are also in the process of designing a ā€œHatā€ for the ODrive that isolates the GPIO and provides for differential SPI encoder connections and differential incremental encoders

1 Like

Hey Yaā€™ll, just finished this breakout design and posted on OSHPark. I designed this for our application which uses several Sparkfun Qwiic Micros. Mounting and headers should align so that you can solder header pins between the Micro and this board and have full isolation on TX/RX and D0/D8. This is a quick first pass so feedback welcome.

Link to OSHPark Page Here

Parts List
1 x ISO7762FDW - SOIC 16
2 x 0805 Caps - 0.1uf

1 Like

Iā€™m surprised to hear that. It was quite the opposite experience for me. ā€œDifferential I2Cā€ was a nasty hack that some predecessor at my work used, with all kinds of spurious faults that went away when you tried to diagnose them but cost us hours of lost data when in the field. Whereas CAN ā€˜just worksā€™. (provided you set it up right in the first place, but both ODrive and Linux do that part for you: you just give them a ā€˜baud rateā€™ like on a serial port)

The ā€œCANSimpleā€ protocol of ODrive really could not be simpler. It is much easier than I2C, thatā€™s for sure.

ā€œCost of integrationā€ is a board with two chips on. Ā£30-Ā£50 to buy someone elseā€™s board, or Ā£5 if you can design your own. But you only need that once, for all ODrive axes.

@towen thanks for your feedback. Like I said, CAN wasnā€™t the right solution for us and I can certainly see how itā€™s the right solution for other folks. Just trying to add new flavors to the mix here.

2 Likes

Hi @Alexander_Jones, I was also looking into making something that could protect ground loops over the last couple of days, as Iā€™m ready to plug in 2 x ODrives to Arduino Mega Serial 1 & 2.

I was of the opinion that Opto-Isolation were slow and relatively expensive, although now being introduced to the ISO7762F chip at 100Mbps by yourself and @madcowswe , and especially seeing your breakout board Iā€™ve decided to give them a go. Also, the fact that it will isolate CAN and SPI is very promising.

Thank you for sharing this.

Iā€™ve ordered 9 of these (as they come in 3ā€™s per order for $5 (very good value)) , where I chose the free postage of 21 days to the UK (could have got it faster, but not in a rush for the additional cost).

Iā€™ve ordered the SMD Parts listed above also, so will let you know how I get on. Iā€™ll still be trying This idea also just in the interim, but for peace of mind, I will settle on the ISO7762F and your breakout all being good.

Kind regards,

Neil.

1 Like

@Dev255 thatā€™s awesome! Definitely let me know how it goes. We found that these little boards work great.

1 Like

Hi @Alexander_Jones, will let you know, everything has arrived, although running the mill on a Christmas project at the mo, will fit one of these to it once complete and let you know :+1:

Hello,

Thank you for taking the time to develop this board, I think it might be the perfect solution for my project.

Am I right in thinking that if applied as shown, no ground loops should be formed?

As Iā€™ve had some success controlling one odrive via UART I will likely stick to using this for the time being. In the near future, I would like to give linking everything up via CAN a go, however being a complete novice this seems a bit far fetched for me right nowā€¦

Thank you so much!
Dan

EDIT: improved lineweights on diagram

3 Likes

yes, just be aware if you plug in USB to both the Arduino and the ODrive at the same time, youā€™ll make a ground loop through the USB GND. You can use a USB isolator (available at ODrive shop) to fix this.

1 Like

Great, thanks!

Although, I have looked and the ISO7763 chips seem to be out of stock pretty much everywhere until next year :frowning: I will spend some time looking for an alternative tomorrow, but if you know of a suitable alternative, that would be very helpful.

Again, thanks for this,
Dan

Hi,
I was able to order ISO7761, maybe they are available in your country too. As I understand it, it should work with UART, because UART only requires one wire in each direction.

Isnā€™t there also a ground loop via the PSU, depending on whether GND at the PSU is referenced to mains earth?
Either the main PSU or (ideally) the 24V to 12V adapter should be isolated.

Unfortunately, none of my go-to suppliers seem to have any of these either here in the UK :frowning:

Forgive my ignorance, but wouldnā€™t this be alleviated by using the usb isolator, or am I misunderstanding? Fortunately, the voltage adapter Iā€™m planning on using - Mean Well RSD-60 60W (not shown in original diagram), provides isolation, so I think Iā€™m good? Nevertheless, if you could explain why it could cause a loop, I would appreciate the opportunity to learn!

The more I look into it, the more it makes sense to use a CAN connection. I think I will bite the bullet now and proceed using the MCP2515 module. Here is my proposed layout:

Are there any example bits of code, similar to the ODriveArduinoTest.ino in the odrive GitHub to get me going for communicating via CAN?

Technically correct - the best kind of correct! But itā€™s never really been a problem as far as I know.

1 Like

Yep! For the Raspberry Pi :smiley: ODrive/can-guide.md at fw-v0.5.3 Ā· odriverobotics/ODrive Ā· GitHub

You did just remind me I need to do one for Arduino.

1 Like

This would be great!