I need to measure voltages at 2 points on a circuit for calculating temperatures using RTD's. For this I have used UNO board and connected pins 0,1,2,3 to the different points on the circuit (pin 0 to source and pin 3 to ground). From multimeter, I got voltage readings as V0: 4.9V, V1:3.2V, V2:1.5V and V3:0V. I got the readings from the UNO board as 1023, 659, 293 and 0 respectively.
But when I add an analog shield on the UNO to increase the accuracy I was not getting proper readings from it. Analog shield is returning the readings as 45934, 45976, 46055 and 45921 for the voltages 4.9V, 3.2V, 1.5V and 0V respectively. Following is the code I was using to get the readings from the analog shield.
#include <analogShield.h>
void getTemp (float *t)
{
unsigned int V0,V1,V2,V3;
My question is why the sheild is returning a lower value for 4.9V than that of 3.2V. Also it need to return a value of 32768 for 0V (I guess). Is there any error in code.
Question
Vinay
Hello,
I need to measure voltages at 2 points on a circuit for calculating temperatures using RTD's. For this I have used UNO board and connected pins 0,1,2,3 to the different points on the circuit (pin 0 to source and pin 3 to ground). From multimeter, I got voltage readings as V0: 4.9V, V1:3.2V, V2:1.5V and V3:0V. I got the readings from the UNO board as 1023, 659, 293 and 0 respectively.
But when I add an analog shield on the UNO to increase the accuracy I was not getting proper readings from it. Analog shield is returning the readings as 45934, 45976, 46055 and 45921 for the voltages 4.9V, 3.2V, 1.5V and 0V respectively. Following is the code I was using to get the readings from the analog shield.
#include <analogShield.h>
void getTemp (float *t)
{
unsigned int V0,V1,V2,V3;
V0 = analog.read(0);
V1 = analog.read(1);
V2 = analog.read(2);
V3 = analog.read(3);
t[0] = V0; t[1] = V1; t[2] = V2; t[3] = V3;
return ;
}
void setup()
{
analogReference(DEFAULT);
Serial.begin(9600);
}
void loop()
{
float temp[4];
getTemp(temp);
Serial.print(temp[0]); Serial.print(" V0 ");
Serial.print(temp[1]); Serial.print(" V1 ");
Serial.print(temp[2]); Serial.print(" V2 ");
Serial.print(temp[3]); Serial.print(" V3 ");
Serial.println();
delay(200);
return;
}
My question is why the sheild is returning a lower value for 4.9V than that of 3.2V. Also it need to return a value of 32768 for 0V (I guess). Is there any error in code.
Thanks.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.