Electronic – arduino – Connecting microcontrollers via GPIO

arduinogpio

This is probably a basic question for most people on here but I'm new to electronics and tend to learn by example, so figured this was a good one to ask!

I've got a board called a Nano Pi Neo Plus 2 that is very similar to a Raspberry Pi, just with a smaller form factor and cheaper – think of it as a Chinese knockoff 😉

I've also got an Arduino Nano.

I want to send boolean values from the Nano Pi to the Arduino Nano, and after researching different communication protocols I decided to use simple GPIO and turn them on and off to represent boolean true/false.

All good so far – I found some rough examples on the Internet and connected everything up. Unfortunately I've already blown up a couple of Arduino Nanos in the process!

This is where my electronics knowledge is very limited. I'm not sure if I need resistors on the GPIO pins (I presume I do to stop it blowing up) but I don't know if they should be pull up, pull down and what values (no idea how to calculate them).

I'm powering both boards using a single 5V power supply. I've measured the voltage on Nano Pi GPIO pins and the voltage drop was ~3.3v.

Could someone walk me through what's wrong with the circuit and the steps you'd take to work out the resistor configuration and values?

This is the breadboard layout I'm currently using. I couldn't find a Nano Pi part in Fritzing so I used a Raspberry Pi to show how it connects together.

Current layout

Here's the Fritzing breadboard layout if that helps

Best Answer

As mention in the comment a schematic would help. Besides that: As soon as I read 'Arduino' and 'Pi' in the same question all my hair starts standing up because they use different I/O voltages. The Pis are 3.3 Volts the Arduinos are 5Volt. I am most surprised that your Pi did not blow up.
In general it does not hurt to connect controllers using resistors. The input impedance of a controller is very high thus adding a 2.2K resistor will not matter during operation. But it does protect your controllers if you have two outputs connected.
Coming back to the voltage difference: You can safely connect an output from the Pi to an input on your Arduino but as mention, adding a series resistor is a safety precaution.
The other way around you have to reduce the voltage. Simplest and cheapest is to use two resistor as voltage divider. You have to go from 5V to 3.3V which is a reduction of 0.66. I would recommend 1200 Ohm plus 2200 Ohm.

schematic

simulate this circuit – Schematic created using CircuitLab