How to double small DC voltage - Page 1
Forum section: electronics / beginners

author: scott216
author_rank: Regular Contributor
timestamp: October 07, 2014, 03:31:04 am
content: I have a sensor that has a 0-5 volt DC output, but realistically the output voltage is never going to get above 2.5 volts. My sensor will be connected to an analog pin of an Arduino. I'd like to take the output from the sensor and double it so I have more resolution in my reading. Doing a little searching online seems like an op-amp might be a good way to go. My supply voltage is +5 volts. I don't need the circuit to output 0 volts if the input is 0 volts. I can always compensate for the voltage offset in the code. I do, however, want the output to be linear. Any thoughts?

author: Pillager
author_rank: Unknown
timestamp: October 07, 2014, 04:54:15 am
content: A non-inverting opamp amplifier seems the way to go.

author: tggzzz
author_rank: Super Contributor
timestamp: October 07, 2014, 07:33:17 am
content: Quote from: Pillager on October 07, 2014, 04:54:15 amDon't forget to take standard precautions about offset and gain inaccuracies and drift. Whether or not they are important depends on the application.

author: akis
author_rank: Frequent Contributor
timestamp: October 07, 2014, 09:18:31 am
content: The Arduino has a voltage reference pin which you can use to set the expected ceiling voltage for all the analog input pins. 2.5V is half the 5V output/supply, so you could set a simple potentiometer (two resistors) to set the reference to , say 2.6V. Of course this will depend on whatever else is attached to the analog pins.In addition, the op-amp has 50 transistors in it, and it will invariably add noise and distortion, so even though you think you are reading more values, half of them maybe artifacts. For example with an op-amp in place you read 500, 501, 502, 503, 504, 505 etc. Without the op-amp you would read 255, 256, 257. But the situation is that the values 501, 503, 505 are simply artifacts of the op-amp and associated extra components, affected by noise, temperature etc

author: Unknown
author_rank: Unknown
timestamp: October 07, 2014, 09:40:21 am
content: If you go the external reference route, make sure you tell the MCU you are using one:analogReference(EXTERNAL);in setup() before any analogReads are done. Also bear in mind there is an internal 32K resistor on the AREF pin, so you need to take that into account if you set AREF with a voltage divider. The internal resistors on AVRs are not particularly precise either, so if you're making a lot of these, you'll want to code in some kind of calibration method or use a trimmer/pot in the divider, for a one-off you can just hard code it of course.If you're using an Arduino Mega, you have an internal reference of 2.56V already available withanalogReference(INTERNAL2V56);I'm not 100% sure what will happen if you drive an ADC pin higher then a reference that is <5V, it probably isn't a good idea, so you'll more than likely need to clamp the sensor output with a zener diode unless you can absolutely guarantee the output will never go above 2.5. Doing so means you'll also probably have to buffer it if the sensor has a high output impedance, introducing the op-amp noise anyway. From my own experience, using an LMV358 to amplify a VERY small voltage by a factor of 30, I got very little noise coming through. Of course you can always take multiple readings and then average them.Another option is the 1.1V reference. All 168/328 arduinos have this.analogReference(INTERNAL); // for the UNO and other 328/168 arduinosSo by setting that, you can then reduce the sensor output with a voltage divider (or just 1 resistor if the sensor has a constant high output impedance). And you're away. Again I don't know if it would be bad to drive the ADC pin over 1.1V in this situation, meaning buffering and clamping. And if you're using an op-amp to buffer, you may as well just use one to multiply by two, which would be the lowest part cost, because there's no need to clamp the output if the op-amp is powered from the 5V rail.

author: scott216
author_rank: Regular Contributor
timestamp: October 07, 2014, 12:57:03 pm
content: QuoteI have a second sensor in my project that also uses 0-5 volts and with that sensor I need to measure the whole range, so I can't change the reference voltage. I'm using an Arduino Uno, not a Mega.QuoteI don't know enough about op-amp circuits to know how to do this. Can you give me some ideas?QuoteThat's a lot of artifacts. What's the best way to deal with this?

author: Unknown
author_rank: Unknown
timestamp: October 07, 2014, 01:21:24 pm
content: No doubt someone will pick holes in this, but this is the basic idea.The opamp I use is an LMV358, for max resolution you'd need a rail to rail one if your power rail is 5V and your ADC reference is also 5V. To smooth out any noise, take about 20 or so reading and take the average. But it's my experience there's not much noise even at 30x multiplication, the ADC reading tends to flicker by only 1 step.

author: scott216
author_rank: Regular Contributor
timestamp: October 07, 2014, 01:39:17 pm
content: That's a big help. Thanks!

author: akis
author_rank: Frequent Contributor
timestamp: October 07, 2014, 02:05:38 pm
content: Need to place a small resistor in series to the Vin+ pin to prevent currents flowing into the op-amp if they inadvertently approach the rails. And then another resistor to ground. Something like a 10K in series with 100K to ground maybe. And then make R2 say 11K.

author: Unknown
author_rank: Unknown
timestamp: October 07, 2014, 02:55:50 pm
content: That's a valid point akis. I'd just assumed his sensor would have had some output impedance on it already.