0
\$\begingroup\$

I'm trying to connect a 0-10V analog input value to my MCU which is running on 3.3V. I used the below circuit but when the input is floating I read about 0.3V on the analog input. I need to eliminate the bias current from the analog input.

schematic

simulate this circuit – Schematic created using CircuitLab

Can anyone give me a hint what is the best practice to connect a 0-10V signal to an MCU?

\$\endgroup\$
9
  • \$\begingroup\$ Probably something like this circuit you've made. \$\endgroup\$ Commented Aug 12, 2020 at 13:44
  • \$\begingroup\$ If the Ain is truely zero and you are still getting 0.3V on the output then you can assume that the LM358 is causing this bias? Have you tried connecting the Ain instead to a GND, if you do so do you still get 0.3V out? \$\endgroup\$ Commented Aug 12, 2020 at 13:46
  • 2
    \$\begingroup\$ Unconnected opamp input isn't acceptable. A resistor to GND must be inserted. If the opamp has fet inputs the resistor can well be megaohms or tens of megaohms with no increased offset error, but it must exist or the function is difficult to predict. \$\endgroup\$
    – user136077
    Commented Aug 12, 2020 at 13:56
  • \$\begingroup\$ Don't leave inputs floating if you want decent results - what does a DVM read when the input is floating? \$\endgroup\$
    – Andy aka
    Commented Aug 12, 2020 at 13:56
  • \$\begingroup\$ I would use a similar circuit but I would make a point of choosing an opamp that can drive it's output as low (close to 0 V) as possible and can handle an input voltage close to 0 V when it is powered by 0 V at the negative rail. The LM358 cannot meet that, it needs a negative supply voltage (for example -5 V) to be able to drive it's output to 0 V. \$\endgroup\$ Commented Aug 12, 2020 at 13:57

2 Answers 2

3
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

The way I do this is by taking the voltage you want to measure with the ADC, and voltage divide it down so that the maximum voltage is slightly less than your MCU supply voltage which in this case is 3.3v. In this case it works out to be around 3.2v if the signal is the maximum 10v. Then you run it though the voltage follower to the MCU. D1 and D2 are optional and protect the MCU pin if the voltage on the output of the opamp were to rise above or below the power rails. R3 is also optional and is used as current limiting resistor. When combined with the internal sampling capacitor of the ADC, it also creates a small RC filter. Just make sure not to increase resistance for R3 too high, or you will defeat the purpose of the voltage follower.

\$\endgroup\$
2
  • \$\begingroup\$ I like this design, even though I would use a better op-amp. The scaling is done before the op-amp, so the ADC can be driven at a low impedance.+1 \$\endgroup\$
    – user105652
    Commented Aug 12, 2020 at 22:24
  • \$\begingroup\$ Assume the input voltage is 5V so the current from the input to resistor divider is about 340 uA which is so much for my probe. I'm reading this value from a sensor and I want to eliminate current from this sensor as much as possible. \$\endgroup\$
    – Masoud
    Commented Aug 13, 2020 at 6:33
2
\$\begingroup\$

THe LM358 has an input impedance ~ 10M and output impedance ~ 1k @ 1V/1mA and 100mV /50uA ~2k so it is does not reach negative rail to 0V. But perhaps close enough if your load is < 50uA or >> 2k. That is due to saturation of BJT’s.

Consider matching input R to V+,V- to null input bias current induced Vio with ~1M on each input.

Consider output current with voltage divider R’s with <1V = Vout. Raise the output R’s to reduce Iout. The clamp current from MCU diodes will limit the output voltage without a need for a Zener to << 1mA.

This ought to reduce open cct Vio and Vout .

A better solution might be to use a RRIO CMOS OpAmp with 10M on each input.

\$\endgroup\$

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.