2
\$\begingroup\$

I want to interface MQ-135 air quality gas sensor. Sensor have 5V output interface. However my mcu work at 3.3V. I can basically put a voltage divider. But sensor itself is a voltage divider with a specific resistor range at output.

So in this case I need opamp or something like that. But what would be the easiest way interface this 5V to 3.3V.

\$\endgroup\$
3
\$\begingroup\$

From the MQ-135 Datasheet you can see that the sensing resistance is 2 kΩ to 20 kΩ and the test circuit shown is really just forming a voltage divider from the 5 V supply with the lower end being RL. If you select RL as 3.3 kΩ when the sensor resistance is 2 kΩ the output will be 3.113 V and when it is 20 kΩ it will be 708 mV which you can directly connect to your ADC.

Sometimes when selecting divider resistors I find it convenient to use an on-line potential divider calculator to play around with the values. If your microcontroller has an internal bandgap reference for the ADC you may also want to consider using that and adjusting the resistor value so the maximum output voltage is around that value.

MQ-135 circuit diagram

\$\endgroup\$
  • \$\begingroup\$ I really missed that minimum 2kOhm calculation. That would do my job maybe. But my main concern was about scaling. Since different voltage rates in this sensor indicates different gases. I basically used 20kOhm and put a lmv321 opamp and than put a voltage divider on it to scale to 0-3.3V \$\endgroup\$ – cheour Aug 8 '15 at 9:57
3
\$\begingroup\$

As Jacob said you can use LD33V to convert voltage to 3.3v but you can also use optocouplers like PC817 to couple or isolate your circuit.

\$\endgroup\$
-1
\$\begingroup\$

There are devices called logic level converters that can do this. See the one from SparkFun.

\$\endgroup\$
  • 1
    \$\begingroup\$ Sorry but this is about analog conversion, not logic conversion. \$\endgroup\$ – cheour Aug 8 '15 at 9:55

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.