Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: UART and Optosoloators

  1. #1
    Junior Member
    Join Date
    Jun 2020
    Posts
    18

    UART and Optosoloators

    Hey

    I'm putting the final touches on a MIDI controller and I have added provisions for powering another Teensy and having it communicate via UART.

    Currently I've just got 4 pins

    - 5v out from VIN to provide Power to another t4.0 via its vin pin
    - GND
    - RX
    - TX

    Question 1 - Should I have protection or isolation from the VIN pin?
    Question 2 - should RX and TX be optoisolated to prevent against reversed polarity or over voltage coming back to damage the UART RX and TX? (6N138 maybe)

    Thanks

    Click image for larger version. 

Name:	m7eQdFw.png 
Views:	21 
Size:	38.3 KB 
ID:	21447

  2. #2
    Senior Member
    Join Date
    Aug 2019
    Location
    Melbourne Australia
    Posts
    163
    One possible gotcha is if some coding error causes the pins at either end of a direct connection to be configured as outputs and one happens to be high and the other low will possibly fry both boards. An insurance policy is to insert some current limit like so.

    TX>--->resistor>-----RX
    Rx<--- <resistor<----TX

    A 1K resistor limits current to 3.3 Ma in a worst case scenario and as a bonus, absorbs overshoot and ground bounce.

    Be mindful of potential ground loops.

  3. #3
    Junior Member
    Join Date
    Jun 2020
    Posts
    18
    thanks mate,

    in regards to the ground loop, would this be a consideration if there only 1 DC supply being used? with the VIN pin connecting to the VIN of the slave to power 5v and the gnd of both boards being connected?

  4. #4
    Senior Member
    Join Date
    Aug 2019
    Location
    Melbourne Australia
    Posts
    163
    I wired a Mega to a T2 and fed the T2 from the Mega's +5v. The T2's 0v, Thick and short soldered directly to a sensible looking common 0v point on the back of the Mega. Noisy Led displays 0v line was thick and direct to same common 0v point. T2's TX and Rx via 470R to Mega RX and TX3. Still works.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •