Hello,
I am using Arduino uno with weight sensor which uses 9V power supply. One can measure change in weight by mapping change in voltage across two wires. In my project I have given output of Weight sensor to Differential Op-amp (+12V and -12V) . The output of op-amp is given to analog pin of Arduino(A2 pin).
In multimeter if I see output from op-amp it ranges from 0V to 3V, but A2 pin always shows 1023.
Please help in troubleshooting the issue.
code is as follows
const int WS_Output=A2;
void setup()
{
Serial.begin(9600);
pinMode(WS_Output, INPUT);
}
void loop()
{
int WS_Input= analogRead(WS_Output);
Serial.println(WS_Input);
}
Thanks in advance
Let's see the code....
(Use the </> icon above the
to format it as code)
Oh, and the circuit..... is there a common ground?
Yes, common ground between op-amp, weight sensor and arduino board
const int WS_Output=A2;
void setup()
{
Serial.begin(9600);
pinMode(WS_Output, INPUT);
}
void loop()
{
int WS_Input= analogRead(WS_Output);
Serial.println(WS_Input);
}
the analog input is relative to the 3.3v ( or 5v) output. if analog input is 3.3v then you get 1023 if 0v you get 0. you could attach a resistor to the A2 and ground, that might help.
Anagal92:
In my project I have given output of Weight sensor to Differential Op-amp (+12V and -12V) . The output of op-amp is given to analog pin of Arduino(A2 pin).
You will probably damage your Arduino chip if the op-amp output goes outside the chip's input voltage range of -0.5V to Vcc+0.5V. If you have not already done so, as a minimum place a resistor, say 47kΩ, in series with the A2 pin to allow the chip's input protection diodes to work.