Hypothetical Scenario: I want to connect a 5v analog sensor to the Pi. Of course, the Pi's signal processing operates at 3.3v digital. Please assume that both analog-to-digital conversion and 5v-to-3.3v conversion MUST occur for the sensor to interoperate with the Pi.

First-Impression Solution: I can connect the sensor to an ADC converter to convert the analog signal to digital. Then I can connect the ADC to a logic level converter to step-down the signal from 5v to 3.3v. (My understanding is that level converters require digital signals on both sides). Finally, I can connect the level converter to the Pi.

Will this work? Is there a more efficient solution? I read somewhere that an Op Amp might replace both the ADC and level converter.


I just connect the maximum 5V analogue signal to a 5V capable SPI ADC such as a MCP3xxx and use a pair of resistors as a voltage divider on the ADC digital out line (connected to Pi MISO).

  • while I am familiar with the classic voltage divider using a pair of resistors, I always thought of this solution in the context of operating power for the devices, not for signal processing. Now that you've mentioned it, I'm not sure why I had this narrow view to begin with. Are there any other considerations involving SPI, or the very low power used for signaling, that need to be factored in when using resistors in this fashion?
    – PhilM
    Mar 16 '16 at 23:44
  • I found answers and related info here: forum.arduino.cc/index.php?topic=63789.0
    – PhilM
    Mar 17 '16 at 1:59
  • Further research suggests the resistor pair should be of low resistance values to allow the small current (2ma - 16ma) on the GPIO data channel to pass. For example, if you are sizing to 8ma, then optimal resistor values would be 221 ohms (upper) and 432 ohms (lower).
    – PhilM
    Mar 17 '16 at 5:46
  • Personally I would use high resistor values when possible. It minimises the current flow if a higher than expected voltage is fed into the ADC (e.g. mistakenly being powered from 7V rather than 5V). If possible keep the maximum current to of the order of 0.1 milliamps. But, I must repeat, I am a software guy, so take what I say with a pinch of salt.
    – joan
    Mar 17 '16 at 6:19
  • Your point is well taken as a good defensive measure. Would you happen to know the minimum current required for a reliable input signal on the GPIO data channel? Apparently, we are talking µA.
    – PhilM
    Mar 17 '16 at 6:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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