15

I have been trying with no luck to get the Raspberry Pi talking to an Arduino. I am using a 3.3 V-to-5 V converter to swap voltages. I did put an LED on the UART TX pin, and it looks like it was inverting the data. If this is true, what circuit do I need to get it communicating with the Arduino?

I am using a Cool Components Logic Level Converter. It is a transistor for 3.3 V to 5 V and resistor for 5 V to 3.3 V.

Peter Mortensen
2,0042 gold badges15 silver badges18 bronze badges
asked Jun 20, 2012 at 11:59
0

5 Answers 5

5

The GPIO of the Raspberry Pi are 3.3 V and they are not 5 V tolerant; this means if you drive 5 V to them, you may break the input. http://elinux.org/RPi_Low-level_peripherals has the information about the pins.

You can use one of these boards:

http://store.nkcelectronics.com/5v-to-33v-logic-level-shifter-bo.html

Or just buy a 74LS245 from Digi-Key or Mouser Electronics and connect it like this:

Low cost 5 V to 3.3 V converter

Peter Mortensen
2,0042 gold badges15 silver badges18 bronze badges
answered Jun 20, 2012 at 12:31
3

You can also use a single n-channel enhancement MOSFET for each pin if you have a few of those around. See the post Raspberry Pi and I2C devices of different voltage , or page 43 in the I2C bus specification. Since you only need two pins, this might just do the trick for you.

Peter Mortensen
2,0042 gold badges15 silver badges18 bronze badges
answered Jun 21, 2012 at 18:26
1
2

I'm using a CD4050 to do the level conversion from 5V to 3.3V and also to act as a buffer to protect my Raspberry Pi. The Arduino should see 3.3V as a logical high, so you shouldn't need to convert from 3.3V to 5V (I stand corrected here, according to the Arduino webpage any voltage over 3V is considered logical high).

I put together a quick example of using the CD4050, Raspberry Pi GPIO UART and Arduino here: http://www.andremiller.net/content/raspberry-pi-and-arduino-via-gpio-uart

Any comments are welcome, it's working, but I might have done it wrong :)

answered Jul 10, 2012 at 19:26
1

I actually have run across the same issue and have resolved it by running a barebones atmega328 with an Arduino bootloader at 3.3 volts, but at 8 MHz. The 8 Mhz may cause a problem if you have strict timing requirements. I, myself am only planning on using the Arduino to generate PWM for an rgb led strip, so it's ok if the frequency of the pwm is half of normal. My preliminary testing so far has indicated that the Arduino can receive the message just fine.

answered Jan 23, 2013 at 1:10
1

There is one simple solution you can remove any external power source of Arduino and connect Raspberry Pi's GPIO pin 1 to 5v pin of Arduino using jumper wire that way Arduino main power will be 3.3v and all its pins will have 3.3v instead of 5v. Now you can directly connect Uart pins of Pi and Arduino. Worked for me.

answered Apr 14, 2017 at 15:34

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.