Interfacing 5V and 3.3V Microcontrollers

I have 2 off 5V Nano's. On the first Nano I set a digital pin high and low intermittently for 5 seconds. I read the status of this pin with the second Nano and a common ground. All working fine with RGB LED on second Nano lit as red for low and green for high.

I think the 5V Nano's will read anything above 3.0V as high but I'm not quite sure.

If the first Nano 5V is replaced with a 3.3V Nano, a Raspberry Pi with 3.3V pins or another microcontroller with 3.3V pins would it still interface correctly with the second 5V Nano?

pieman:
I have 2 off 5V Nano's. On the first Nano I set a digital pin high and low intermittently for 5 seconds. I read the status of this pin with the second Nano and a common ground. All working fine with RGB LED on second Nano lit as red for low and green for high.

I think the 5V Nano's will read anything above 3.0V as high but I'm not quite sure.

If the first Nano 5V is replaced with a 3.3V Nano, a Raspberry Pi with 3.3V pins or another microcontroller with 3.3V pins would it still interface correctly with the second 5V Nano?

You will want to use optocouplers to stop the potential of feeding 5V in to the Rpi accidental/during starting up the MCU.

A bigger question would be...why are are using a second nano to check the status of the pin?

A 5v Arduino will read 3.3v signals on an INPUT pin. However its 5v on an OUTPUT pin will probably damage the 3.3v device. You need something to drop the voltage from 5v to 3.3v. A couple of resistors as a voltage divider is effective. I have also used the voltage drop across an LED - but that would be a bit ignorant for a permanent solution.

Another option is to tie the 3.3v input to the 3.3v supply through a resistor (perhaps 1k or 4k7) (or use INPUT_PULLUP if the 3.3v device is an Arduino) and use a diode to prevent the 5v power from the output pin getting to the input pin. When the output pin goes low it will pull the 3.3v input pin low.

...R

Johnny010:
You will want to use optocouplers to stop the potential of feeding 5V in to the Rpi accidental/during starting up the MCU.

I will look at optocouplers but doesn't the Nano boot with pins low?

Johnny010:
A bigger question would be...why are are using a second nano to check the status of the pin?

The first Nano is simulating a microcontroller that runs at 3.3V but is still in production (recent kickstarter project that is fully funded but will not ship until February). I want to have all the Nano code tested before the microcontroller arrives.

Robin2:
A 5v Arduino will read 3.3v signals on an INPUT pin. However its 5v on an OUTPUT pin will probably damage the 3.3v device. You need something to drop the voltage from 5v to 3.3v. A couple of resistors as a voltage divider is effective. I have also used the voltage drop across an LED - but that would be a bit ignorant for a permanent solution.

Another option is to tie the 3.3v input to the 3.3v supply through a resistor (perhaps 1k or 4k7) (or use INPUT_PULLUP if the 3.3v device is an Arduino) and use a diode to prevent the 5v power from the output pin getting to the input pin. When the output pin goes low it will pull the 3.3v input pin low.

...R

As I added in my later posts the 3.3V device is not really a Nano (it is a Wio). I am using INPUT_PULLUP on the 5V Nano that receives the signal from the 3.3V 'Wio'.
If I am only taking the 3.3V output as the input to the 5V Nano do I really need to worry about voltage dividers and the like?

pieman:
If I am only taking the 3.3V output as the input to the 5V Nano do I really need to worry about voltage dividers and the like?

No, you don't need to worry about level shifting if the output is from the 3.3V device.

I use a 3.3V microcontroller for a lot of my projects. Very few 5V devices have trouble reading 3.3V logic. The main exception is the WS2812 LED.

DuaneDegn:
No, you don't need to worry about level shifting if the output is from the 3.3V device.

I use a 3.3V microcontroller for a lot of my projects. Very few 5V devices have trouble reading 3.3V logic. The main exception is the WS2812 LED.

Thanks for this.

pieman:
If I am only taking the 3.3V output as the input to the 5V Nano do I really need to worry about voltage dividers and the like?

No. That is what I said in the first sentence of Reply #3 "A 5v Arduino will read 3.3v signals on an INPUT pin."

...R

Robin2:
No. That is what I said in the first sentence of Reply #3 "A 5v Arduino will read 3.3v signals on an INPUT pin."

...R

Thanks Robin2

This document outlines your choices

3_3vto5vAnalogTipsnTricksBrchr.pdf (953 KB)

Grumpy_Mike:
This document outlines your choices

Thanks Grumpy_Mike. Looks like a very detailed report of things to consider.