cancel
Showing results for 
Search instead for 
Did you mean: 

Voltage Level Shifting for STM32: Resistor Divider vs. Level Shifter IC for Analog Signals

hvs_learn
Associate III

I have a question regarding voltage level I/O compatibility for STM32 MCUs. The sensors providing analog output within a 0–5V range, while those with digital output at either 0V or 12V. Although some GPIO pins on the MCU are 5V tolerant, they are scattered across the package. To standardize the voltage levels to 0–3.3V (for both safety and ease of routing), I have chosen to use resistor dividers. While resistor dividers should work well for digital signals, I am unsure whether they are sufficient for analog signals or if a dedicated voltage level shifter IC would be a better option.

My concern is that the tolerance of resistor dividers could introduce inaccuracies in the voltage supplied to the ADC, leading to incorrect scaling and unreliable measurements. I have researched some voltage level shifter ICs and have identified the following options:

  • TXB0108PWR
  • FXMA108BQX (a lower-cost alternative)

Would a voltage divider suffice for analog signals, or would a level shifter IC be the better choice to ensure accurate ADC readings?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

For analog signals, a resistor divider is perfectly fine. Resistors with a tolerance of 1% can be obtained for cheap. This inaccuracy can be calibrated out if needed since it will not change over time.

> TXB0108PWR

> FXMA108BQX

These are digital level shifters, not analog. Not what you want here.

An op-amp could also be used, but it'll cost more and you'll still have the uncertainty of the resistors in there.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Guru

For analog signals, a resistor divider is perfectly fine. Resistors with a tolerance of 1% can be obtained for cheap. This inaccuracy can be calibrated out if needed since it will not change over time.

> TXB0108PWR

> FXMA108BQX

These are digital level shifters, not analog. Not what you want here.

An op-amp could also be used, but it'll cost more and you'll still have the uncertainty of the resistors in there.

If you feel a post has answered your question, please click "Accept as Solution".