2

How to connect the 3.3 V Raspberry Pi UART logic level to the 5 volt RS232 C logic level?

  • This is not a Pi specific question. – joan Jun 16 at 9:10
  • 1
    Use RS232 drivers. These used to be quite common (30 years ago) – Milliways Jun 16 at 10:03
3

Whilst this is more of a general electrical engineering question, rather than a RPi question, logic level conversion is a commonly encountered issue when using an RPi.

+3V3 to RS-232

As Milliways correctly points out RS232 uses positive and negative signal levels, ±3-15 V, see Wikipedia: RS-232 - Voltage Levels and the data is inverted:

Logic zero is signaled with a positive voltage and the signal condition is termed "space". Control signals have the opposite polarity:

Regarding conversion from 3V3 logic levels, from Re: RS-232 RTS voltage levels?

Do yourself a favour, use a MAX3232 to translate the Pi's 3v3 signal levels to RS232 levels.

or as Milliways points out in their comment, just use RS232 drivers, such as 75LV4737, which works with both 3 V and 5 V supplies/logic levels.


+3V3 to +5V conversion

As an aside, and on an unrelated note, for 3V3 to 5V conversion, look up Bi-directional Logic Level Shifters, such as TXB0104 (for light loads, i.e. between ICs). For higher loads, use the 74LVX245 but these are uni-directional only. There are many other examples. SparkFun and Adafruit have these available with them mounted on breakout boards.

However, you might want to use some FETs with 10 kΩ pullup resistors for RS232. These are also useful for other high loads such as LEDs, load leads, high capacitance lines or I2C (due to the strong pull-ups used by I2C, which confuse auto-direction sensor of the TXB0104/TXB0108 - if you use a TXB0104/TXB0108 and need pull-ups then use 50 kΩ or greater).

If you use a TXB0104/TXB0108 and need pull-ups then use 50 kΩ or greater.

  • This ignores the issue that logic levels of RS232 are inverted, not to mention the possible negative voltage (admittedly uncommon on most modern pseudo RS232 interfaces). When I last built one they used ±12V – Milliways Jun 16 at 10:58
  • Ah! Very good point about the inversion and the negative voltages... It's been years since I used RS232 and I'd forgotten that. However, there is a wide range of voltages ±3-15 V, see Voltage levels, so ±5 could be acceptable. Regardless, I'll update my [unacceptable] answer. Thanks for pointing it out. – Greenonline Jun 16 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.