I want to add some LEDs after the MAX232 to indicate the serial traffic on one of my design. I found some decent circuit like this but seems like all of them are using two LEDs for TX and RX. Because the premade chassis only has limited LED holes, I wish to use a single LED to denote all serial activities (flashes when TX or RX is busy). Would two diodes from TX and RX in parallel connected to the base of the PNP transistor of the circuit above work? How should I do this properly?
1\$\begingroup\$ I think you want the LED on the TTL-side of the MAX232, rather than the RS-232 side of the MAX232, but am unsure. \$\endgroup\$– glen_geekMay 10, 2021 at 15:12
1\$\begingroup\$ you could use a two color LED or an RGB led \$\endgroup\$– jsotolaMay 10, 2021 at 15:23
\$\begingroup\$ two LEDs on each line are useful. One often wants to know if a particular serial line (TXD, RXD, CTS, RTS, RI etc) is connected to a driver. When nothing is connected, both LEDs are off. When that RS-232 line is driven to mark, one LED is ON - when driven to space, the other LED is ON. This requires monitoring the RS-232 side of the MAX232, not the TTL-side. And it requires a fancier 3-level detector circuit. \$\endgroup\$– glen_geekMay 10, 2021 at 15:47
\$\begingroup\$ @glen_geek Yes that's what I want. \$\endgroup\$– whc2001May 10, 2021 at 17:18
\$\begingroup\$ @jsotola That could also work but requires some component selection. I'll do that as a last resort. \$\endgroup\$– whc2001May 10, 2021 at 17:19
simulate this circuit – Schematic created using CircuitLab
You could do it with ONE transistor + diodes, but transistors are cheap as dirt. A high-efficiency LED might only require R1, R2 of 270 ohms for sufficient brightness.
This circuit has the advantage that if both TX & RX are active at the same time, you get DOUBLE-brightness. But you're not likely to notice this condition by eye.
Base current is small (perhaps 0.1mA) so that the TTL RX, and TTL TX lines are lightly loaded.
\$\begingroup\$ That looks perfect, two transistors is a great idea that I didn't think of yesterday. Thanks! \$\endgroup\$– whc2001May 11, 2021 at 6:44