I am using a 5V sensors (MQX Gas Sensors) that is connected to an RPi. This sensor is then connected to an ADC converter then to a logic level shifter. I just followed the tutorial I saw on the internet. Since the input varies from 0V - 5V, if I connect it to an logic level shifter, will the output vary from 0V - 3.3V as well?
-
\$\begingroup\$ Depends on the level shifter design. If it's just a resistor divider, yes. If it's more complex than that, probably not. \$\endgroup\$– HearthMar 17, 2019 at 21:04
-
\$\begingroup\$ I'm using this, will this work? \$\endgroup\$– LinkedRomMar 17, 2019 at 21:09
-
\$\begingroup\$ No. I can't think of any type of bidirectional logic shifter that would work on analog signals. \$\endgroup\$– HearthMar 17, 2019 at 21:10
-
\$\begingroup\$ Is the logic level shifter between the sensor and the ADC, or between the ADC and the Pi? \$\endgroup\$– JREMar 17, 2019 at 21:46
1 Answer
Yes, it will vary from 0-3.3V but it won't do it in a "nice" fashion. It will be very nonlinear (that's a positive feature with digital circuits). So it might be 0V out with 2.1V in and 3.3V out with 2.2V in.
You probably need a simple op-amp circuit or just a voltage divider. But, as with any circuit you'll need to specify a lot more information such as voltage range (it's important if it has to go down to exactly 0V, and important if the output is not allowed to go a bit negative, for example) available power supplies, input impedance required, output impedance required, accuracy and bandwidth.