Arduino: GPS serial level shifting

From OnnoWiki
Revision as of 19:02, 14 June 2018 by Onnowpurbo (talk | contribs) (Created page with "I'm not sure what @Chagrin and @santosusana are describing, but it's not a voltage divider. I always recommend real level-shifter modules that use FETs. They're fast, so you...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

I'm not sure what @Chagrin and @santosusana are describing, but it's not a voltage divider.

I always recommend real level-shifter modules that use FETs. They're fast, so you can also use them for SPI interfaces, like an SD card, and they're bi-directional (5V to or from 3.3V). And they're cheap.

Here's how to do it with a few resistors and almost any diode:


Level shift.png


R3 should be 2.2k to 22k.

R1 and R2 should be chosen so that

1) R1 + R2 is 5k to 50k

2) R2 ≈ 2 * R1

For example, R1 = 4.7k and R2 = 10k would work (R1+R2 = 15k, 10k ≈ 2 * 4.7k).

Lots of people claim that you don't really need level-shifting on the TX/RX lines, but it can damage the 3.3V device, and the 5V device may not read the 3.3V logic levels correctly (bad data received).