Hi, I want to take sample from two analog pin with different reference voltage. For example, While A0 pin reference is "default" ,but A1 pin is any different internal voltage. Because I want to change internal reference in loop but while is it happen I don't want change other analog pins reference. İs it possible?
No.
There is only one ADC, with a internal multiplexer for all the channels (and a few more internal signals).
There is only one reference voltage for that ADC.
You can switch between default and internal before reading an analog value.
That is common to do, but the combination of the multiplexer and the reference voltage and the way Arduino uses it, is a little quirky. The first analogRead() might be less accurate.
When the reference voltage is changed, you might need to wait 10ms, then do a analogRead() and don't use that value, then a small delay of 1ms, then the real analogRead().
After changing Vref you need to discard the next reading as it can be spurious. This is also true for the first
call to analogRead after powering up.
The settling time for the reference after switching to the internal 1.1V reference is not given in the datasheet,
it just says "a certain time", so whether 1ms is enough I am not sure, experiment will be needed to be confident
of the minimum delay needed.
Thanks a lot, I will try changing reference voltage in loop. Actually I had before, but it wasn't seem accurate because I didn't read secondly. Probably, I am going to come back here. Thanks again.
I have tried, it does a lot reduced sample rate. Do you have an idea for fast as possible as and two analog read? I need to plot graph for distance and force by arduino. I am using linear potentiometer and 0-5V analog loadcell transmitter.
A linear pot should use default Aref.
A "0-5V analog loadcell transmitter" (whatever that is) might also be ok with default Aref.
So why the need to switch Aref.
Give us the full story, including parts, diagram, and code (with code tags).
See the "how to post" sticky, on top of every main page.
Leo..
Because resolution is so bad, about to 300gr for 300kg fullscale. But if the weight under 100kg then I can use INTERNAL2V56, if weight above 100kg then resolution is no matter for me. Then I can tolerate DEFAULT(300gr).
Is this project a secret?
What "0-5V analog loadcell transmitter" has a resolution like that.
Aren't you using a digital HX711 for your load cell?
Leo..
Not its not a secret, just spring tester. I have a indicator and this indicator has one anolog output that it can adjustable output for Voltage or 0-20mA current. But both stuation have to be for 300kg. 10bit fullscale is so less.
So you have a sensor with a 4-20mA output,
and you have used a 250ohm resistor to convert current to voltage?
That uses about 16/20 of the 10-bit A/D range, about 820 values.
Poor resolution, and a supply-voltage dependent (bad) setup with Arduino's ratiometric A/D.
Better to use an A/D with buildin reference (absolute A/D) and a higher resolution,
like a 16-bit 4-channel ADS1115 breakout board.
Note that the 250ohm resistor needs to be changed to suit the gain setting of the ADS.
Leo..
I was tried ads1115 before for this project. I am using pneumatic piston for force and this piston running fast and not have stable speed. Arduino standart sample rate is adequaltely fast for me. Therefore I want to use stock android module instead of ads1115. Maybe I can use double arduino with serial. I think I'll try this and post result to here.
This is why opamps were invented. A single opamp chip and 2 or 3 resistors can amplify the weak signal up to the same kind of range as the other sensor.
Find an opamp tutorial online. There must be thousands. Give preference to the ones from chip manufacturers like Texas Instruments or university course notes. Avoid Instructables.
I can already use opamp but there is no weak signal in here , all of signals are sufficient. Actually, I didn't understand what you meant at all. How can I use the opamp in this problem?
Amplify the load cell signal to get it into the same 0-5V range as your pot.
If it is a "bare" 4-wire or 5-wire load cell, you should be using a dedicated amplifier and ADC such as the HC711. You can't feed the bare cell into the Arduino and get a useful result.