Something wrong or i chose wrong op-amp - Page 1
Forum section: electronics / beginners

author: DarkZero
author_rank: Regular Contributor
timestamp: June 26, 2017, 07:24:54 pm
content: i want to make a small voltage monitoring device using arduino that will measure 0-25v but when i connect r2 to gnd i get a reading of 0.6v and i cant measure lower values than that is it poor choice of op-amp or something else ?

author: Kleinstein
author_rank: Super Contributor
timestamp: June 26, 2017, 07:30:19 pm
content: The MC33202 is BJT based and thus has a considerable bias current. So the resistors at the input are too large or the OPs choice not good for the resistors.A good choice for such high resistors would be a MCP6002 or similar.

author: DarkZero
author_rank: Regular Contributor
timestamp: June 26, 2017, 08:19:18 pm
content: so either to lower r2 or to change opamp ?

author: mikerj
author_rank: Super Contributor
timestamp: June 26, 2017, 08:49:34 pm
content: You would need to lower both R1 and R2 to maintain the same ratio, but really this isn't the right part for precision DC measurements using high impedance dividers.The datasheet says this part has a typical input bias current of 80nA @ 25C. You have an input impedance of 10M||2M = 1.66M, 1.66M * 80nA = 0.133v. Assuming your Arduino reference is 5v, your scaling factor would report this as 0.8v, close to what you are seeing. The worst case input bias current (i.e. what you should be designing for) is 200nA @ 25C.Also note that the output can only get within about 50mV of the rails, irrespective of the divider so there will always be an offset to deal with.Some problems like this can be resolved with software calibration, but input bias current is tricky since it can vary with temperature and common mode voltage.

author: Zero999
author_rank: Super Contributor
timestamp: June 26, 2017, 09:35:21 pm
content: If lowering the resistor value or changing the op-amp are impractical, connecting pins 1 & 4 together with 10M and 2M in parallel, rather than a wire link may help. Balancing the impedance to each input causes the voltage generated by the bias current on both the inverting and non-inverting inputs to be equal, thus cancelling one another.I notice that the MC33202 has a rail-to-rail input stage which casts doubt on how well it will work but it's still worth trying.

author: bson
author_rank: Unknown
timestamp: June 26, 2017, 11:01:15 pm
content: Or use a FET opamp such as the LF412. It has an input resistance of 1012ohm and a bias current of 50pA typ. Still, even then 10M,2M is just massively big... How about 100k,10k?

author: danadak
author_rank: Super Contributor
timestamp: June 27, 2017, 12:57:41 am
content: When working with hiz Z inputs and sensors you need to guard theOpAmp inputs. Some ref material on this.http://www.ti.com/lit/an/snoa664/snoa664.pdfhttp://www.linear.com/solutions/1853Regards, Dana.

author: Zero999
author_rank: Super Contributor
timestamp: June 27, 2017, 10:42:23 am
content: Quote from: bson on June 26, 2017, 11:01:15 pmThe trouble with the LF412 is the input common mode range doesn't include the negative rail, so a negative supply is required to measure 0V.To run off the same power supply as the ADC, a CMOS op-amp with both a rail-to-rail input and output is required, such as the OPA743.

author: Kleinstein
author_rank: Super Contributor
timestamp: June 27, 2017, 04:12:13 pm
content: If the bias current of the OP is somewhat constant, one might be able to just compensate for it in software. However with many OPs the bias current is also changing when coming close to the Rails or when changing over from the NPN to PNP input stage. So likely this is not a working option with the MC33202.To power the OP with the same 5 V as the Arduino a rail to rail OP is kind of convenient. The AVR internal ADC is not that accurate. So a more or less normal RR CMOS based OP should be OK. There are lots of rail to rail OPs for a 5 V supply to chose from, this includes auto zero OP like the MCP6V11, though I doubt it is needed.If the input is only slowly changing, one could even try It without an OP at all. The ADC inputs are kind of high impedance on average, but they need peak current to charge the S&H stage. Here a simple buffer capacitor (e.g. 10 nF -100 nF range) could be all it takes. The downside is some loss in precision due to leakage currents (though likely less than the current OPs Bias) and less protection. Though the high series resistor already provides some protection.

author: DarkZero
author_rank: Regular Contributor
timestamp: June 27, 2017, 07:02:04 pm
content: ok ty all for suggestions i tried some guess i need to give more info in order to make this thingfirst for Aref im using REF 02i lowered resistors to 5k and 1k it seems to have fixed the issue with input bias current and i calibrated it in software on a 5v reference box when i measure that 5v it shows 5v and its pretty stable now when i measure battery of 1.5v and lets say its 1.5v i do it at the same time with the arduino and my multimeter, arduino shows 1.4v where my metter shows 1.5v also when i try to measure higher voltages then 5v volts lets say 10v i get ~8v.my code is in attachment.

author: mikerj
author_rank: Super Contributor
timestamp: June 27, 2017, 07:13:31 pm
content: Quote from: DarkZero on June 27, 2017, 07:02:04 pmThat's a very low impedance to be measuring up to 25v with; it will be drawing over 4mA through the resistors. That might not be a problem if you are measuring something with very low source impedance e.g. a battery.

author: Kleinstein
author_rank: Super Contributor
timestamp: June 27, 2017, 07:21:00 pm
content: With a 5 K and 1 K resistor one would not need the OP. The ADC in the AVR is ok for a signal impedance of 20 K. So one could use something like 20 K and 100 K without an amplifier. With an additional capacitor even higher impedance can work.The ADC in the µC can have some offset and the OP can also add some offset. So one might have to do calibration with 2 points, not just one voltage. Even if the OP is rail to rail, performance is usually not that good very close to the rails. So the range below some 20 mV might not be that good and it might be a good idea to no use the point at 0 V for the calibration.