EmbDev.net

Forum: µC & Digital Electronics Level Shifter Questions


von ab0032 (Guest)


Rate this post
useful
not useful
Googling around I have found that people connect 3.3V sensors to 5V 
Arduinos without level shifters, how can that be? All cases without 
level shifter I found used I2C. Do I need level shifters only for SPI? 
Does that somehow have to do with I2C pullup resistors?

A 3.3V high signal from a sensor will be recognized as a high on the 
Arduino, but how reliable is that?

Going from the Arduino to the sensor I would fear that a 5V high from 
the Arduino would damage an input on a sensor chip.

In particular I want to connect the Decawave DWM1000 and the MPU9250 to 
Arduino. The datasheets say that 5V is not okay on the inputs.

I have this breakout board which seems to have a voltage regulator to 
supply the 3.3V to the MPU9250, but do I need to use level shifters to 
connect this to an Arduino?

http://www.ebay.de/itm/SPI-IIC-MPU-9250-9-Axis-Attitude-Gyro-Accelerator-Magnetometer-Sensor-Module-/181955388388?hash=item2a5d62e3e4:g:8-cAAOSwAKxWZtM6

Are certain level shifter preferable to others for SPI? Schmidt 
triggers?

von Kaj (Guest)


Attached files:

Rate this post
useful
not useful
I recommend the application note AN97055

von Clemens L. (c_l)


Rate this post
useful
not useful
ab0032 wrote:
> Do I need level shifters only for SPI?
> Does that somehow have to do with I2C pullup resistors?

I²C uses pull-up resistors to define the high level, but this still 
means that all devices on the bus use the same high level.

If the devices require different signal levels, all connections/buses 
need level shifters.

> A 3.3V high signal from a sensor will be recognized as a high on the
> Arduino, but how reliable is that?

A CMOS input switches at a threshold voltage, which is typically 
guaranteed (for VCC = 5 V) to be somewhere between 1.5 V and 3.5 V. So 
to switch reliably, the high level of the signal would have to be at 
least 3.5 V.

In practice, the actual threshold voltage is likely to be near the 
middle (2.5 V), so it's likely to work. But "likely" is not 
"guaranteed". And a voltage that is not near GND or VCC can increase the 
power consumption greatly.

> Going from the Arduino to the sensor I would fear that a 5V high from
> the Arduino would damage an input on a sensor chip.

There are inputs that are 5V tolerant. (If that were the case, it would 
be documented in the datasheet.)

If the input is not 5V tolerant, connecting a 5V signal is likely to 
burn out the ESD protection diodes and probably other components (if the 
source can supply enough current).

Unidirectional downshifting can be done with a simple voltage divider 
(if the speed does not need to be too high).

: Edited by User
von Alexander B. (ab0032)


Rate this post
useful
not useful
Thank you both for the answers.That clarifies matters for me.

So if I briefly summarize this, please correct me if I am wrong, I 
should use level shifters between 5V and 3V devices.

For SPI I need 4 unidirectional level shifters and for I2C I need two 
bidirectional level shifters.

The level shifting from the application notes AN97055 suggests using 
mosfets with a switching time of less than 50ns for I2C.

Would that also work for SPI or would that be too slow? Since the level 
shifting for SPI is directional, I could use both directional and 
bi-directional level shifters, right?

Are Schmidt triggers a recommended way for directional level shifting?
Or devices like the 74LVC245 with a delay of less than 17ns ( 
https://cdn-shop.adafruit.com/datasheets/sn74lvc245a.pdf )?

Is there some preferred way to do level shifting if I design my own 
breakout board?

For playing around on a breadboard it does not really matter, so I can 
use more or less any $1 to $2 level shifter I can get on ebay, as long 
as it is fast enough, right?

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.