1

I'd like to connect an M8N gps module to an Arduino Uno. From what I understand

  • the Arduino pins 0-RX/1-TX work on 5V
  • the M8N RX/TX work on 3.3v
  • the sensor-TX sending to the Arduino-RX should work (3.3v is “good enough” to drive the Arduino-RX-pin)
  • the Arduino-TX sending to the sensor-RX is problematic because of the 5v (could break the sensor)
  • During USB-programming, the Arduino-RX sensor can be at 5v (so suddenly the current flows in the "wrong direction"- which could break the sensor)
  • A level-converter could be used to “translate” the voltages in each direction.

Assuming we don’t use a level-convertor

  • Could we use a schottky-diode (which as I understand blocks current in 1 direction) to block the 5V from the ArduinoRX going into the sensor?
  • But then the 3.3V from the sensor-TX would pass (correct direction ), but the diode will drop the voltage "a bit more"… is this still enough to drive the arduino RX-pin?

  • And it works, why not also use a schottky-diode to also protect the Arduino-TX to sensor-RX connection ( just to be safe, since some people were saying one some Arduino they needed to connect RX-RX and TX-TX to get the communication to work.. ? ).

As an alternative to the schottky ( or maybe in addition to it) - Could we simply take 2 voltage dividers (for one for both RX-TX and TX-RX) ?

We can use a “resistive voltage divider” to lower the Arduino-TX 5v to 3.3 V - I understand to get from 5V to 3.3V we need “x” and “2 * x” resistors-values, so e.g 1K Ohm and 2K Ohm… but how do I know which values would be appropriate ( I mean, we could also take 10K Ohm and 20K Ohm, would also lead to 5V to 3.3v) but at a different current (Amps)… ?

Please be patient, electronics-beginner here trying to make sense of this…

2 Answers 2

1

Buy some of these, it's a simple hardware solution to your problem then.

https://www.amazon.co.uk/gp/product/B0148BLZGE/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1

I know you said you don't want to use a level converter but it's the simplest way around the problem. You stated that you're an electronics beginner AS AM I, which is exactly why when I came up against the same problem i just spent the money. It was only £3.99 for 5 of them and as far as I'm aware you should be able to buy single ones off amazon too, haven't searched but i'd have thought you'd be able to.

Or if you need to do it with resistors you can use this calculator here

http://www.ohmslawcalculator.com/voltage-divider-calculator

2
  • I actually already purchased those as that's surely the safest solution for starters. But in the process of figuring out the "magic component needed" the above questions arose. For the voltage divider, try your link enter 5v, 100Ohm, 200Ohm -> 3.3v... But if you enter 5v 1000Ohm, 2000Ohm you also have 3.3v... so there must be something "missing"... And the other part which worries me is the occasional 5v on the RX pin.
    – kalmiya
    Jul 1, 2017 at 19:50
  • In the Arduino forums related to 5v to 3.3v we have this link here, forum.arduino.cc/index.php?topic=16846.0 someone uses 1K8 and 3K3, but here forum.arduino.cc/index.php?topic=22570.0 someone suggests using 270R and 470R and either of those end up close to 3.3... So what's the difference (it must be sth with current)... or could we just as well use 10M and 20M resistors and it really doesn't matter?
    – kalmiya
    Jul 1, 2017 at 20:06
1

You can use something along the lines of this:

schematic

simulate this circuit – Schematic created using CircuitLab

When the 5V Rx is driven to 5V D1 protects the 3.3V Tx pin.
When the 5V Rx is driven to 0V R1 protects the 3.3V Tx pin from excessive current draw.

When the 5V Tx is driven to 5V D2 protects the 3.3V Rx pin and R2 pulls the pin to 3.3V.
When the 5V Tx is driven to 0V D2 pulls the 3.3V Rx pin to ~0.2 V

Resistor values are rough guidelines, lower values will put more strain on the parts and increase power draw but will also increase the maximum UART speed that will work reliably.

2
  • How can it be that RX is driven ... ? It's an 'R' port and as I suggest it stands for Receive. So wouldn't it be that the TX 3v3 port is driving the RX 5V so the RX 5V needs a pull-up? The whole thing does not make any sense this way (for me).
    – Hannes
    Nov 18, 2022 at 11:40
  • UART Rx ports idle high. This means there is a high probability the Rx pin will contain pullup to 5V. So not actively driven but a passive low strength pull to an excessive voltage. The protection diodes internal to the 3.3V part could probably cope with that, especially if there is a series resistor, but this reduces the strain on the 3.3v part.
    – Andrew
    Mar 22 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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