5V PWM, I2C, SPI, UART translation/shifting to 3.3V (Arduino Due)

Hi,

I am looking for breadboard IC's or a breakout board (or both) to pass PWM signals (uni-directional) from Arduino Due to a BLDC hoverboard motor (36V / 4.5A) and I2C/SPI/UART (bi-directional) to interact with other devices.

From my research I have found the following components:

bi-directional

  • SparkFun Level Shifter - 8 Channel (TXS0108E) (BOB-19626)
  • 74LVC245

uni-directional (PWM)

  • 74AHCT125

(I prefer the IC's over the board to save some €)

So my question is:
does anyone have any experience on these boards?
Recommendations?
Thoughts?

Thanx,

Y

Is your hoverboard expecting 5V TTL level signals?
Only I2C is true bidirectional.
Are SMD parts OK?
Consider this.
image

What does that mean?

SDA line of I2C bus is bi-directional.
SCL line of I2C bus is unidirectional.

hey @jim-p thank you for the reply,

the motor driver is a cheap riorand (or ZS-X11H ) 350W 36V BLDC driver, no matter how hard I searched I could find any schematics and I'm struggling to understand TTL because I'm not a professional. I can understand basic electronics. If you tell me a safe bet for a breadboard IC I will be able to solder and connect it.

Y

The motor driver only needs a single 5V PWM signal.
Where do these I2C/SPI/UART signals go?

This would be simple, safe and real cheap for the PWM signal translator.
Connect IN and GND to the Arduino, OUT and GND to the driver board.
image

what translator do you recommend for the PWM?
74AHCT125?

the other signals go here:

Unless you are good at building SMD PCBs, I would use the SparkFun Level Shifter - 8 Channel (TXS0108E) for everything. You will probably need several.

I am not good at SMD PCBs and SparkFun's TXS0108E is a bit expensive, do you think I could I use 74LVC245 for bi-directional signals and 74AHCT125 for uni-directional (PWM)?

The 74LVC245 and the 74AHCT125 are not level translators. and neiher are bidirectional.
The 74LVC245 will work OK as a 5V to 3.3V translator. The 74AHCT125 may or may not work as a 3.3V to 5V translator in your set-up. I suspect that the EMI created by 4 motors may cause problems if you try to use them as translators

How cheap do you want it

1 Like

here people say that TXS0108E is problematic and doesn't work. Are you sure I can pass PWM, I2C, SPI, UART signals?

thanx

The best approach is to match voltage levels for all devices. If the peripherals use 5V logic, use a 5V processor. An Arduino Uno, Pro Mini or similar should be fine for the project.

1 Like

You are right, you will have problems with the TXB0108 in your set-up, forget I recommended it.
I2C/SPI/UART and the microcontroller GPIOs were not designed to drive long wires/cables.
If you have connections longer than 1 foot you may have noise and/or signal distortion problems and you may need to do more than just level translation.

The level translator shown below is your best all around choice but you may need to add or remove pull-up resistors for best performance. For I2C/SPI/UART I would not use data rates over 100kHz with this translator. There should be no problem with the PWM 3.3V to 5V translation but add a 4.7K pull-up on the 5V side.

1 Like

thank you for the reply. The problem is that the 5V pins have limited number of GPIO pins and I need a lot because I want to send 4 PWM signals to 4 motor drivers and connect other peripherals too (see post #6 above).

How about:

  • 74HCT125 or 74LVC245 for PWM?
  • BSS138 for I²C?
  • TXB0108 for SPI, UART?

Based on my communication with Adafruit
or
SN74LVX245 for all signals based on my communication with Sparkfun ?
or
TXS0108E for I²C like Sparkfun suggests?

The pwm signal from Due is 1Khz and the zs-x11h (or riorand in us) controllers possibly accept 50Hz-20Khz PWM signals - there is no documentation online

I think I am lost in translation :confused:

any thoughts?

The BS138 or the board I show in post #13 will work as 3.3V to 5V and 5V to 3.3V for I2C.

The 74LVC245 will work as a 5V to 3.3V translator for PWM, SPI and UART

The circuit I show in post #5 will work as a 3.3V to 5V translator for PWM, SPI and UART

You can also use the circuits I show in post #2 for PWM, SPI, and UART

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.