How to get power from RS-232 port

11,292

Circuit Image

This text aims to clarify how to extract power from a PC serial port. Many small circuits derive their operating power from the serial port, despite the absence of dedicated power output pins. Examples of such circuits include PC mice and software protection dongles. The method of extracting power involves utilizing signal lines. When developing a circuit that connects solely to a PC, the only usable lines are the output signal lines from the PC serial port: DTR, RTS, and TD. Under normal operating conditions, DTR and RTS are raised, providing a positive voltage output (approximately +12V when not loaded). The TD pin typically remains at a logic high when no data is transmitted, resulting in a negative voltage (-12V when not loaded) most of the time. The voltage at these outputs decreases rapidly as the load current increases because they are designed primarily to drive RS-232 input circuits (with a resistance of 3-7 kΩ). The voltage drops by about 1-2 volts for every 1 mA increase in load current. The short-circuit current flow is usually between 7-10 mA, depending on the specific circuit types used in the PC serial port. A typical PC serial mouse utilizes the DTR and RTS lines to generate +5V power for its microcontroller circuit. Given that an optomechanical mouse also requires power for four LEDs in the optocoupler movement detectors, the available power is limited. Typical power requirements for a PC mouse may be "+15V 4mA -15V 4mA" (as indicated on the bottom of a Microsoft mouse). A common approach to powering the microcontroller involves using diodes to draw current from the DTR and RTS lines, which is then fed through a resistor to the infrared LEDs in the movement detectors. All four infrared LEDs are connected in series, resulting in a total voltage drop of approximately +5V across the LEDs (typical for IR LEDs used in mice). This +5V is sufficient to power a low-power mouse microcontroller. The serial data transmission circuit consists of a simple discrete transistor configuration, designed to minimize power consumption. The positive power supply is usually derived from the RTS and DTR lines (after the diodes and before the resistor leading to the LEDs), while the negative supply for the transmitter is sourced from the TD pin. A typical PC serial port mouse consumes around 10 mA of total current and operates within a voltage range of 6-15V. For further information on PC mouse operation, refer to the PC mouse protocol document. Schematics of functioning PC mouse implementations can be found in "PC Mouse Implementation Using COP800" (AN-681) from National Semiconductor and "Implementing a Simple Serial Mouse Controller using PIC16C5x" (AN519) from Microchip. The following circuit example illustrates how to extract power from an RS-232 serial port, providing regulated +5V power for logic circuits, as well as unregulated positive and negative supplies for the RS-232 transmitting circuit. The circuit outputs only a few milliamperes of power due to the limited availability from the serial port, with resistors R1, R2, and R3 further restricting current. Modern PCs typically feature a 9-pin port instead of the older 25-pin port. To use this circuit with such a PC, two options are available: utilize a 9 to 25 pin adapter or modify the circuit for a 9-pin port. Modifications to the circuit pinout are necessary for this conversion. Current can be slightly increased by omitting the resistors (R1, R2, R3) and replacing them with a short piece of wire. The 78L05 regulator requires 3-4 mA of current continuously and necessitates a minimum voltage drop of 2V; therefore, finding a similar regulator that consumes less current and has a lower voltage drop can yield more current for the circuit. Some small signal input circuits have successfully derived positive and negative supplies for simple operational amplifier circuits using only the DTR and RTS lines.

Many small circuits can effectively utilize the power available from the serial port, which is often overlooked. The design of these circuits must consider the limited current and voltage levels that can be drawn from the DTR and RTS lines. Careful attention to component selection, such as using low-power regulators and optimizing the load on the output lines, can enhance performance. Additionally, the design should ensure that the serial data transmission circuit remains efficient, utilizing discrete components that minimize power consumption while maintaining signal integrity.

For applications requiring additional power, integrating capacitors for energy storage may help stabilize the voltage levels during transient loads. Furthermore, implementing proper filtering and decoupling techniques will ensure that the power supply remains stable and free from noise, which is crucial for sensitive electronic components. The overall design should also consider thermal management, especially if the circuit is expected to operate continuously.

In summary, leveraging the power from a PC serial port involves strategic design choices, including component selection, circuit topology, and load management, to create functional and efficient electronic systems.This text tries to clear out the mystery of how to get power out of PC serial power. There are quite many small circuit which take all their operating power from serial port, where there are no real power output pin. Examples for this type of circuits are PC mouse and software protection dongle. You might wonder how this is possible. There is one way to get some power out of serial port: steal it from signal lines. When you are developing you own circuit which connects only the PC, then the only line which can be used are the output signal lines from PC serial port: DTS, RTS and TD. In normal operation situation DTR and RTS are raised so they give positive voltage output (about +12V when not loaded).

TD pin is in logic 1 when no data is sent which means that it is most time at negative voltage (-12V when not loaded) most of the time. The voltage at these outputs drop quite fast when load current is increase, because they are designed to drive normally only RS-232 input circuits (3-7 kohm resistance).

The voltage drops about 1-2 volts every every 1 mA of load current increase. Usually the short circuit current flow is 7-10 mA (this depends on the circuit types used in PC serial port). PC serial mouse uses typically DRT and RTS lines for generating +5V power for microcontroller circuit in the mouse.

Because typical optomechanical mouse also needs power for 4 leds in the optocoupler movement detectors, there is not much power to waste. Typical PC mouse might can have the following power requirements: "+15V 4mA -15V 4mA" (taken from Microsoft mouse bottom).

A typical approach make the power for microcontroller is to use diodes to take current from DTR and RTS lines and then feed it through resistor to all of the (infrared) leds in the movement detectors. All four (infrared) LEDs are connected in series, which gives about +5V voltage drop over all leds (typical to IR LEDs used in mouse).

This +5V is adequate power for low power mouse microcontroller. The serial data transmitting circuit consists of simple discrete transistor circuit to make it consume as little power as possible. The positive power supply usually taken from RTS and DRT lines (just after the diodes and before the resistor going to LEDs).

The negative supply for transmitter is taken from TD pin. Typical PC serial port mouse takes 10 mA total current and operates at voltage range of 6-15V. For more information about PC mouse operation check my PC mouse protocol document. Some schematics of working PC mouse impelementation can be found from PC Mouse Implementation Using COP800 (AN-681) from National Semiconductor and Implementing a Simple Serial Mouse Controller using PIC16C5x (AN519) from Microchip. The following circuit is an example how to get power from RS-232 serial port. It gives regulated +5V power for logic circuits and also unregulated positive and negative power supplies for RS-232 transmitting circuit.

The circuit gives only few milliampres power output because the power available from serial port is limited (and resistors R1, R2 and R3 limit current more). Modern PCs have typically 9 pin port instead of this older 25 pin port. If you want to use this circuit with such PC you have two options: use a 9 to 25 pin adapter or modify the circuit to 9 pin port.

To do the conversion you have to make the following modifications to the circuit pinout: You can get a little bit more current from the circuit if you leave out the resistors (R1, Rs, R3) and replace them with short piece of wire. 78L05 regulator takes 3-4 mA current all the time and needs at least 2V voltage drop, so if you can find a similar regulator which takes less current and has lower voltage drop, you get more current for your circuit.

One this kind of circuit can be found at. Some small circuits signal input circuit I have seen have taken positive and negative supplies for simple operational amplifier circuit just by using DTR and RTS 🔗 External reference