AlexGrizo
Posts: 2
Joined: Sun Oct 07, 2012 1:22 pm
Location: Russian Federation

Arduino Rx always HIGH

Sun Oct 07, 2012 3:16 pm

Hi all. I'm trying to connect my RPi to Arduino board via UART pins. After reading several articles, I found that the best way would be to use MOSFET for level convertion, but because I don't have them right now, I decided to temporarely use a simple voltage divider. It must be connected to a line Arduino Tx -> RPi Rx. Seems that RPi Tx -> Arduino Rx line does not need level converting, because Arduino understands 3.3v signal well. But in this article I came across this:
It turns out that the RX pin on the Arduino is held at 5V even when that pin is not initialized. I suspect it is due to the fact that the Arduino is programmed via these same pins every time you flash it from Arduino IDE, and there are external (weak) pullups to keep the lines to 5V at other times. So the method described below may be risky – I suggest either add a resistor in series to the RX pin, or use a proper level converter (see my other post on how to accomplish that). And if you do try the method below, never connect the Pi before you have already flashed the program, otherwise you may end up with a damaged Pi!!!
Used my multimeter to check this - seems that it is correct. :|

This article and some others across the Internet, however, says that straight connection RPi Tx to Arduino Rx is ok. Who to believe? :) I am afraid to brick my RPi, so I want everything first well planned.

Voltage dividers are obviously unidirectional (unlike MOSFET). And if the signal goes in the opposite direction, it stays the same as on the input? That is, if I put a second voltage divider on the line RPi Tx -> Arduino Rx, it will not affect the levels, but theoretically could protect RPi from 5V on Arduino Rx pin, am I right?

User avatar
Grumpy Mike
Posts: 1005
Joined: Sat Sep 10, 2011 7:49 pm
Location: English Lake District

Re: Arduino Rx always HIGH

Sun Oct 07, 2012 6:44 pm

The arduino RX pin is high because the output from the USB / serial chip is high when it is not receiving anything. This is connected to the arduino pin through a 1K resistor so that any direct connection to that pin can pull the pin to ground.
So to stop this happening you can disconnect this resistor or put a switch in it.

If you leave it then the 5V is applied to the Pi through a 1K resistor. What happens is that the Pi's GPIO pin shorts the connection to the 3V3 rail through the internal diodes. These are not designed to take any current and there is no specification in the data sheet to advise what is a safe level.
The current that will flow is:-
( 5 - (3.3 +0.7) ) / 1000 = 1mA
As that is the limit for the robust Arduino chip's diodes I would be surprised if it were safe for the much more delicate Pi. It might not fry it immediately but it will probably cause some damage that would be cumulative. So you might not notice immediately but it could fail in a few months.

A much better solution is to simply put a 3V3 zener diode across the Pi's input pin. That way the excess current goes down the zener and any zener will be able to take 1mA.

AlexGrizo
Posts: 2
Joined: Sun Oct 07, 2012 1:22 pm
Location: Russian Federation

Re: Arduino Rx always HIGH

Mon Oct 08, 2012 8:13 pm

Thanks for advice. :)

Return to “Interfacing (DSI, CSI, I2C, etc.)”