I have a circuit that converts 5V RS-232 polarity signals (logical 0 = +5V, logical 1 = -5V) to 3.3V TTL polarity (logical 1 = 3.3V, logical 0 = 0V) using a BC548 transistor.
It forms a NOT gate so that when the RS-232 output is high, it pulls the output low and vice-versa.
For reference, the RS-232 device (a GPS receiver) is transmitting at 9600bps and is connected to a Raspberry Pi's UART.
My circuit looks like this:
However, this configuration results in the transistor seeing a voltage of -5V across the base-emitter junction due to the negative voltage of the RS-232 input. The BC548 has a maximum Vbe of -6V, but I'd like to protect the transistor by minimizing any negative voltages across the base-emitter junction.
After some searching I came across a post on the Raspberry Pi forums that suggests the following circuit to protect the transistor from negative voltage:
I've constructed the circuit and it seems to be successful: the lowest Vbe voltage is around -0.5V. My digital multimeter only updates about 5 times per second and I don't have an oscilloscope to see things more clearly, but it previously showed the lowest Vbe voltage at around -5V.
My questions are this:
Why is the diode placed where it is? If I interpret things correctly, it means that the lowest Vbe would be the same as the diode's forward drop and that there would be a current flow from ground through the resistor R1 into the negative voltage RS-232 pin. Would it not make more sense to place the diode between the RS-232 input and R1, or between R1 and the transistor Q1, so as to block any current flow into the pin?
The schematic says to use a 1N4148 high-speed diode, which I have used. Is there any disadvantage to using a 1N4001 instead of a 1N4148? 9600bps means each bit is about 100uS long and the 1N4001 has a typical reverse recovery time of 2uS. The 1N4148 has a typical reverse recovery time of 4nS -- clearly the 1N4148 is faster at switching but does it really make a difference in this context?