Picture of The Raspberry Pi - Arduino Connection
The Pi is a fine little computer board, though not nearly as good as
the Arduino when it comes to I/O capabilities. The beautifully-engineered
Gertboard is a plug-in add-on that neatly overcomes this deficiency
by giving the Pi access to an ATMega328, but it's a very complex and
expensive solution. An alternative would be to interface an Arduino
running at 3.3 volts to the Pi, though this is easier said than done.
But, we won't let that stop us, will we?

You can buy a prebuilt  commercial version
of something similar to this project.
It's called an AlaMode, and it goes for something like $50.
Our version will cost about a third of that to build.

As a first step, we will build an Arduino plug-in board for the Pi.
It is customary to call Pi boards "plates," but indulge me and permit
me to name this particular board a hoody. Thank you.

We will be using generic stripboard to build our project. Small (3-3/4"
x 2-1/16") boards can be obtained on eBay for a bit over a dollar apiece.
It is also possible to use something like a Radio Shack 276-168 protoboard
($3.49). The main component, though, is an 3.3-volt Arduino Pro Mini.
This will permit connecting directly to the Raspberry Pi ports and other
3.3-volt devices without having to do level shifting.

Quite a number of Pi projects involve connecting sensors and devices
directly to the GPIO pins. This is not a good idea. Use buffer chips,
such as the 74HC4050 hex buffer, between the devices and the GPIO.
This protects the Pi from overvoltages, current surges, and your mistakes.
Far better to blow out a fifty-cent buffer chip than a $35 Pi.

This particular project connects directly to the GPIO Rx and Tx pins.
However, we are connecting to a 3.3 volt device, which limits the risk.
Still, a buffer chip would not be a bad thing here.

This is a moderately complex project, and beginners need not apply.
It requires skill at soldering and in the use of hand tools. Experience
with a continuity tester and a steady hand with a knife blade are also

Ready? Well, then, let's get on with it!

macpe1 year ago

To get it working on Raspbian you need to stop /dev/ttyAMA0 from working as a serial console since that will screw things up. See the following link for how to do this:


Thank you so much. I'm trying to send data from Arduino to OpenHAB and my heart sunk when I saw this Instructable wasn't for Raspbian. Thanks!

thegrendel (author)  macpe1 year ago

Yes, and thank you for the fix.

Most Pi users do install Raspian, so this info is very helpful.

thegrendel (author) 2 years ago
Rather than a stacking header that plugs the board directly
on top of the Pi, some of you might prefer to use a shrouded
box-type header and connect to the Pi with a 26-pin standard cable.
This takes up more workspace, but gives extra flexibility.

And hey, folks, how about some ideas and suggested improvements?
Or maybe someone would like to produce an etched PC board.
thegrendel (author)  thegrendel2 years ago
Another alternative:

Use a stacking header as described in the Instructable,
and get a female-to-male 26-pin cable to give the option
of using the interface board off the Pi.
Orngrimm2 years ago
since i love Arduino's and also have a Pi which i kinda hate since i dont have the loved I/O-o-rama i know from Arduino, thats the perfect 'ible for me!

2x voted! :)
thegrendel (author)  Orngrimm2 years ago
Thank you for the praise, Orn.

As you've noted, the Pi lacks analog IO, which an attached
Arduino can provide. The other great shortcoming of the PI
is the fragile non-replaceable SOC/CPU, which requires much
care when directly connecting to the GPIO pins. A cheap Arduino
board, or even an ATMega 328 jig, running at 3.3 v makes a perfect
buss buffer.
Thank you for this information. I'm looking this for my final year project. I want to build a home automation system using raspberry pi and also arduino. Thank you sir. You inspiring me
thegrendel (author)  jessicalim2510 days ago
Thank you for the praise.
Best of luck with your project, and note that the Pi takes 3.3 v inputs, NOT 5v.
KronoNaut2 months ago

Thank you for this. I have been thinking about reading the analog data from my 1973 Super Beetle and displaying it, this may allow me to start on a project to do so.

BrianM155 months ago

What if I need to send more than a single byte? I have coordinates x,y with values ranging from 0 to 255 in the raspberry pi. For example: 178, 243.

How would I send this to the arduino and how would the arduino receive it so that it can be stored in two different variables (x and y)?

thegrendel (author)  BrianM155 months ago
Send them as consecutive bytes, and let your software handle concatenating the values.
Kamilon1 year ago

If you want to use a 5v Arduino to do the same thing (or any other microcontroller) take a look at my logic level converter solutions here:


one question please. My arduino pro mini is externally sourced by a 12v font in order to drive a rgb led strip. In this case,can i only connect the raspberry and arduino rx tx pins? So I can control led strip from a Java programa running on pi.

thegrendel (author)  Jose Inacio1 year ago
Make absolutely certain that the Arduino's rx and tx signals are at 3.3 volts. More than that will damage the Pi.
Robo-T1 year ago

At first I was very interested in the Raspberry Pi, but found what I was really looking for was the Arduino. I have both and like getting them to work together. Recently, Intel has come out with the Galileo. It seems that the Galileo is similar to what you did combining the Pi with Arduino. Would you see it that way? Or is there a big difference. With a Galileo, due, and every other board coming out which way will it all go?

Thx for the write up. We will be doing some integration with your article as a basis.

thegrendel (author)  Robo-T1 year ago
Yes, the Intel Galileo is interesting, but it is a bit more expensive than the Pi, has less community support, and lacks documentation at present. Note that I don't possess one, and base this judgment solely on what I've read about it.

Hooking an Arduino or Hackduino to the Pi has the one big advantage that the Pi itself is not exposed to overvoltages or excess current. If you blow up a '328 chip, you can replace it for $3 or so, not a big deal, whereas if you blow up the Pi it's a bit more serious.

Thank you for your perceptive comments.
xXYEIROXx1 year ago
I have a question. If I just get a usb board like an UNO or Mega, can I just plug the Arduino in the RPi's usb port?
thegrendel (author)  xXYEIROXx1 year ago
Yes, if . . .

1) You're using a USB hub with the Pi and have a spare port on it.

2) You've installed the Arduino IDE software package on the Pi.

With both of the above in place, you can program sketches for the Arduino and upload them to it. But, other communication between
the PI and Arduino over the USB buss is quite another matter.
Much easier is using the serial ports.
nerd74731 year ago
do you have the arduino IDE on the raspberry pi? If not enter the following

sudo apt-get install arduino

it will be typed into the terminal and then download after you hit enter. I may make an instructable on how to install it and some other stuff about it too!
thegrendel (author)  nerd74731 year ago
Yes, thank you, I have that installed.

I think your idea about an instructable is interesting,
but you may want to consider expanding the scope of it.
How about doing an instructable on installing software
packages on the Pi? And maybe also about installing
different Linux distros? You'll do an excellent job at
this, I'm sure, and many Pi users will benefit.

Thanks for your comment.
I may do a separate one for Linux distros or maybe even xbmc
hey thegrendel I published it you can feel free to take a look!
so I should make an instructable about how to install arduino IDE on wheezy
Ok I will make one over that it is a very good idea
diy_bloke2 years ago
as a socket you can also use 2 14-pin dil sockets
thegrendel (author)  diy_bloke2 years ago
"There are nine and sixty ways of constructing tribal lays,
And every single one of them is right!"

-- Ruddy Kipling