I am working on a project where i am measuring multiple currents in a sequence automatically, the 10 bit ADC in the arduino mega does not have the resolution to measure my 360 mA with max 1% tolerance, so i tried lowering the measurement range from 0-5V to 0-1.1V by using the internal reference, my tolerance is much better but still not below 1%, so i tried creating my own external 0.3V and fed it to the AREF and changed the internal range to external.
Now the problem is that even at 0volts my ADC reads 1023, is 0.3V too low to feed the AREF pin or am i misunderstanding something?
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
My code and setup is a prototype so its all very messy right now, but this is the part of the code i use to measure between a 0-0.3V range, i'm measuring 2-5mV before a shunt resistor that i use for calculating the current so i need this low of a range to get the resolution i want.
Yes, avg is declared as a float, it works perfectly with 1.1V aswell. It's once i change the code to EXTERNAL instead of INTERNAL1V1 the problem occurs
Heres a picture of the circuit, the 5v to a switch is meant as a digital output from the arduino, so i can switch on the current measurement with software, my output is Source on the FET. Its active low.
I grounded A14 which is the analog pin my output is connected to and with a multimeter i see 0V, but once i start my software i get 1023 from the ADC
I am working on a project where i am measuring multiple currents in a sequence automatically, the 10 bit ADC in the arduino mega does not have the resolution to measure my 360 mA with max 1% tolerance, so i tried lowering the measurement range from 0-5V to 0-1.1V by using the internal reference, my tolerance is much better but still not below 1%, so i tried creating my own external 0.3V and fed it to the AREF and changed the internal range to external.
Now the problem is that even at 0volts my ADC reads 1023, is 0.3V too low to feed the AREF pin or am i misunderstanding something?
The ADC will not work with a reference below 1V, according to the datasheet - you certainly wouldn't
expect any more accuracy if it did, its not designed for it. I presume you want accuracy and not just resolution?
You either need a higher resolution external ADC, or an opamp to amplify the signal before sampling it.
I tried amplifying the signal by 11 times on my simulation (don't have 2 resistors to make an actual 10 times amp), would this increase my accuracy in reality if i just divide by the times i amplified in the code?
I tried the non-inverting amplifier as you suggested and it works great in my simulation, and i can see it working in my project aswell, i found a LM2903 OP-Amp and used one of the op amps in the circuit, but it won't work. I supply it with 10V and put the negative supply to ground, but i measure nothing on the output or the negative input, the only thing i can measure is the 40mV i feed the non-inverting pin.
to answer Tom's question - i have 4 current measurements, which i take sequentially, i switch between them with FETs controlled by digitalOuts from my arduino which works perfectly fine. I just need to get better accuracy on the voltage i use for calculating current in my software
Any further suggestions? Added a picture of my simulation