Author Topic: USB to UART Design (earth referenced)  (Read 682 times)

0 Members and 1 Guest are viewing this topic.

Offline advarkTopic starter

  • Contributor
  • Posts: 36
  • Country: ca
USB to UART Design (earth referenced)
« on: July 17, 2022, 09:19:43 pm »
Hello Everyone,

I'm currently working on a DC Load project. I designed it so it can be autonomous (i.e. logging to its internal memory) but it can also be hooked to a PC for continuously logging data onto a HDD. The MCU is a PIC24HJ128GP510A. My goal is to also the USB ground, which is earth referenced when hooked to a PC. My idea is to use a USB isolator (ADuM3160) and then feed a CY7C64225 to convert the signal to UART. The unit is power by an 18VDC wallpack adapter, so there is no earth reference coming from the unit PSU.

My concern is when the unit is used when not connected to a PC. Then the "earth" ground is now floating since there is no connection between the USB earth and the PSU common (GND). This also means the chassis is no longer "grounded" to earth. Connecting earth to DGND and/or AGND would solve the issue in this case but it will also means the whole device will now be earth referenced when hooked to a PC, which I would like to avoid. Could this be an issue with the DC wallpack: connecting earth to the common wire?

If instead I build an internal PSU (transformer, diode bridge, etc), I could use the unit's power cord ground wire to connect to the chassis and problem solved. But wouldn't that create some kind of ground loop if the unit and the PC are connected to different wall sockets?

Thanks for any insights.

A confused hobbyist  :-\
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13132
Re: USB to UART Design (earth referenced)
« Reply #1 on: July 17, 2022, 10:20:02 pm »
It would make more sense to opto-isolate the serial signals between the USB UART chip and the PIC24.  The USB chip would then be bus powered by the PC host, and would be floating when USB isn't connected.  You may want a 1Meg resistor between USB 0V and PSU common to discharge any static before it can build up enough to cause an ESD event.

Whether or not you then need to ground the case and PSU common depends on the needs of your application.  Mains powered equipment can be designed not to need a ground, but Y-capacitor leakage current from switched mode PSUs can be a significant issue.  However if it can function with USB disconnected, you should NOT rely on the USB shield for ground and should *NEVER* rely on it for a safety ground.
« Last Edit: July 17, 2022, 10:21:48 pm by Ian.M »
 
The following users thanked this post: advark

Offline advarkTopic starter

  • Contributor
  • Posts: 36
  • Country: ca
Re: USB to UART Design (earth referenced)
« Reply #2 on: July 17, 2022, 11:39:25 pm »
Quote
It would make more sense to opto-isolate the serial signals between the USB UART chip and the PIC24.  The USB chip would then be bus powered by the PC host, and would be floating when USB isn't connected.  You may want a 1Meg resistor between USB 0V and PSU common to discharge any static before it can build up enough to cause an ESD event.

OMG! I was so minded of isolating the USB jack that I never thought isolating the USB chip! ESD buildup had never came to mind, though. Thanks for the hint.
 Ian, you're my new best friend  ;)
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: USB to UART Design (earth referenced)
« Reply #3 on: July 18, 2022, 12:22:11 am »
Metal enclosure?  If the load must be isolated, then isolate it from the chassis, and hard ground the chassis.  Fuse the input (both sides) to protect against internal faults to GND.

When I made mine,



I put the control circuit referenced to load negative, and isolated the interface (just serial) and used a small supply inside for isolated DC.  An IEC C13 receptacle provides power and ground, highly overkill but handy enough.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf