So I have a torque sensor that outputs a small voltage between +- 5mv, I am inputting 10V into the torque sensor. I connect this torque sensor to a INA827 Amplifier to amplify the signal with a gain of 100. The input and output voltages in the Amplifier are in the range when measure with an oscilloscope. The input ranges between 3mV to 23mV and the output ranges from 300mV to 2.3V. The problem I have is when I connect the Amp to arduino, the output I obtain from arduino doesn't match the results from the oscilloscope. The Amp is connected to Analog input 0 and to ground. Attached is the code I use. What I am doing wrong?
float voltage =0;
int sensorValue =0;
float mvoltage =0;
float torque =0;
void setup() {
Serial.begin(9600);
}
void loop() {
sensorValue= analogRead(A0);
voltage = sensorValue*(10/1023.0); // Converting bits into V
torque= voltage*12.5;
mvoltage= voltage;
PaulS:
Forget manipulating the value read from the analog pin until you KNOW that the value is reasonable.
As you cause the device to change output voltage, does the reading from the analog pin change in a reasonable manner?
No, the reading from the analog pin changes reasonably. For example the attachment shows the readings of when I run the program and leave as it is without moving anything. The torque in this case is ideally 0 but as you can see the readings jump around, meanwhile in the oscilloscope the readings are reasonable because they do not change much except for probably the noise that is picked up.
Your Opamp requires a symmetrical power supply. So the OPamp's output voltage cannot be 0.3-2.3V then (with only single 10V power supply and probably a virtual ground). How is your OPamp wired then?? Always show the schematics.
Post your circuit diagram.
You might need a voltage divider if you supply the IC from 10volts.
The IC's output can swing to both rails withing 100mV.
Leo..
I would try reducing that delay.
If you are working with this kind of circuit , you have a DMM.
We want to know what the amp output voltage is ON THE DMM AT THE TIME you are measuring it with the arduino. Without that , it's difficult to say what is going on. There is really no point in making any comments or conclusions about this issue without a schematic. A photo of the circuit might be necessary later. Let's see how it goes after we see the schematic and the DMM readings.
First of all thanks for all the input you guys put. After playing around with the setup I was able to figure out what was causing the voltage signal to jump around too much ( the oscilloscope). It seems like the oscilloscope is bringing all the noise into the system because when I disconnected my readings become stable and they are accurate.
Once again thank you for all the input you guys put.
Check the scope ground for ground loops. Connect the scope to the circuit. Turn on the power. Put a DMM in CURRENT mode from the GND terminal of the scope to the breadboard ground bus (using a jumper wire) and see if there is any current between the two grounds. If so, you need to add a ground wire from the screw-on GND terminal of the scope to the breadboard GND bus. I have noticed similar problems if I don't add that wire.