I'd like to connect my Raspberry Pi and my Arduino Uno with SPI. I saw a solution here, but sy wrote at the end that this is wrong, because Raspberry Pi transmitting/recieving 3,3V on the pins and Arduino on 5V.
So I made up my mind to solve this. This is what I have in mind:
schematic
simulate this circuit – Schematic created using CircuitLab
Is it OK?
UPDATE 1:
Here I read that Arduino input pins are high-impedence inputs, they draw about 1uA current. Also logical HIGH is above 2V (to be sure 2,7V). And 3,3V is above it. So a simple cable from a Raspberry output to Arduino input is suitable.
Here I read that "never source or sink more than 0.5 mA into an input pin" (on Raspberry Pi). So R=5V/0.5mA = 10K resistors is needed in the voltage divider.
-
Hi! Are those buffers separate entities or part of the Pi/Arduino?Ghanima– Ghanima ♦2015年12月17日 20:21:32 +00:00Commented Dec 17, 2015 at 20:21
-
Hi! I used those buffer symbols as input/output symbols.adtewa– adtewa2015年12月17日 20:24:13 +00:00Commented Dec 17, 2015 at 20:24
-
1You might also consider a logic level shifter such as: learn.sparkfun.com/tutorials/…Kolban– Kolban2015年12月19日 10:38:44 +00:00Commented Dec 19, 2015 at 10:38
1 Answer 1
That may be way over the top for what you need.
The Pi only acts as the SPI master which means that slave select (CEx), clock (SCLK), and MOSI are outputs from the Pi and inputs to the Arduino. You probably don't need any conditioning on those signals. You can connect pin to pin (with a series resistor if you are of a nervous or careless disposition).
The Arduino output line will be 5V and is not safe to feed into the Pi's 3V3 MISO GPIO. For that line a voltage divider (e.g. a simple resistor divider) is all that is needed to cut the 5V to 3V3.