PWM, I2C, Serial communication from 5V devices to Arduino Due (3.3V)

I am trying to interface some breakouts and other devices to Arduino Due. I need to send 4 PWM signals to Due and Serial from the gps. I am not sure about the ESP32 and Rpi Zero signals but the latter should be the faster available. Does anyone know what it a wise selection to make for level shifters ? I understand I need uni-directional for PWM and Serial and Bi-directional for I2C. Please see image below.

Thanx,

Y

1 Like

Hi @yantypas !

Do you maybe have some schematics for this idea?

I think it would be easier to understand instead of just the photo of the components.

Hello @igor_X thanx for your reply.

I do not have schematics.
My question is how to pass 3.3V signals to 5V devices (and vise versa apart from PWM) using PWM, I2C, SPI and UART.

1 Like

Hello @yantypas ,

For UART, you can use TTL to RS232 converter.

For example:

For others, I am not sure at the moment. I think in some cases I2C can be used both on 3.3V and 5V at the same time, but I guess it is better to use level shifters. Here are some sold by RobotShop:

My problem is on the PWM signals. Can you confirm a suitable interface to translate 3.3V PWM to 5V? I²C and SPI would be a plus (not on the same board necessarily)

thanx

1 Like

Hi @yantypas,

Maybe this topic will be interesting for you: https://forums.adafruit.com/viewtopic.php?t=104157

It says:

There are two ways that occur to me off the top of my head:

  • Use a level shifter (or use a transistor or optocoupler) to convert the 3.3v signal to 5v. You need to figure out whether the level shifter will react fast enough for the PWM signal that you are using ;
  • Use one of the PWM shields/add-on boards that are controlled via i2c or spi – most of these have an external power input, so you can control them via 3.3v but hook up 5v power. External boards have the advantage that they are fire and forget, i.e. you don’t have to keep doing the PWM signal in the microprocessor, but the disadvantage is they are harder to setup.