Hi, i am pretty new to Arduino and electronics. I am working on a project that necessitates reading a voltage with mV accuracy. I am currently using an Arduino Uno, and will be reading voltages in the 0 - 1 V range. I am thinking of using an op amp to amplify the voltage, then divide the voltage and read it using multiple analog input pins, combining them to find the final voltage while staying within the 5V max that the uno can read. i don't have all of the parts necessary at the moment, but know they are pretty cheap. Is this feasible, or if not does anyone have any suggestions on how to go about reading the intended voltage accurate to the mV.
The Arduino Uno/Nano has an alternative builtin reference for the ADC, Somewhere around 1.1 VDC. Switch to that, and you'll get ~1mV/count from the ADC without amp-and-reduce.
Read this, carefully:
I've tried that, and it is very close, but the resolution is 1.07 mV per tick of the 1024, it rounds incorrectly sometimes, and I need it to have that accuracy. thanks though
Be aware that nothing you can do will give you 1 mV accuracy over a 1V range, when you use the built-in 10-bit ADC. It's just not that good. With averaging, patience, and luck, you may be able to get close. Otherwise, buy an add-on 12 bit I2C or SPI ADC, and you'll be a lot happier.
Just went back to test it, and tried averaging a higher number of values, and the data is coming out wrong. Using a voltmeter I confirmed that the internal reference voltage was 1.1, which came out perfectly, and checked the output voltage I was trying to read, which matched what it was supposed to, but the arduino was reading a voltage of 0.285 for a measurement of 0.287 V. Is this an issue with the arduino or something else.
Also as i said I'm pretty new to this, and the forum, so I'm sorry if i forget anything.
beyond that, you mentioned using an external voltage reference. What would be a good way to do so. I would plan to have this running in the background recording measurements, so i would want something stable and consistent. Thanks for all of the help
I can't begin to imagine what I might find in the code you wrote to do this, so post it, please. Sounds like incorrect conversion math.
External references - lots to choose from, but start by describing what you want to measure, more exactly. External conversion circuits are very common as well, but what's your measurement domain. Do you want a value per second, or per millisecond? Are you looking for optimum accuracy, orspeed, or a little of both?
I'll not comment again until you've, at a minimum, read and complied with:
here's the code! its pretty simple but thanks for taking a look.
I am using a device that measures the diameter of a tube and outputs the voltage as directly equal to said measurement.
conFac is shorthand for conversion factor
I would be using an extension to read serial output into an excel file
byte inPin = A2;
float volt;
float diam;
float conFac = 1.1 / 1023;
void setup() {
// put your setup code here, to run once:
pinMode(inPin, INPUT);
Serial.begin(9600);
analogReference(INTERNAL);
}
void loop() {
// put your main code here, to run repeatedly:
volt = 0;
for (int i = 0; i < 100; i++) {
volt += analogRead(inPin);
}
volt = (volt / 100);
diam = (volt * conFac);
Serial.println(diam, 4);
delay(500);
}
also as for speed or accuracy, i would be aiming for accuracy, though I would ideally be able to check 2 to 4 times per second if that is incompatible, then accuracy is prioritized
Try one thing - remove the pinMode() call, it's not needed. Don't think that's messing with your conversion, but it doesn't belong, as it actually enables some digital circuitry.
Eminently doable, trifling. Get a 16-bit conversion circuit (ADS1115); I'm looking at a 3-pack for $24 on Amazon as I write this. Don't expect 16 bit accuracy, but it'll be a lot better than the builtin.
and yeah, 1024! not 1023.
0.287 vs 0.285 could be 0.2865 vs 0.2854, because you're not showing the lesser digits. Look deeper to see if rounding or truncating is happening, but really, you won't get what you want with the built-in, so it's academic.
thanks for the suggestion. I think i did 1023, because i though "oh 0-1023, so i should divide by 1023" thanks for the help. as for the 4th digit, looks like the Arduino was reading 0.2851-0.2854, as for the measurement device it only shows up to the mV place.
sorry, but what value on the chip are you referring to and where might i find it? sorry, pretty new. thanks for all of the help and patience. I may have done it wrong, but to check the internal voltage, I just connected the voltmeter across the aRef pin and the ground, and got a reading of 1.100V. if that is wrong or something i shouldn't do I would be happy to learn, thanks
Remember that any A/D converter can only give a reading of +/- one least significant bit, no matter how many bits it has. Remember this even while you are averaging readings.
Also a fundamental tenant of Physics is that you can't make any measurement without disturbing the system you are measuring.
If you tell a bit (lot) more about the project and the context of that mV accuracy requirement, it will be a whole lot easier to suggest feasible options. How did you arrive at the conclusion that you need +/-1mV resolution over a 0-1V range? What kind of signal is it, and what will be done with the acquired digital data?