Electrical – UART LED Driver using MOSFET

ledmosfetuart

I was looking around at some other questions that were asked dealing with how to use an LED to indicate UART activity. One of them provided the image below, however it was stated in the comments that factors such as cable length and baud rate will cause significant signal degradation.
enter image description here

Other questions recommended using a MOSFET to drive the LED instead. I haven't dealt with those before and wanted to confirm some of the specifications before proceeding.

When choosing a MOSFET for this portion of my circuit I came across the BSS138 N-Channel on DigiKey and the specs I don't exactly understand/want to confirm are adequate are:

  • Current – Continuous Drain (Id) @ 25°C: 200mA (Ta)
  • Drive Voltage (Max Rds On, Min Rds On): 2.75V, 5V
  • Vgs(th) (Max) @ Id: 1.5V @ 1mA

These are my own interpretations for the three items:

  • Current: The maximum current that the MOSFET can switch.
  • Vgs(th): The threshold to switch the MOSFET (<1.5V: Off, >1.5V: On).
  • Drive Voltage (Max Rds On, Min Rds On): This is one I just really do not understand.

With that being said would the BSS138 be suitable for the following circuit and not have any major affect on the communications?

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

NFet is wrong. UART idles HI. So your fets are wrong polarity, and led would be lit on idle. (I assume you mean you are doing this at the UART pin (TTL level) not the RS232.)

Just use low current - hi efficiency leds, and forget the driver.

But anyway. Using BJT's it will still work on low voltages.

Note this circuit arrangement has the same component count as using a fet. This also give the minimum base current required at any time compared to the commonly used arrangement (Q5)

schematic

simulate this circuit – Schematic created using CircuitLab

A problem with directly connecting an led, is that brightness depends on data rate, and 1/0 balance of the data. If you only send the occasional char, the LED is not visible. The second version stays on for a fixed time, so you can see a single char.

Note, if you are using FTDI usb-ttl port or similar, they have an LED hole, with this monostable behaviour, so that is a much better point to attach the LEDs

Related Topic