5v to 3v logic level with voltage divider

Hi all,

I have an official arduino uno and a cheap china made arduino zero copy (I say copy because it is zero like, but not an exact clone), and I’m wanting to hook them together using SPI to communicate. There are 2 reasons why I am doing this, first, to verify that SPI is working on both boards, and second, to increase my knowledge.

Since the uno is 5v logic and the zero is 3.3v logic, and I don’t have any logic level converters handy, I decided to use a voltage divider to accomplish the job of converting the logic levels. I know this is a one way street, it will only convert 5v to 3v, and not the other way around. My plan is to use the 5v uno as a master and the 3v zero as a slave and see if I can send data from the uno to the zero.

So late last night, with a couple of beers, some resistors, a perf board and a hot soldering iron, I went to work. I’ve seen examples of this on the internet, and I didn’t really follow any specific schematic. Today, using an ohmmeter I’m checking the circuit and I wasn’t sure the values I was getting were what should be expected.

Creating a schematic for posting here, I realize the values I was getting on the ohmmeter were correct. Now I’m just wondering if the circuit will work and figured I would ask questions before plugging in wires and frying something…

It appears I cannot add an image to this post from my computer, so I am attaching a .png file of my schematic.

I welcome all advice and thank you,

You have three lines which are 5V outputs of the master and 3.3V inputs of the slave - CS, CLK and MOSI. So you need one more divider setup. Coming back the other way, there is only the MISO line. The 5V master will almost certainly read 3.3V on its MISO pin as a high, so you can just directly connect that line without any resistors, and you will be able to send data in both directions.

You just need to be sure the pin used for MISO on the master is always an input pin, never an output. But to be extra safe, you might put one of those 2.2K resistors in series in the MISO line. It should still work fine that way, and if the MISO pin on the master ever did inadvertently output 5V, the resistor would limit current and help prevent any damage to the slave.

You also need to connect the two grounds.