Connect with us

Can I connect an LED to an RS232 port?

Discussion in 'Electronic Basics' started by [email protected], Aug 14, 2006.

Scroll to continue with content
  1. Guest


    I'd like to turn an LED on and off by controlling the CD (carrier
    detect) line of an RS232 port. I understand that the RS232 port runs at
    +15volts. If I calculate the current draw for the LED and put an
    appropriate resistor in series will I have a good solution?

    Or, do I need some sort of voltage regulator in line?

    My goal is to also put an opticaldetector on another RS232 port so I
    can send a signal between two computers on two different networks (that
    can not be connected any other way).

    Thank you!
  2. Eeyore

    Eeyore Guest

    I don't know how much current it can supply but it should be able to light a
    *high efficiency - low current * led ok.

    You'll need a series current limiting resistor and maybe a series diode too.
    Some 'RS-232' ports actually run off only 5V or maybe even 3V btw particularly
    on small battery operated kit, so be aware of that.

  3. Tim Auton

    Tim Auton Guest

    An LED on a serial port works fine. RS232 is specified to drive an
    impedance >3k ohm, so use a resistor of at least 3k ohm to avoid
    overloading the port. Also, be aware that signalling is +/- 15V, not
    +15V/0V (actually you usually get a bit less than +/-15V, sometimes as
    low as +/-5V). The -15V could result in excessive reverse voltage across
    your LED, which could make it go pop. Add a second diode in parallel
    with your LED with opposite polarity to protect against this. Any diode
    is fine; a 1N4148 will do nicely. The second diode can be a different
    coloured LED, which would let you switch between two colours rather than
    just on and off. Finally, be aware that logic levels are reversed from
    the norm on RS232 ports - a logic 1 is a negative voltage, logic 0 a
    positive voltage.

  4. Mark Fortune

    Mark Fortune Guest

    I second that, i've done it with a bog standard LED and a 5k resistor
    connected between the signal ground and the pin(s) in question.

  5. Eeyore

    Eeyore Guest

    Good idea. That'll make for less volts drop so it would even work on a
    non-standard 3.3/0V implementation ( they do exist )

  6. Don McKenzie

    Don McKenzie Guest

    30 years ago when I was designing RS-232 break out boxes on transistor
    driven +/-12/15V signals, I always used a 1 K resistor and two LED's
    back to back to do the monitoring.

    Today, just use a tri-color LED and a resistor, much the same.
    As modern LED's are of greater intensity, and voltage swing could be a
    lot less, I'm sure the resistor value of 3 to 5K would be more suitable.


    Don McKenzie
    E-Mail Contact Page:

    Micro,TTL,USB to 1.5" color LCD
    USB,RS232 or TTL to VGA Monitor
    World's smallest USB 2 TTL Conv
  7. jasen

    jasen Guest

    it works here, I measure closer to 12V on the wires.

    I used a 3.3K resistor so as not to load the line too much.
    LED's are oftem rated for only 5V in te reverse direction but I've not had
    any fail with only a series resistor
    The CD line is an input on your serial port, outputs are TD, RTS, DTR

    Ethernet ports have thousands of volts of isolation.
    wi-fi is another off-the-shelf solution.

  8. Guest


    THANK YOU ALL very much for all your help and advice.

    I've selected some LEDs to try from Digi-Key. I also selected a
    phototransistor to use on the detector side. I'm hoping that the
    phototransistor is sensitive enough for the red LED to trigger it. It
    is really designed for IR, but the sensitivity versus wavelength graph
    shows what I believe to be sufficient sensitivity.

    I REALLY REALLY appreciate all the advice. It has helped a me a lot!

    If you're interested, the parts I've selected to test are:

    Manufacturer Part Number Description Digi-Key Page Digi-Key Part
    Sunbrite SSP-LXC128624 Poly LED Super Red 32.50 mm 1823 441-1067-ND
    Sunbrite SSP-LXC1282S24 Poly LED Super Green 32.50 mm 1823 441-1065-ND
    Lumex SSL-LX5093SRC/E High Brightness LED T-1 5mm Super
    Red 1814 67-1612-ND
    Lumex SSL-LX5093SOC High Brightness LED T-1 5mm Super
    Orange 1814 67-1113-ND
    Lumex SSL-LX5093SYC High Brightness LED T-1 5mm Super
    Yellow 1814 67-1115-ND
    Avago HLMP-CB15-R0000 LED 5MM 470NM BLUE WATER CLEAR 1858 516-1360-ND
    Avago HLMP-CW16-R0000 LED 5MM WHITE WTR CLR W/STANDOFF 516-1392-ND
    Avago HLMP-EG08-Y2000 LED 5MM 635NM RED WATER CLEAR 516-1377-ND
    Optek OP295B LED IR 5MM 890NM PLASTIC 1767 365-1062-ND

    Sharp PT-550F Photo Transistor 425-1021-5-ND

  9. Why aren't you looking at optoisolators, which put the LED and the photodiode
    or phototransistor in one package, ensuring no external light and making
    a perfect match?

  10. Guest

    The two systems must be a specific distance apart for security reasons.
    An optoisolator would only yield a few millimeters of separation. An
    optoisolator would be the perfect solution if it weren't for the
    security requirements.

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day