1

Most of the sensors available in the market requires 3.3V-5V. The GPIO of the Raspberry Pi is 3.3V max only and not 5V tolerant. I have seen tutorials around the internet that they supply the sensors from 5V from the Raspberry Pi then connecting sensor's output pin to GPIO by using voltage dividers such as resistors in series to reduce it to 3.3V. My main concern is:

  1. Will it affect the transmission of sensor data to raspberry pi or affect the performance of the data transmission when decreasing voltage (as the sensor output voltage is reduced) ?

I am trying to compare the sensor performance if we connected the same sensor to Arduino for which we would not require a voltage divider/level shifter.

7
  • 1
    in such a setup, the 5v sensor will still be getting 5v power and sending 5v signals Feb 9, 2021 at 21:55
  • 1
    But 5V signals will cause damage to Raspberry Pi as GPIO pins have maximum voltage of 3.3V right?
    – ui2020
    Feb 9, 2021 at 22:03
  • 1
    I thought you said there are voltage dividers Feb 9, 2021 at 22:03
  • 1
    Yes but my main concern is if it will be able to read data the same, as it would, if we connected the same sensor to Arduino. (as there is voltage reduction when connected to RPI)
    – ui2020
    Feb 9, 2021 at 22:09
  • 1
    digital data transmission does not depend on absolute voltage levels for accuracy ... it depends on there being discrete levels in the signal .... think of this ... you can transmit blink code using a small flashlight with the same accuracy as using a 100 W lightbulb ... as long as the receiver can discern between the two levels in the signal, data will be accurately transmitted
    – jsotola
    Feb 10, 2021 at 1:00

2 Answers 2

1

I've had pretty good luck with these opto-coupled voltage shifters. In addition to shifting the voltage from 5V to 3.3V they provide some protection and voltage reference isolation. They also have LEDs that light when an adequate voltage is sensed. Not sure what the frequency response is. I think they also come in single or four lead versions and also with different voltages (e.g. 12, 24, etc).

Al-Zard Voltage Shifter

1

In general, any level shifter reduces the performance of a digital data line. For digital signals, it's often convenient to characterize a level shifter by the maximum frequency it can pass though.

Mechanical relays are very slow, working only at single-digit Hz frequencies. General-purpose optocouplers and MOSFET-based bidirectional level shifters are usually OK for up to 100kHz. Resistive voltage dividers are unidirectional by nature (you can only get lower voltage, not higher), and work up to a 1-2 MHz if the resistance values are sufficiently low. Specialized chips or RC voltage dividers can support frequencies of tens of MHz.

In practice, R voltage dividers work fine with standard I2C speeds and slow SPI.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.