cancel
Showing results for 
Search instead for 
Did you mean: 

I2C: 5 volts to 3.3. volts conversion

alesuafer1
Associate II
Posted on May 07, 2012 at 15:28

Hi

I'm using SRF08 ultrasonic distance sensor. This device returns the distance measure via I2C bus, but it works with 5 volts, so I'm afraid I could burn my STM32VL Discovery board. I wanted to know if this board could support such voltage or, in other case, if you know some Integrated Circuit or schema to solve the problem. I've seen a circuit on Internet but the CMOS transistors it uses are not sold in my electronic shop.

Thank you so much.
3 REPLIES 3
Posted on May 07, 2012 at 15:46

I2C uses open drain (OD) drivers. ie only drives LOW state

Review the STM32 data sheet, confirm the pins you want to use are FT (Five Volt Tolerant).

Use 4K7 pull ups to 5V

In fact if you power an I2C slave with 5V, there is nothing to stop you using a pull-up to 3V3 for the SDA,SCL signalling, just check where the VIH threshold is.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
raptorhal2
Lead
Posted on May 07, 2012 at 15:49

Look in the pin definition table in your processor's datasheet. It identifies which pins are 5V tolerant (FT). That will work for STM32 inputs. For outputs, drive a comparator powered with a 5V reference. Or find a suitably equivalent transister in your shop.

Cheers, Hal

alesuafer1
Associate II
Posted on May 08, 2012 at 15:19

Thank you both.

I've already checked the STM32F100RB datasheet and I2C and USART pins figure as 5 volt tolerant (FT), so is no problem with connecting 5 volts devices.