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.
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)
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.