Hello everyone,
I want to read the values of a resistors matrix (3x3) like this schematic:
The code I've used for reading the values of each resistor is:
int SensorA0 = 0;
int SensorA1 = 0;
int SensorA2 = 0;
void setup() {
Serial.begin(115200);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
}
void loop() {
for(int i = 8; i<=10; i++){
digitalWrite(i, HIGH);
SensorA0 = analogRead(A1);
digitalWrite(i, HIGH);
SensorA1 = analogRead(A2);
digitalWrite(i, HIGH);
SensorA2 = analogRead(A3);
Serial.print(SensorA0); Serial.print(", ");
Serial.print(SensorA1); Serial.print(", ");
Serial.println(SensorA2);
digitalWrite(i, LOW);
delay(50);
}
Serial.println("");
delay(2000);
}
The values that I've used for make a first simulation with Tinker (From AutoDesk) are:
[1000Ohms], [1000Ohms], [1000Ohms]
[1000Ohms], [1000Ohms], [1000Ohms]
[330Ohms ], [1000Ohms], [1000Ohms]
I've read the values on each 1KOhm resistor (Fixed values).
The output of this configuration is:
199, 277, 277
199, 277, 277
485, 274, 274
With this values, I want to show in the serial monitor the real values of the resistor matrix. Because of the output is not similar to the real values (Resistors connected to the Matrix), I don't know how to calculate it.
Each resistor share currents and voltages from neighbour resistors and the value change.
Thank you in advance and wait for your reply. Any suggestion is appreciated.
Regards.