Shop OBEX P1 Docs P2 Docs Learn Events
Serial Programming Circuit RX/TX LEDs — Parallax Forums

Serial Programming Circuit RX/TX LEDs

bfesserbfesser Posts: 2
edited 2013-01-18 18:16 in BASIC Stamp
I have a BS2 Rev. F, and have constructed a circuit as shown in the manual to program the unit via a RS-232 PC connection. It works well, but I'd like a visual cue for the RX/TX lines. How could I add LEDs, so that they blink in response to data transmission on these lines? I've tried line---resistor---LED---ground, but it's very dim. Could it be done with a transistor to amplify the pulses? If so, where could the current be drawn from to drive the LEDs? Any advice would be greatly appreciated.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-01-17 20:40
    You should be able to take enough current from the RX and TX lines to adequately light an LED. You need to use a high brightness LED and an appropriate resistor value. 2.7K would provide about 2mA given that most PC RS232 ports use something like a MAX232 and those provide something like 7V so the resistor would have to drop a little over 5V. If they use something like a MAX3232, that only produces about 5.4V and the resistor will have to drop about 4V. You might need 2K for adequate current in that case. Use a voltmeter to measure the voltage on RX and TX relative to ground.
  • wes3066wes3066 Posts: 6
    edited 2013-01-17 21:48
    could you use two transistors as buffers and have the bases tapped into the RX/TX lines or is that a bit much over kill?
  • bfesserbfesser Posts: 2
    edited 2013-01-18 09:34
    Thanks for your replies. Sorry, I normally do as much research as I can, and try not to ask for spoon feeding, but I'm a little stumped by this.

    I don't know what a MAX232 is, but from the context I gather it might be an IC? I use an Edgeport/C from Inside Out Networks™ (purchased from Ax-Man Surplus on University Ave. some years ago), and I just unscrewed the cover to find a chip next to each DE-9 connector marked MAX211C. I found the datasheet at http://www.ti.com/lit/ds/symlink/max211.pdf , and from my (limited) understandding of it, the output voltage could be anywhere the range -30V to +30V. Unfortunately, my multimeter has been horribly unreliable lately (RadioShack Digital Multimeter POS... can't figure out how to recalibrate it), so I don't trust it. However, I read a sustained potential of -8.76V between TX and GND after powering the BS2 with 9V and sending a "Hello World" program to it from the editor.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    DEBUG "Hello, World!"
    
    The potential reading drops to 0V when the Debug Terminal window is closed. Similarly, I read -4.68V between RX and GND.

    I'm unfamiliar with 'high brightness' LEDs. Could you give an example of a suitable LED for this application? I really appreciate your assistance with this. Thank you very much.
    wes3066 wrote: »
    could you use two transistors as buffers and have the bases tapped into the RX/TX lines or is that a bit much over kill?
    This is what I was hoping to do, but where do I draw the current from to drive the LEDs?
  • Mike GreenMike Green Posts: 23,101
    edited 2013-01-18 10:43
    MAX232 refers to a series of ICs made originally by Maxim, but now made by many manufacturers, that converts signals between RS232 and logic voltages (like 5V or 3.3V) and provides protection against static discharges. The MAX211C is a variation of this. Typically, any of the MAX232 variants that are powered by 5V produce RS232 signals on the order of 7-9V. Red LEDs usually require a voltage of around 1.4-1.7V, so you'd need a series resistor to drop the rest (7-9V - 1.7V = 5.3-7.3V). A typical amount of current for a high-brightness LED would be 2-5mA. Ohm's Law gives R = E (voltage) / I (current) = 5.3-7.3V / 2-5mA = roughly 2.7K.

    A typical red high brightness LED would be this from RadioShack.
  • bluejaybluejay Posts: 131
    edited 2013-01-18 18:16
    bfesser wrote: »
    I have a BS2 Rev. F, and have constructed a circuit as shown in the manual to program the unit via a RS-232 PC connection. It works well, but I'd like a visual cue for the RX/TX lines. How could I add LEDs, so that they blink in response to data transmission on these lines? I've tried line---resistor---LED---ground, but it's very dim. Could it be done with a transistor to amplify the pulses? If so, where could the current be drawn from to drive the LEDs? Any advice would be greatly appreciated.
    How about an OP-Amp such as this.
Sign In or Register to comment.