Mehrere FSR-Sensoren mit Arduino Mega

Ich will nicht sagen, dass alle Teiler perfekt sind aber die kommen näherungsweise ran. Das muss auch noch perfektioniert werden, was die Kalibrierung betrifft. Das Ding ist, dass die Kurve nicht linear verläuft.

Hier ist die Kurve vom Datenblatt. Die kurve ist hier Logarithmisch dargestellt.

5

JA, die kenne ich :wink:

Ok, las mir mal nen Moment. das mit den float macht was, aber ich muss das manuell nachbauen.

okay :blush:

Der urcode passt schon nicht. Da ist doch was anders, als an dem urcode den ich habe:

Na mal sehen, ob ich das mit dem rechnen richtig bekomme - die Variablen setzen kannst später selber.

der Urcode ist nicht für diesen Sensor, sondern für einen, den ich aus dem Netz habe. Die If-Bedingungen mit dem Teiler und so, sind von mir. Die habe ich auch noch etwas abgeändert. Hier ist der Code auch noch mal, wo ich bis auf 10Newton kalibriert habe.

/* FSR testing sketch. 
 
Connect one end of FSR to power, the other end to Analog 0.
Then connect one end of a 10K resistor from Analog 0 to ground 
 
For more information see www.ladyada.net/learn/sensors/fsr.html */
 
int fsrPin = 0;     // the FSR and 10K pulldown are connected to a0
float fsrReading;     // the analog reading from the FSR resistor divider
float fsrVoltage;     // the analog reading converted to voltage
float fsrResistance;  // The voltage converted to resistance, can be very big so make "long"
float fsrConductance; 
float fsrForce;       // Finally, the resistance converted to force
float fsrweight;
void setup(void) {
  Serial.begin(9600);   // We'll send debugging information via the Serial monitor
}
 
void loop(void) {
  fsrReading = analogRead(fsrPin);  
  Serial.print("Analog reading = ");
  Serial.println(fsrReading);
 
  // analog voltage reading ranges from about 0 to 1023 which maps to 0V to 5V (= 5000mV)
  fsrVoltage = map(fsrReading, 0, 1023, 0, 5000);
  Serial.print("Voltage reading in mV = ");
  Serial.println(fsrVoltage);  
 
  if (fsrVoltage == 0) {
    Serial.println("No pressure");  
  } else {
    // The voltage = Vcc * R / (R + FSR) where R = 10K and Vcc = 5V
    // so FSR = ((Vcc - V) * R) / V        yay math!
    fsrResistance = 5000 - fsrVoltage;     // fsrVoltage is in millivolts so 5V = 5000mV
    fsrResistance *= 10000;                // 10K resistor
    fsrResistance /= fsrVoltage;
    Serial.print("FSR Wiederstand in Ohm = ");
    Serial.println(fsrResistance);
 
    fsrConductance = 500000;           // we measure in micromhos so 
    fsrConductance /= fsrResistance;
    Serial.print("Conductance in microMhos: ");
    Serial.println(fsrConductance);
 
    // Mehrere lineare Gleichungen, um den Kraft zu approximieren. Auf Leitfähigkeit sind 10% mehr angesetzt und der Teiler 10% weniger

              //0.5   51
    if (fsrConductance <= 5) {
      fsrForce = fsrConductance / 10 ;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}

          //0.75      76.5
      else{if (fsrConductance <= 7.5) {
      fsrForce = fsrConductance / 10;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
         //1       101
      else{if (fsrConductance <= 15) {
      fsrForce = fsrConductance / 15;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //1,25       126,5
      else{if (fsrConductance <= 22.5) {
      fsrForce = fsrConductance / 18;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //1,5       152
      else{if (fsrConductance <= 27.5) {
      fsrForce = fsrConductance / 18.3;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
        //1,75       177,5
      else{if (fsrConductance <= 31.7) {
      fsrForce = fsrConductance / 18.1;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
         //2       203
      else{if (fsrConductance <= 35.5) {
      fsrForce = fsrConductance / 17.75;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //2,25       228,5
      else{if (fsrConductance <= 38) {
      fsrForce = fsrConductance / 16.8;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //2,5       254
      else{if (fsrConductance <= 46.5) {
      fsrForce = fsrConductance / 18.6;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //2,75       279,5
      else{if (fsrConductance <= 49.2) {
      fsrForce = fsrConductance / 17.89;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
        //3       305
      else{if (fsrConductance <= 54.3) {
      fsrForce = fsrConductance / 18.1;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
        //3,25       330,5
      else{if (fsrConductance <= 61) {
      fsrForce = fsrConductance / 18.77;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //3,5       356
      else{if (fsrConductance <= 63) {
      fsrForce = fsrConductance / 18;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //3,75       381,5
      else{if (fsrConductance <= 67.5) {
      fsrForce = fsrConductance / 18;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //4       407
      else{if (fsrConductance <= 69) {
      fsrForce = fsrConductance / 17.25;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //4,25       432,5
      else{if (fsrConductance <= 72.7) {
      fsrForce = fsrConductance / 17.1;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //4,5       458
      else{if (fsrConductance <= 83) {
      fsrForce = fsrConductance / 18.4;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //4,75       483,5
      else{if (fsrConductance <= 87) {
      fsrForce = fsrConductance / 18.3;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //5       509
      else{if (fsrConductance <= 88.5) {
      fsrForce = fsrConductance / 17.7;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //5,25       534,5
      else{if (fsrConductance <= 91.5) {
      fsrForce = fsrConductance / 17.4;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //5,5       560
      else{if (fsrConductance <= 93.5) {
      fsrForce = fsrConductance / 17;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //5,75       585,5
      else{if (fsrConductance <= 97) {
      fsrForce = fsrConductance / 16.8;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //6       611
      else{if (fsrConductance <= 98.5) {
      fsrForce = fsrConductance / 16.4;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //6,25       636,5
      else{if (fsrConductance <= 99) {
      fsrForce = fsrConductance / 15.84;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}

      //6,5       662
      else{if (fsrConductance <= 102.5) {
      fsrForce = fsrConductance / 15.77;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}

       //6,75       687,5
      else{if (fsrConductance <= 104.6) {
      fsrForce = fsrConductance / 15.5;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
        //7       713
      else{if (fsrConductance <= 105.5) {
      fsrForce = fsrConductance / 15.07;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
         //7,25       738,5
      else{if (fsrConductance <= 112) {
      fsrForce = fsrConductance / 15.45;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //7,5       764
      else{if (fsrConductance <= 112.5) {
      fsrForce = fsrConductance / 15;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //7,75       789,5
      else{if (fsrConductance <= 114) {
      fsrForce = fsrConductance / 14.71;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //8       815
      else{if (fsrConductance <= 115) {
      fsrForce = fsrConductance / 14.37;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //8,25       840,5
      else{if (fsrConductance <= 116.6) {
      fsrForce = fsrConductance / 14.13;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
        //8,5       866
      else{if (fsrConductance <= 117.7) {
      fsrForce = fsrConductance / 13.85;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //8,75       891,5
      else{if (fsrConductance <= 119) {
      fsrForce = fsrConductance / 13.6;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //9       917
      else{if (fsrConductance <= 120) {
      fsrForce = fsrConductance / 13.33;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //9,25       942,5
      else{if (fsrConductance <= 120.5) {
      fsrForce = fsrConductance / 13.03;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //9,5       968
      else{if (fsrConductance <= 121) {
      fsrForce = fsrConductance / 12.73;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //9,75       993,5
      else{if (fsrConductance <= 122.8) {
      fsrForce = fsrConductance / 12.59;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //10       1019
      else{if (fsrConductance <= 124) {
      fsrForce = fsrConductance / 12.4;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      
     
      
      
   

          




           }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
           
    
  
  }
  Serial.println("--------------------");
  delay(2000);
  }

So mein Gutster,

Du hast Dir ein schönes Ei gelegt und das zieht sich natürlich durch.
beim analogWert > 720 ist Schluss...

 -> --------------------
 -> Analog reading = 720.00	Voltage reading in mV = 3519.00
 -> FSR Wiederstand in Ohm = 4208.58	Conductance in microMhos: 118.80
 -> Gewichtskraft in Newton: 8.7357
 -> Gewicht in gramm: 890.4843
 -> --------------------
 -> Analog reading = 730.00	Voltage reading in mV = 3567.00
 -> FSR Wiederstand in Ohm = 4017.38	Conductance in microMhos: 124.46
 -> --------------------
 -> Analog reading = 740.00	Voltage reading in mV = 3616.00
 -> FSR Wiederstand in Ohm = 3827.43	Conductance in microMhos: 130.64
 -> --------------------
 -> Analog reading = 750.00	Voltage reading in mV = 3665.00
 -> FSR Wiederstand in Ohm = 3642.56	Conductance in microMhos: 137.27
 -> --------------------

Also geht nur Auswertung bis 3,519V.
Durch Deine Schachtelei fällt Dir das nicht auf - ich bin aber drüber gestolpert, weil sich der Druckwert nicht mehr geändert hat und die Ausgabe damit falsch ist:

21:24:14.152 -> --------------------
21:24:14.152 -> Analog reading = 710	Voltage reading in mV = 3470
21:24:14.152 -> FSR Wiederstand in Ohm = 4409.22	Conductance in microMhos: 113.40
21:24:14.185 -> Gewichtskraft in Newton: 7.7090
21:24:14.185 -> Gewicht in gramm: 785.8260
21:24:14.185 -> --------------------
21:24:14.185 -> Analog reading = 720	Voltage reading in mV = 3519
21:24:14.185 -> FSR Wiederstand in Ohm = 4208.58	Conductance in microMhos: 118.80
21:24:14.185 -> Gewichtskraft in Newton: 8.7357
21:24:14.185 -> Gewicht in gramm: 890.4843
21:24:14.185 -> --------------------
21:24:14.219 -> Analog reading = 730	Voltage reading in mV = 3567
21:24:14.219 -> FSR Wiederstand in Ohm = 4017.38	Conductance in microMhos: 124.46
21:24:14.219 -> Gewichtskraft in Newton: 8.7357
21:24:14.219 -> Gewicht in gramm: 890.4843
21:24:14.219 -> --------------------
21:24:14.219 -> Analog reading = 740	Voltage reading in mV = 3616
21:24:14.219 -> FSR Wiederstand in Ohm = 3827.43	Conductance in microMhos: 130.64
21:24:14.252 -> Gewichtskraft in Newton: 8.7357
21:24:14.252 -> Gewicht in gramm: 890.4843
21:24:14.252 -> --------------------
21:24:14.252 -> Analog reading = 750	Voltage reading in mV = 3665
21:24:14.252 -> FSR Wiederstand in Ohm = 3642.56	Conductance in microMhos: 137.27
21:24:14.252 -> Gewichtskraft in Newton: 8.7357
21:24:14.252 -> Gewicht in gramm: 890.4843
21:24:14.252 -> --------------------

Also kommt noch eine Abbruchbedingung dazu und etwas drumrum.
Es wird.

Hast Du es selbst an einem FSR ausprobiert? :thinking: :slightly_smiling_face:.
Ja ich weiß... das war mir auch schon so klar mit der Verschachtelung. Was bedeutet Abbruchbedingung? Also gibst noch Hoffnung?

Ich simuliere einen.

Ja.

Vielleicht 20 Minuten.

So, kannst Du mal bitte den einmal durchlaufen lassen und dann Zeile 23

  static unsigned int tik = 0;                             // Simulationsvariable

und Zeile 27

  fsrReading = tik; tik += 10; if (tik >= 1023) while (1); //simuliere den analogwert und breche nach einem Durchlauf ab

auskommentieren und Deinen Druck manuell auf 0 tickern?

Wenn das geht, dann kommt der Rest hinterher:

const byte fsrPin = 0;     // the FSR and 10K pulldown are connected to a0
unsigned int fsrReading;     // the analog reading from the FSR resistor divider
unsigned int fsrVoltage;     // the analog reading converted to voltage
float fsrResistance;  // The voltage converted to resistance, can be very big so make "long"
float fsrConductance;
float fsrForce;       // Finally, the resistance converted to force
float fsrweight;
void setup(void)
{
  Serial.begin(115200);   // We'll send debugging information via the Serial monitor
  Serial.println(F("Start..."));
}

void loop(void)
{
  readSensors ();
  rechneSensors();
  delay(10);
}

void readSensors ()
{
  static unsigned int tik = 0;                             // Simulationsvariable
  //  for (byte i = 0; i < Sensoranzahl; i++)
  //  {
  fsrReading = analogRead(fsrPin);
  fsrReading = tik; tik += 10; if (tik >= 1023) while (1); //simuliere den analogwert und breche nach einem Durchlauf ab
  Serial.print(F("Analog reading = "));
  Serial.print(fsrReading);
  // analog voltage reading ranges from about 0 to 1023 which maps to 0V to 5V (= 5000mV)
  fsrVoltage = map(fsrReading, 0, 1023, 0, 5000);
  Serial.print(F("\tVoltage reading in mV = "));
  Serial.println(fsrVoltage);
  //  }
}
void rechneSensors()
{
  if (fsrVoltage == 0)
  {
    Serial.println(F("No pressure"));
  }
  else
  {
    // The voltage = Vcc * R / (R + FSR) where R = 10K and Vcc = 5V
    // so FSR = ((Vcc - V) * R) / V        yay math!
    fsrResistance = 5000 - fsrVoltage;     // fsrVoltage is in millivolts so 5V = 5000mV
    fsrResistance *= 10000;                // 10K resistor
    fsrResistance /= fsrVoltage;
    Serial.print(F("FSR Widerstand in Ohm = "));
    Serial.print(fsrResistance);
    fsrConductance = 500000;           // we measure in micromhos so
    fsrConductance /= fsrResistance;
    Serial.print(F("\tConductance in microMhos: "));
    Serial.println(fsrConductance);
    korrekturSensor();
  }
}
void korrekturSensor()
{
  // Mehrere lineare Gleichungen, um den Kraft zu approximieren. Auf Leitfähigkeit sind 10% mehr angesetzt und der Teiler 10% weniger
  //0.5   51
  if (fsrConductance <= 5)         fsrForce = fsrConductance / 10 ;
  //0.75      76.5
  else if (fsrConductance <= 7.5)  fsrForce = fsrConductance / 10;
  //1       101
  else if (fsrConductance <= 15)   fsrForce = fsrConductance / 15;
  //1,25       126,5
  else if (fsrConductance <= 22.5) fsrForce = fsrConductance / 18;
  //1,5       152
  else if (fsrConductance <= 27.5) fsrForce = fsrConductance / 18.3;
  //1,75       177,5
  else if (fsrConductance <= 31.7) fsrForce = fsrConductance / 18.1;
  //2       203
  else if (fsrConductance <= 35.5) fsrForce = fsrConductance / 17.75;
  //2,25       228,5
  else if (fsrConductance <= 38)   fsrForce = fsrConductance / 16.8;
  //2,5       254
  else if (fsrConductance <= 46.5) fsrForce = fsrConductance / 18.6;
  //2,75       279,5
  else if (fsrConductance <= 49.2) fsrForce = fsrConductance / 17.89;
  //3       305
  else if (fsrConductance <= 54.3) fsrForce = fsrConductance / 18.1;
  //3,25       330,5
  else if (fsrConductance <= 61)   fsrForce = fsrConductance / 18.77;
  //3,5       356
  else if (fsrConductance <= 63)   fsrForce = fsrConductance / 18;
  //3,75       381,5
  else if (fsrConductance <= 67.5) fsrForce = fsrConductance / 18;
  //4       407
  else if (fsrConductance <= 69)   fsrForce = fsrConductance / 17.25;
  //4,25       432,5
  else if (fsrConductance <= 72.7) fsrForce = fsrConductance / 17.1;
  //4,5       458
  else if (fsrConductance <= 83)   fsrForce = fsrConductance / 18.4;
  //4,75       483,5
  else if (fsrConductance <= 87)   fsrForce = fsrConductance / 18.3;
  //5       509
  else if (fsrConductance <= 88.5) fsrForce = fsrConductance / 17.7;
  //5,25       534,5
  else if (fsrConductance <= 91.5) fsrForce = fsrConductance / 17.4;
  //5,5       560
  else if (fsrConductance <= 93.5) fsrForce = fsrConductance / 17;
  //5,75       585,5
  else if (fsrConductance <= 97)   fsrForce = fsrConductance / 16.8;
  //6       611
  else if (fsrConductance <= 98.5) fsrForce = fsrConductance / 16.4;
  //6,25       636,5
  else if (fsrConductance <= 99)   fsrForce = fsrConductance / 15.84;
  //6,5       662
  else if (fsrConductance <= 102.5)fsrForce = fsrConductance / 15.77;
  //6,75       687,5
  else if (fsrConductance <= 104.6)fsrForce = fsrConductance / 15.5;
  //7       713
  else if (fsrConductance <= 105.5)fsrForce = fsrConductance / 15.07;
  //7,25       738,5
  else if (fsrConductance <= 112)  fsrForce = fsrConductance / 15.45;
  //7,5       764
  else if (fsrConductance <= 112.5)fsrForce = fsrConductance / 15;
  //7,75       789,5
  else if (fsrConductance <= 114)  fsrForce = fsrConductance / 14.71;
  //8       815
  else if (fsrConductance <= 115)  fsrForce = fsrConductance / 14.37;
  //8,25       840,5
  else if (fsrConductance <= 116.6)fsrForce = fsrConductance / 14.13;
  //8,5       866
  else if (fsrConductance <= 117.7)fsrForce = fsrConductance / 13.85;
  //8,75       891,5
  else if (fsrConductance <= 119)  fsrForce = fsrConductance / 13.6;
  //9       917
  else if (fsrConductance <= 120)  fsrForce = fsrConductance / 13.33;
  //9,25       942,5
  else if (fsrConductance <= 120.5)fsrForce = fsrConductance / 13.03;
  //9,5       968
  else if (fsrConductance <= 121)  fsrForce = fsrConductance / 12.73;
  //9,75       993,5
  else if (fsrConductance <= 122.8)fsrForce = fsrConductance / 12.59;
  //10       1019
  else if (fsrConductance <= 124)  fsrForce = fsrConductance / 12.4;
  else
  {
    return;
  }
  serialSensors();
  Serial.println(F("--------------------"));
}

void serialSensors()
{
  fsrweight =    fsrForce / 9.81 * 1000 ;
  Serial.print(F("Gewichtskraft in Newton: "));
  Serial.println(fsrForce, 4);
  Serial.print(F("Gewicht in gramm: "));
  Serial.println(fsrweight, 4);
}

Warte kurz....

Das ist passiert ohne änderung.
Jetzt kommentiere ich aus

Start...
Analog reading = 0	Voltage reading856.25
 2162.39
Analog reading = 1010	Voltage reading in mV = 4936
FSR Widerstand in Ohm = 129.66	Conductance in microMhos: 3856.25
 2162.39
Analog reading = 1010	Voltage reading in mV = 4936
FSR Widerstand in Ohm = 129.66	Conductance in microMhos: 3856.25
Start...
Analog reading = 0	Voltage reading in mV = 0
No pressure
Analog reading = 10	Voltage reading in mV = 48
FSR Widerstand in Ohm = 1031666.68	Conductance in microMhos: 0.48
Gewichtskraft in Newton: 0.0485
Gewicht in gramm: 4.9404
--------------------
Analog reading = 20	Voltage reading in mV = 97
FSR Widerstand in Ohm = 505463.90	Conductance in microMhos: 0.99
Gewichtskraft in Newton: 0.0989
Gewicht in gramm: 10.0835
--------------------
Analog reading = 30	Voltage reading in mV = 146
FSR Widerstand in Ohm = 332465.75	Conductance in microMhos: 1.50
Gewichtskraft in Newton: 0.1504
Gewicht in gramm: 15.3304
--------------------
Analog reading = 40	Voltage reading in mV = 195
FSR Widerstand in Ohm = 246410.25	Conductance in microMhos: 2.03
Gewichtskraft in Newton: 0.2029
Gewicht in gramm: 20.6844
--------------------
Analog reading = 50	Voltage reading in mV = 244
FSR Widerstand in Ohm = 194918.03	Conductance in microMhos: 2.57
Gewichtskraft in Newton: 0.2565
Gewicht in gramm: 26.1486
--------------------
Analog reading = 60	Voltage reading in mV = 293
FSR Widerstand in Ohm = 160648.46	Conductance in microMhos: 3.11
Gewichtskraft in Newton: 0.3112
Gewicht in gramm: 31.7267
--------------------
Analog reading = 70	Voltage reading in mV = 342
FSR Widerstand in Ohm = 136198.82	Conductance in microMhos: 3.67
Gewichtskraft in Newton: 0.3671
Gewicht in gramm: 37.4221
--------------------
Analog reading = 80	Voltage reading in mV = 391
FSR Widerstand in Ohm = 117877.24	Conductance in microMhos: 4.24
Gewichtskraft in Newton: 0.4242
Gewicht in gramm: 43.2385
--------------------
Analog reading = 90	Voltage reading in mV = 439
FSR Widerstand in Ohm = 103895.22	Conductance in microMhos: 4.81
Gewichtskraft in Newton: 0.4813
Gewicht in gramm: 49.0575
--------------------
Analog reading = 100	Voltage reading in mV = 488
FSR Widerstand in Ohm = 92459.02	Conductance in microMhos: 5.41
Gewichtskraft in Newton: 0.5408
Gewicht in gramm: 55.1254
--------------------
Analog reading = 110	Voltage reading in mV = 537
FSR Widerstand in Ohm = 83109.87	Conductance in microMhos: 6.02
Gewichtskraft in Newton: 0.6016
Gewicht in gramm: 61.3265
--------------------
Analog reading = 120	Voltage reading in mV = 586
FSR Widerstand in Ohm = 75324.24	Conductance in microMhos: 6.64
Gewichtskraft in Newton: 0.6638
Gewicht in gramm: 67.6653
--------------------
Analog reading = 130	Voltage reading in mV = 635
FSR Widerstand in Ohm = 68740.16	Conductance in microMhos: 7.27
Gewichtskraft in Newton: 0.7274
Gewicht in gramm: 74.1465
--------------------
Analog reading = 140	Voltage reading in mV = 684
FSR Widerstand in Ohm = 63099.41	Conductance in microMhos: 7.92
Gewichtskraft in Newton: 0.5283
Gewicht in gramm: 53.8498
--------------------
Analog reading = 150	Voltage reading in mV = 733
FSR Widerstand in Ohm = 58212.82	Conductance in microMhos: 8.59
Gewichtskraft in Newton: 0.5726
Gewicht in gramm: 58.3702
--------------------
Analog reading = 160	Voltage reading in mV = 782
FSR Widerstand in Ohm = 53938.62	Conductance in microMhos: 9.27
Gewichtskraft in Newton: 0.6180
Gewicht in gramm: 62.9956
--------------------
Analog reading = 170	Voltage reading in mV = 830
FSR Widerstand in Ohm = 50240.96	Conductance in microMhos: 9.95
Gewichtskraft in Newton: 0.6635
Gewicht in gramm: 67.6319
--------------------
Analog reading = 180	Voltage reading in mV = 879
FSR Widerstand in Ohm = 46882.82	Conductance in microMhos: 10.66
Gewichtskraft in Newton: 0.7110
Gewicht in gramm: 72.4763
--------------------
Analog reading = 190	Voltage reading in mV = 928
FSR Widerstand in Ohm = 43879.31	Conductance in microMhos: 11.39
Gewichtskraft in Newton: 0.7597
Gewicht in gramm: 77.4373
--------------------
Analog reading = 200	Voltage reading in mV = 977
FSR Widerstand in Ohm = 41177.07	Conductance in microMhos: 12.14
Gewichtskraft in Newton: 0.8095
Gewicht in gramm: 82.5191
--------------------
Analog reading = 210	Voltage reading in mV = 1026
FSR Widerstand in Ohm = 38732.94	Conductance in microMhos: 12.91
Gewichtskraft in Newton: 0.8606
Gewicht in gramm: 87.7262
--------------------
Analog reading = 220	Voltage reading in mV = 1075
FSR Widerstand in Ohm = 36511.63	Conductance in microMhos: 13.69
Gewichtskraft in Newton: 0.9130
Gewicht in gramm: 93.0633
--------------------
Analog reading = 230	Voltage reading in mV = 1124
FSR Widerstand in Ohm = 34483.98	Conductance in microMhos: 14.50
Gewichtskraft in Newton: 0.9666
Gewicht in gramm: 98.5354
--------------------
Analog reading = 240	Voltage reading in mV = 1173
FSR Widerstand in Ohm = 32625.75	Conductance in microMhos: 15.33
Gewichtskraft in Newton: 0.8514
Gewicht in gramm: 86.7897
--------------------
Analog reading = 250	Voltage reading in mV = 1221
FSR Widerstand in Ohm = 30950.04	Conductance in microMhos: 16.16
Gewichtskraft in Newton: 0.8975
Gewicht in gramm: 91.4887
--------------------
Analog reading = 260	Voltage reading in mV = 1270
FSR Widerstand in Ohm = 29370.08	Conductance in microMhos: 17.02
Gewichtskraft in Newton: 0.9458
Gewicht in gramm: 96.4103
--------------------
Analog reading = 270	Voltage reading in mV = 1319
FSR Widerstand in Ohm = 27907.51	Conductance in microMhos: 17.92
Gewichtskraft in Newton: 0.9954
Gewicht in gramm: 101.4629
--------------------
Analog reading = 280	Voltage reading in mV = 1368
FSR Widerstand in Ohm = 26549.71	Conductance in microMhos: 18.83
Gewichtskraft in Newton: 1.0463
Gewicht in gramm: 106.6519
--------------------
Analog reading = 290	Voltage reading in mV = 1417
FSR Widerstand in Ohm = 25285.82	Conductance in microMhos: 19.77
Gewichtskraft in Newton: 1.0986
Gewicht in gramm: 111.9829
--------------------
Analog reading = 300	Voltage reading in mV = 1466
FSR Widerstand in Ohm = 24106.41	Conductance in microMhos: 20.74
Gewichtskraft in Newton: 1.1523
Gewicht in gramm: 117.4616
--------------------
Analog reading = 310	Voltage reading in mV = 1515
FSR Widerstand in Ohm = 23003.30	Conductance in microMhos: 21.74
Gewichtskraft in Newton: 1.2076
Gewicht in gramm: 123.0944
--------------------
Analog reading = 320	Voltage reading in mV = 1564
FSR Widerstand in Ohm = 21969.31	Conductance in microMhos: 22.76
Gewichtskraft in Newton: 1.2437
Gewicht in gramm: 126.7750
--------------------
Analog reading = 330	Voltage reading in mV = 1612
FSR Widerstand in Ohm = 21017.37	Conductance in microMhos: 23.79
Gewichtskraft in Newton: 1.3000
Gewicht in gramm: 132.5170
--------------------
Analog reading = 340	Voltage reading in mV = 1661
FSR Widerstand in Ohm = 20102.35	Conductance in microMhos: 24.87
Gewichtskraft in Newton: 1.3592
Gewicht in gramm: 138.5489
--------------------
Analog reading = 350	Voltage reading in mV = 1710
FSR Widerstand in Ohm = 19239.77	Conductance in microMhos: 25.99
Gewichtskraft in Newton: 1.4201
Gewicht in gramm: 144.7605
--------------------
Analog reading = 360	Voltage reading in mV = 1759
FSR Widerstand in Ohm = 18425.24	Conductance in microMhos: 27.14
Gewichtskraft in Newton: 1.4829
Gewicht in gramm: 151.1599
--------------------
Analog reading = 370	Voltage reading in mV = 1808
FSR Widerstand in Ohm = 17654.87	Conductance in microMhos: 28.32
Gewichtskraft in Newton: 1.5647
Gewicht in gramm: 159.4990
--------------------
Analog reading = 380	Voltage reading in mV = 1857
FSR Widerstand in Ohm = 16925.15	Conductance in microMhos: 29.54
Gewichtskraft in Newton: 1.6321
Gewicht in gramm: 166.3757
--------------------
Analog reading = 390	Voltage reading in mV = 1906
FSR Widerstand in Ohm = 16232.95	Conductance in microMhos: 30.80
Gewichtskraft in Newton: 1.7017
Gewicht in gramm: 173.4702
--------------------
Analog reading = 400	Voltage reading in mV = 1955
FSR Widerstand in Ohm = 15575.45	Conductance in microMhos: 32.10
Gewichtskraft in Newton: 1.8086
Gewicht in gramm: 184.3580
--------------------
Analog reading = 410	Voltage reading in mV = 2003
FSR Widerstand in Ohm = 14962.56	Conductance in microMhos: 33.42
Gewichtskraft in Newton: 1.8826
Gewicht in gramm: 191.9096
--------------------
Analog reading = 420	Voltage reading in mV = 2052
FSR Widerstand in Ohm = 14366.47	Conductance in microMhos: 34.80
Gewichtskraft in Newton: 1.9607
Gewicht in gramm: 199.8722
--------------------
Analog reading = 430	Voltage reading in mV = 2101
FSR Widerstand in Ohm = 13798.19	Conductance in microMhos: 36.24
Gewichtskraft in Newton: 2.1569
Gewicht in gramm: 219.8718
--------------------
Analog reading = 440	Voltage reading in mV = 2150
FSR Widerstand in Ohm = 13255.81	Conductance in microMhos: 37.72
Gewichtskraft in Newton: 2.2452
Gewicht in gramm: 228.8681
--------------------
Analog reading = 450	Voltage reading in mV = 2199
FSR Widerstand in Ohm = 12737.61	Conductance in microMhos: 39.25
Gewichtskraft in Newton: 2.1104
Gewicht in gramm: 215.1296
--------------------
Analog reading = 460	Voltage reading in mV = 2248
FSR Widerstand in Ohm = 12241.99	Conductance in microMhos: 40.84
Gewichtskraft in Newton: 2.1959
Gewicht in gramm: 223.8391
--------------------
Analog reading = 470	Voltage reading in mV = 2297
FSR Widerstand in Ohm = 11767.52	Conductance in microMhos: 42.49
Gewichtskraft in Newton: 2.2844
Gewicht in gramm: 232.8643
--------------------
Analog reading = 480	Voltage reading in mV = 2346
FSR Widerstand in Ohm = 11312.87	Conductance in microMhos: 44.20
Gewichtskraft in Newton: 2.3762
Gewicht in gramm: 242.2228
--------------------
Analog reading = 490	Voltage reading in mV = 2394
FSR Widerstand in Ohm = 10885.55	Conductance in microMhos: 45.93
Gewichtskraft in Newton: 2.4695
Gewicht in gramm: 251.7316
--------------------
Analog reading = 500	Voltage reading in mV = 2443
FSR Widerstand in Ohm = 10466.64	Conductance in microMhos: 47.77
Gewichtskraft in Newton: 2.6703
Gewicht in gramm: 272.1971
--------------------
Analog reading = 510	Voltage reading in mV = 2492
FSR Widerstand in Ohm = 10064.20	Conductance in microMhos: 49.68
Gewichtskraft in Newton: 2.7448
Gewicht in gramm: 279.7969
--------------------
Analog reading = 520	Voltage reading in mV = 2541
FSR Widerstand in Ohm = 9677.29	Conductance in microMhos: 51.67
Gewichtskraft in Newton: 2.8545
Gewicht in gramm: 290.9836
--------------------
Analog reading = 530	Voltage reading in mV = 2590
FSR Widerstand in Ohm = 9305.02	Conductance in microMhos: 53.73
Gewichtskraft in Newton: 2.9688
Gewicht in gramm: 302.6253
--------------------
Analog reading = 540	Voltage reading in mV = 2639
FSR Widerstand in Ohm = 8946.57	Conductance in microMhos: 55.89
Gewichtskraft in Newton: 2.9775
Gewicht in gramm: 303.5150
--------------------
Analog reading = 550	Voltage reading in mV = 2688
FSR Widerstand in Ohm = 8601.19	Conductance in microMhos: 58.13
Gewichtskraft in Newton: 3.0970
Gewicht in gramm: 315.7026
--------------------
Analog reading = 560	Voltage reading in mV = 2737
FSR Widerstand in Ohm = 8268.18	Conductance in microMhos: 60.47
Gewichtskraft in Newton: 3.2218
Gewicht in gramm: 328.4180
--------------------
Analog reading = 570	Voltage reading in mV = 2785
FSR Widerstand in Ohm = 7953.32	Conductance in microMhos: 62.87
Gewichtskraft in Newton: 3.4926
Gewicht in gramm: 356.0245
--------------------
Analog reading = 580	Voltage reading in mV = 2834
FSR Widerstand in Ohm = 7642.91	Conductance in microMhos: 65.42
Gewichtskraft in Newton: 3.6345
Gewicht in gramm: 370.4844
--------------------
Analog reading = 590	Voltage reading in mV = 2883
FSR Widerstand in Ohm = 7343.05	Conductance in microMhos: 68.09
Gewichtskraft in Newton: 3.9473
Gewicht in gramm: 402.3793
--------------------
Analog reading = 600	Voltage reading in mV = 2932
FSR Widerstand in Ohm = 7053.21	Conductance in microMhos: 70.89
Gewichtskraft in Newton: 4.1456
Gewicht in gramm: 422.5891
--------------------
Analog reading = 610	Voltage reading in mV = 2981
FSR Widerstand in Ohm = 6772.89	Conductance in microMhos: 73.82
Gewichtskraft in Newton: 4.0122
Gewicht in gramm: 408.9864
--------------------
Analog reading = 620	Voltage reading in mV = 3030
FSR Widerstand in Ohm = 6501.65	Conductance in microMhos: 76.90
Gewichtskraft in Newton: 4.1795
Gewicht in gramm: 426.0490
--------------------
Analog reading = 630	Voltage reading in mV = 3079
FSR Widerstand in Ohm = 6239.04	Conductance in microMhos: 80.14
Gewichtskraft in Newton: 4.3555
Gewicht in gramm: 443.9821
--------------------
Analog reading = 640	Voltage reading in mV = 3128
FSR Widerstand in Ohm = 5984.65	Conductance in microMhos: 83.55
Gewichtskraft in Newton: 4.5654
Gewicht in gramm: 465.3833
--------------------
Analog reading = 650	Voltage reading in mV = 3176
FSR Widerstand in Ohm = 5743.07	Conductance in microMhos: 87.06
Gewichtskraft in Newton: 4.9187
Gewicht in gramm: 501.3989
--------------------
Analog reading = 660	Voltage reading in mV = 3225
FSR Widerstand in Ohm = 5503.88	Conductance in microMhos: 90.85
Gewichtskraft in Newton: 5.2210
Gewicht in gramm: 532.2100
--------------------
Analog reading = 670	Voltage reading in mV = 3274
FSR Widerstand in Ohm = 5271.84	Conductance in microMhos: 94.84
Gewichtskraft in Newton: 5.6455
Gewicht in gramm: 575.4791
--------------------
Analog reading = 680	Voltage reading in mV = 3323
FSR Widerstand in Ohm = 5046.64	Conductance in microMhos: 99.08
Gewichtskraft in Newton: 6.2825
Gewicht in gramm: 640.4225
--------------------
Analog reading = 690	Voltage reading in mV = 3372
FSR Widerstand in Ohm = 4828.00	Conductance in microMhos: 103.56
Gewichtskraft in Newton: 6.6815
Gewicht in gramm: 681.0868
--------------------
Analog reading = 700	Voltage reading in mV = 3421
FSR Widerstand in Ohm = 4615.61	Conductance in microMhos: 108.33
Gewichtskraft in Newton: 7.0115
Gewicht in gramm: 714.7324
--------------------
Analog reading = 710	Voltage reading in mV = 3470
FSR Widerstand in Ohm = 4409.22	Conductance in microMhos: 113.40
Gewichtskraft in Newton: 7.7090
Gewicht in gramm: 785.8260
--------------------
Analog reading = 720	Voltage reading in mV = 3519
FSR Widerstand in Ohm = 4208.58	Conductance in microMhos: 118.80
Gewichtskraft in Newton: 8.7357
Gewicht in gramm: 890.4843
--------------------
Analog reading = 730	Voltage reading in mV = 3567
FSR Widerstand in Ohm = 4017.38	Conductance in microMhos: 124.46
Analog reading = 740	Voltage reading in mV = 3616
FSR Widerstand in Ohm = 3827.43	Conductance in microMhos: 130.64
Analog reading = 750	Voltage reading in mV = 3665
FSR Widerstand in Ohm = 3642.56	Conductance in microMhos: 137.27
Analog reading = 760	Voltage reading in mV = 3714
FSR Widerstand in Ohm = 3462.57	Conductance in microMhos: 144.40
Analog reading = 770	Voltage reading in mV = 3763
FSR Widerstand in Ohm = 3287.27	Conductance in microMhos: 152.10
Analog reading = 780	Voltage reading in mV = 3812
FSR Widerstand in Ohm = 3116.47	Conductance in microMhos: 160.44
Analog reading = 790	Voltage reading in mV = 3861
FSR Widerstand in Ohm = 2950.01	Conductance in microMhos: 169.49
Analog reading = 800	Voltage reading in mV = 3910
FSR Widerstand in Ohm = 2787.72	Conductance in microMhos: 179.36
Analog reading = 810	Voltage reading in mV = 3958
FSR Widerstand in Ohm = 2632.64	Conductance in microMhos: 189.92
Analog reading = 820	Voltage reading in mV = 4007
FSR Widerstand in Ohm = 2478.16	Conductance in microMhos: 201.76
Analog reading = 830	Voltage reading in mV = 4056
FSR Widerstand in Ohm = 2327.42	Conductance in microMhos: 214.83
Analog reading = 840	Voltage reading in mV = 4105
FSR Widerstand in Ohm = 2180.27	Conductance in microMhos: 229.33
Analog reading = 850	Voltage reading in mV = 4154
FSR Widerstand in Ohm = 2036.59	Conductance in microMhos: 245.51
Analog reading = 860	Voltage reading in mV = 4203
FSR Widerstand in Ohm = 1896.26	Conductance in microMhos: 263.68
Analog reading = 870	Voltage reading in mV = 4252
FSR Widerstand in Ohm = 1759.17	Conductance in microMhos: 284.22
Analog reading = 880	Voltage reading in mV = 4301
FSR Widerstand in Ohm = 1625.20	Conductance in microMhos: 307.65
Analog reading = 890	Voltage reading in mV = 4349
FSR Widerstand in Ohm = 1496.90	Conductance in microMhos: 334.02
Analog reading = 900	Voltage reading in mV = 4398
FSR Widerstand in Ohm = 1368.80	Conductance in microMhos: 365.28
Analog reading = 910	Voltage reading in mV = 4447
FSR Widerstand in Ohm = 1243.53	Conductance in microMhos: 402.08
Analog reading = 920	Voltage reading in mV = 4496
FSR Widerstand in Ohm = 1121.00	Conductance in microMhos: 446.03
Analog reading = 930	Voltage reading in mV = 4545
FSR Widerstand in Ohm = 1001.10	Conductance in microMhos: 499.45
Analog reading = 940	Voltage reading in mV = 4594
FSR Widerstand in Ohm = 883.76	Conductance in microMhos: 565.76
Analog reading = 950	Voltage reading in mV = 4643
FSR Widerstand in Ohm = 768.90	Conductance in microMhos: 650.28
Analog reading = 960	Voltage reading in mV = 4692
FSR Widerstand in Ohm = 656.44	Conductance in microMhos: 761.69
Analog reading = 970	Voltage reading in mV = 4740
FSR Widerstand in Ohm = 548.52	Conductance in microMhos: 911.54
Analog reading = 980	Voltage reading in mV = 4789
FSR Widerstand in Ohm = 440.59	Conductance in microMhos: 1134.83
Analog reading = 990	Voltage reading in mV = 4838
FSR Widerstand in Ohm = 334.85	Conductance in microMhos: 1493.21
Analog reading = 1000	Voltage reading in mV = 4887
FSR Widerstand in Ohm = 231.23	Conductance in microMhos: 2162.39
Analog reading = 1010	Voltage reading in mV = 4936
FSR Widerstand in Ohm = 129.66	Conductance in microMhos: 3856.25

1 Like

Der zieht ganz schön durch, aber sieht ganz gut aus. Liegt bestimmt am delay. Er macht erst mal nur den ersten Sensor. Die anderen registriert er nicht.

nalog reading = 505	Voltage reading in mV = 2468
FSR Widerstand in Ohm = 10259.32	Conductance in microMhos: 48.74
Gewichtskraft in Newton: 2.7242
Gewicht in gramm: 277.6976
--------------------
Analog reading = 409	Voltage reading in mV = 1999
FSR Widerstand in Ohm = 15012.51	Conductance in microMhos: 33.31
Gewichtskraft in Newton: 1.8764
Gewicht in gramm: 191.2711
--------------------
Analog reading = 412	Voltage reading in mV = 2013
FSR Widerstand in Ohm = 14838.55	Conductance in microMhos: 33.70
Gewichtskraft in Newton: 1.8984
Gewicht in gramm: 193.5135
--------------------
Analog reading = 518	Voltage reading in mV = 2531
FSR Widerstand in Ohm = 9755.04	Conductance in microMhos: 51.26
Gewichtskraft in Newton: 2.8318
Gewicht in gramm: 288.6646
--------------------
Analog reading = 562	Voltage reading in mV = 2746
FSR Widerstand in Ohm = 8208.30	Conductance in microMhos: 60.91
Gewichtskraft in Newton: 3.2453
Gewicht in gramm: 330.8136
--------------------
Analog reading = 562	Voltage reading in mV = 2746
FSR Widerstand in Ohm = 8208.30	Conductance in microMhos: 60.91
Gewichtskraft in Newton: 3.2453
Gewicht in gramm: 330.8136
--------------------
Analog reading = 508	Voltage reading in mV = 2482
FSR Widerstand in Ohm = 10145.04	Conductance in microMhos: 49.29
Gewichtskraft in Newton: 2.7229
Gewicht in gramm: 277.5674
--------------------
Analog reading = 429	Voltage reading in mV = 2096
FSR Widerstand in Ohm = 13854.96	Conductance in microMhos: 36.09
Gewichtskraft in Newton: 2.1481
Gewicht in gramm: 218.9709
--------------------
Analog reading = 303	Voltage reading in mV = 1480
FSR Widerstand in Ohm = 23783.78	Conductance in microMhos: 21.02
Gewichtskraft in Newton: 1.1679
Gewicht in gramm: 119.0550
--------------------
Analog reading = 135	Voltage reading in mV = 659
FSR Widerstand in Ohm = 65872.53	Conductance in microMhos: 7.59
Gewichtskraft in Newton: 0.5060
Gewicht in gramm: 51.5829
--------------------
Analog reading = 27	Voltage reading in mV = 131

Ja, das war beabsichtigt.
Damit ist jetzt geklärt, das die Geschichte funktioniert - Und ja, wenn es Dir zu schnell ist, dann das delay() einfach grösser machen.

Nu geh ich mal ans Eingemachte.
Und das wäre auch für Dich die richtige Reihenfolge gewesen - erst sehen, das alles (im aufgeteilten Zustand) geht und dann daraus ein array bauen.

Na mal schaun - halbe Stunde habe ich noch.

Ich melde mich erst mal aus dem Funkkreis ab. Oh man.. Ich bin Euch total dankbar :pray:. Ich reiße das Gerät gleich morgen auf Arbeit wieder an.
Ich wünsche eine gute Nacht!!

Dann hier der aktuelle Zwischenstand - Basis ist das funktionierende mit einem PIN.

Wenn Du Zeile 1 auskommentierst, geht der Rest automatisch - also Abfrage und Auswertung aller Pin.

Das ist jetzt die Variante mit float UND dem Ausstieg, wenn der Wert für das Gewicht nicht mehr errechnet wird.
Deine Kommentare passen dafür nicht. Du musst unbedingt in korrekturSensor() die Kommentare anpassen und für die restlichen Werte ab 720 die Umsetzungstabelle errechnen!!!

Ich meine noch immer, das rechnen mit Ganzzahlen besser ist.
Na mal schaun.

#define SIMULATION

const byte fsrPins[] = {A0, A1, A2, A3, A4, A5, A6, A7, A8, A9}; // the FSR and 10K pulldown are connected to a0
#ifdef SIMULATION
  const byte sensorZahl = 1;
#else
  const byte sensorZahl = sizeof(fsrPins) / sizeof(fsrPins[0]);
#endif
unsigned int fsrReading[sensorZahl];     // the analog reading from the FSR resistor divider
unsigned int fsrVoltage[sensorZahl];     // the analog reading converted to voltage

float fsrResistance;  // The voltage converted to resistance, can be very big so make "long"
float fsrConductance;
float fsrForce;       // Finally, the resistance converted to force

void setup(void)
{
  Serial.begin(115200);   // We'll send debugging information via the Serial monitor
  Serial.println(F("Start..."));
}

void loop(void)
{
  readSensors ();
  rechneSensors();
#ifdef SIMULATION
  delay(100);
#else
  delay(2000);
#endif
}
unsigned int simulation(const byte b)
{
  static byte pin = 10;
  static unsigned int zaehler = 0;
  if (pin != b)
  {
    pin = b;
    zaehler = 0;
    return zaehler;
  }
  zaehler += 10;
  if (zaehler > 1023) zaehler = 0;
  return zaehler;
}
void readSensors()
{
  for (byte i = 0; i < sensorZahl; i++)
  {
    fsrReading[i] = analogRead(fsrPins[i]);
#ifdef SIMULATION
    fsrReading[i] = simulation(i);
#endif
    Serial.print(F("Analog reading Port "));
    Serial.print(i);
    Serial.print(": ");
    Serial.print(fsrReading[i]);
    fsrVoltage[i] = map(fsrReading[i], 0, 1023, 0, 5000);
    Serial.print(F("\tVoltage reading in mV = "));
    Serial.println(fsrVoltage[i]);
  }
}
void rechneSensors()
{
  for (byte b = 0; b < sensorZahl; b++)
  {
    if (fsrVoltage[b] == 0)
    {
      Serial.println(F("No pressure"));
    }
    else
    {
      // The voltage = Vcc * R / (R + FSR) where R = 10K and Vcc = 5V
      // so FSR = ((Vcc - V) * R) / V        yay math!
      fsrResistance = 5000 - fsrVoltage[b];     // fsrVoltage is in millivolts so 5V = 5000mV
      fsrResistance *= 10000;                // 10K resistor
      fsrResistance /= fsrVoltage[b];
      Serial.print(F("FSR Widerstand in Ohm = "));
      Serial.print(fsrResistance);
      fsrConductance = 500000;           // we measure in micromhos so
      fsrConductance /= fsrResistance;
      Serial.print(F("\tConductance in microMhos: "));
      Serial.println(fsrConductance);
      korrekturSensor();
    }
  }
}
void korrekturSensor()
{
  // Mehrere lineare Gleichungen, um den Kraft zu approximieren. Auf Leitfähigkeit sind 10% mehr angesetzt und der Teiler 10% weniger
  //0.5   51
  if (fsrConductance <= 5)         fsrForce = fsrConductance / 10 ;
  //0.75      76.5
  else if (fsrConductance <= 7.5)  fsrForce = fsrConductance / 10;
  //1       101
  else if (fsrConductance <= 15)   fsrForce = fsrConductance / 15;
  //1,25       126,5
  else if (fsrConductance <= 22.5) fsrForce = fsrConductance / 18;
  //1,5       152
  else if (fsrConductance <= 27.5) fsrForce = fsrConductance / 18.3;
  //1,75       177,5
  else if (fsrConductance <= 31.7) fsrForce = fsrConductance / 18.1;
  //2       203
  else if (fsrConductance <= 35.5) fsrForce = fsrConductance / 17.75;
  //2,25       228,5
  else if (fsrConductance <= 38)   fsrForce = fsrConductance / 16.8;
  //2,5       254
  else if (fsrConductance <= 46.5) fsrForce = fsrConductance / 18.6;
  //2,75       279,5
  else if (fsrConductance <= 49.2) fsrForce = fsrConductance / 17.89;
  //3       305
  else if (fsrConductance <= 54.3) fsrForce = fsrConductance / 18.1;
  //3,25       330,5
  else if (fsrConductance <= 61)   fsrForce = fsrConductance / 18.77;
  //3,5       356
  else if (fsrConductance <= 63)   fsrForce = fsrConductance / 18;
  //3,75       381,5
  else if (fsrConductance <= 67.5) fsrForce = fsrConductance / 18;
  //4       407
  else if (fsrConductance <= 69)   fsrForce = fsrConductance / 17.25;
  //4,25       432,5
  else if (fsrConductance <= 72.7) fsrForce = fsrConductance / 17.1;
  //4,5       458
  else if (fsrConductance <= 83)   fsrForce = fsrConductance / 18.4;
  //4,75       483,5
  else if (fsrConductance <= 87)   fsrForce = fsrConductance / 18.3;
  //5       509
  else if (fsrConductance <= 88.5) fsrForce = fsrConductance / 17.7;
  //5,25       534,5
  else if (fsrConductance <= 91.5) fsrForce = fsrConductance / 17.4;
  //5,5       560
  else if (fsrConductance <= 93.5) fsrForce = fsrConductance / 17;
  //5,75       585,5
  else if (fsrConductance <= 97)   fsrForce = fsrConductance / 16.8;
  //6       611
  else if (fsrConductance <= 98.5) fsrForce = fsrConductance / 16.4;
  //6,25       636,5
  else if (fsrConductance <= 99)   fsrForce = fsrConductance / 15.84;
  //6,5       662
  else if (fsrConductance <= 102.5)fsrForce = fsrConductance / 15.77;
  //6,75       687,5
  else if (fsrConductance <= 104.6)fsrForce = fsrConductance / 15.5;
  //7       713
  else if (fsrConductance <= 105.5)fsrForce = fsrConductance / 15.07;
  //7,25       738,5
  else if (fsrConductance <= 112)  fsrForce = fsrConductance / 15.45;
  //7,5       764
  else if (fsrConductance <= 112.5)fsrForce = fsrConductance / 15;
  //7,75       789,5
  else if (fsrConductance <= 114)  fsrForce = fsrConductance / 14.71;
  //8       815
  else if (fsrConductance <= 115)  fsrForce = fsrConductance / 14.37;
  //8,25       840,5
  else if (fsrConductance <= 116.6)fsrForce = fsrConductance / 14.13;
  //8,5       866
  else if (fsrConductance <= 117.7)fsrForce = fsrConductance / 13.85;
  //8,75       891,5
  else if (fsrConductance <= 119)  fsrForce = fsrConductance / 13.6;
  //9       917
  else if (fsrConductance <= 120)  fsrForce = fsrConductance / 13.33;
  //9,25       942,5
  else if (fsrConductance <= 120.5)fsrForce = fsrConductance / 13.03;
  //9,5       968
  else if (fsrConductance <= 121)  fsrForce = fsrConductance / 12.73;
  //9,75       993,5
  else if (fsrConductance <= 122.8)fsrForce = fsrConductance / 12.59;
  //10       1019
  else if (fsrConductance <= 124)  fsrForce = fsrConductance / 12.4;
  else
  {
    return;
  }
  serialSensors();
  Serial.println(F("--------------------"));
}
void serialSensors()
{
  unsigned long fsrweight = fsrForce / 9.81 * 1000 ;
  Serial.print(F("Gewichtskraft in Newton: "));
  Serial.println(fsrForce, 4);
  Serial.print(F("Gewicht in gramm: "));
  Serial.println(fsrweight, 4);
}

Und in der Zeit gelegen :wink:

Guten Morgen,
ich sage Dir, Du hast Dir irgendwas eingefangen, was die Berechnerei verkackt.
Der Code aus #45 ist nur um eine Funktion erweitert, die den analogWert simuliert unddas delay() auf 200ms gesetzt - der Rest ist genauso geblieben.

/* FSR testing sketch. 
 
Connect one end of FSR to power, the other end to Analog 0.
Then connect one end of a 10K resistor from Analog 0 to ground 
 
For more information see www.ladyada.net/learn/sensors/fsr.html */
 
int fsrPin = 0;     // the FSR and 10K pulldown are connected to a0
float fsrReading;     // the analog reading from the FSR resistor divider
float fsrVoltage;     // the analog reading converted to voltage
float fsrResistance;  // The voltage converted to resistance, can be very big so make "long"
float fsrConductance; 
float fsrForce;       // Finally, the resistance converted to force
float fsrweight;
void setup(void) {
  Serial.begin(115200);   // We'll send debugging information via the Serial monitor
}

unsigned int simulation(const byte b)
{
  static byte pin = 10;
  static unsigned int zaehler = 0;
  if (pin != b)
  {
    pin = b;
    zaehler = 0;
    return zaehler;
  }
  zaehler += 10;
  if (zaehler > 1023) zaehler = 0;
  return zaehler;
}

 
void loop(void) {
  fsrReading = simulation(fsrPin);  
  Serial.print("Analog reading = ");
  Serial.println(fsrReading);
 
  // analog voltage reading ranges from about 0 to 1023 which maps to 0V to 5V (= 5000mV)
  fsrVoltage = map(fsrReading, 0, 1023, 0, 5000);
  Serial.print("Voltage reading in mV = ");
  Serial.println(fsrVoltage);  
 
  if (fsrVoltage == 0) {
    Serial.println("No pressure");  
  } else {
    // The voltage = Vcc * R / (R + FSR) where R = 10K and Vcc = 5V
    // so FSR = ((Vcc - V) * R) / V        yay math!
    fsrResistance = 5000 - fsrVoltage;     // fsrVoltage is in millivolts so 5V = 5000mV
    fsrResistance *= 10000;                // 10K resistor
    fsrResistance /= fsrVoltage;
    Serial.print("FSR Wiederstand in Ohm = ");
    Serial.println(fsrResistance);
 
    fsrConductance = 500000;           // we measure in micromhos so 
    fsrConductance /= fsrResistance;
    Serial.print("Conductance in microMhos: ");
    Serial.println(fsrConductance);
 
    // Mehrere lineare Gleichungen, um den Kraft zu approximieren. Auf Leitfähigkeit sind 10% mehr angesetzt und der Teiler 10% weniger

              //0.5   51
    if (fsrConductance <= 5) {
      fsrForce = fsrConductance / 10 ;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}

          //0.75      76.5
      else{if (fsrConductance <= 7.5) {
      fsrForce = fsrConductance / 10;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
         //1       101
      else{if (fsrConductance <= 15) {
      fsrForce = fsrConductance / 15;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //1,25       126,5
      else{if (fsrConductance <= 22.5) {
      fsrForce = fsrConductance / 18;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //1,5       152
      else{if (fsrConductance <= 27.5) {
      fsrForce = fsrConductance / 18.3;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
        //1,75       177,5
      else{if (fsrConductance <= 31.7) {
      fsrForce = fsrConductance / 18.1;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
         //2       203
      else{if (fsrConductance <= 35.5) {
      fsrForce = fsrConductance / 17.75;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //2,25       228,5
      else{if (fsrConductance <= 38) {
      fsrForce = fsrConductance / 16.8;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //2,5       254
      else{if (fsrConductance <= 46.5) {
      fsrForce = fsrConductance / 18.6;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //2,75       279,5
      else{if (fsrConductance <= 49.2) {
      fsrForce = fsrConductance / 17.89;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
        //3       305
      else{if (fsrConductance <= 54.3) {
      fsrForce = fsrConductance / 18.1;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
        //3,25       330,5
      else{if (fsrConductance <= 61) {
      fsrForce = fsrConductance / 18.77;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //3,5       356
      else{if (fsrConductance <= 63) {
      fsrForce = fsrConductance / 18;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //3,75       381,5
      else{if (fsrConductance <= 67.5) {
      fsrForce = fsrConductance / 18;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //4       407
      else{if (fsrConductance <= 69) {
      fsrForce = fsrConductance / 17.25;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //4,25       432,5
      else{if (fsrConductance <= 72.7) {
      fsrForce = fsrConductance / 17.1;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //4,5       458
      else{if (fsrConductance <= 83) {
      fsrForce = fsrConductance / 18.4;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //4,75       483,5
      else{if (fsrConductance <= 87) {
      fsrForce = fsrConductance / 18.3;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //5       509
      else{if (fsrConductance <= 88.5) {
      fsrForce = fsrConductance / 17.7;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //5,25       534,5
      else{if (fsrConductance <= 91.5) {
      fsrForce = fsrConductance / 17.4;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //5,5       560
      else{if (fsrConductance <= 93.5) {
      fsrForce = fsrConductance / 17;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //5,75       585,5
      else{if (fsrConductance <= 97) {
      fsrForce = fsrConductance / 16.8;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //6       611
      else{if (fsrConductance <= 98.5) {
      fsrForce = fsrConductance / 16.4;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //6,25       636,5
      else{if (fsrConductance <= 99) {
      fsrForce = fsrConductance / 15.84;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}

      //6,5       662
      else{if (fsrConductance <= 102.5) {
      fsrForce = fsrConductance / 15.77;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}

       //6,75       687,5
      else{if (fsrConductance <= 104.6) {
      fsrForce = fsrConductance / 15.5;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
        //7       713
      else{if (fsrConductance <= 105.5) {
      fsrForce = fsrConductance / 15.07;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
         //7,25       738,5
      else{if (fsrConductance <= 112) {
      fsrForce = fsrConductance / 15.45;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //7,5       764
      else{if (fsrConductance <= 112.5) {
      fsrForce = fsrConductance / 15;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //7,75       789,5
      else{if (fsrConductance <= 114) {
      fsrForce = fsrConductance / 14.71;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //8       815
      else{if (fsrConductance <= 115) {
      fsrForce = fsrConductance / 14.37;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //8,25       840,5
      else{if (fsrConductance <= 116.6) {
      fsrForce = fsrConductance / 14.13;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
        //8,5       866
      else{if (fsrConductance <= 117.7) {
      fsrForce = fsrConductance / 13.85;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //8,75       891,5
      else{if (fsrConductance <= 119) {
      fsrForce = fsrConductance / 13.6;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
       //9       917
      else{if (fsrConductance <= 120) {
      fsrForce = fsrConductance / 13.33;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //9,25       942,5
      else{if (fsrConductance <= 120.5) {
      fsrForce = fsrConductance / 13.03;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //9,5       968
      else{if (fsrConductance <= 121) {
      fsrForce = fsrConductance / 12.73;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //9,75       993,5
      else{if (fsrConductance <= 122.8) {
      fsrForce = fsrConductance / 12.59;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      //10       1019
      else{if (fsrConductance <= 124) {
      fsrForce = fsrConductance / 12.4;
      fsrweight =    fsrForce / 9.81 * 1000 ;
      Serial.print("Gewichtskraft in Newton: ");
      Serial.println(fsrForce,4);
      Serial.print("Gewicht in gramm: ");
      Serial.println(fsrweight,4);}
      
      
     
      
      
   

          




           }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
           
    
  
  }
  Serial.println("--------------------");
  delay(200);
  }

Die Ausgabe des Gewichtes schneidet nach analogWert von 720 ab:

10:45:01.567 -> --------------------
10:45:01.766 -> Analog reading = 710.00
10:45:01.766 -> Voltage reading in mV = 3470.00
10:45:01.766 -> FSR Wiederstand in Ohm = 4409.22
10:45:01.766 -> Conductance in microMhos: 113.40
10:45:01.766 -> Gewichtskraft in Newton: 7.7090
10:45:01.766 -> Gewicht in gramm: 785.8260
10:45:01.766 -> --------------------
10:45:01.966 -> Analog reading = 720.00
10:45:01.966 -> Voltage reading in mV = 3519.00
10:45:01.966 -> FSR Wiederstand in Ohm = 4208.58
10:45:01.966 -> Conductance in microMhos: 118.80
10:45:01.966 -> Gewichtskraft in Newton: 8.7357
10:45:01.999 -> Gewicht in gramm: 890.4843
10:45:01.999 -> --------------------
10:45:02.198 -> Analog reading = 730.00
10:45:02.198 -> Voltage reading in mV = 3567.00
10:45:02.198 -> FSR Wiederstand in Ohm = 4017.38
10:45:02.198 -> Conductance in microMhos: 124.46
10:45:02.198 -> --------------------
10:45:02.396 -> Analog reading = 740.00
10:45:02.396 -> Voltage reading in mV = 3616.00
10:45:02.396 -> FSR Wiederstand in Ohm = 3827.43
10:45:02.396 -> Conductance in microMhos: 130.64
10:45:02.396 -> --------------------
10:45:02.595 -> Analog reading = 750.00
10:45:02.595 -> Voltage reading in mV = 3665.00
10:45:02.595 -> FSR Wiederstand in Ohm = 3642.56
10:45:02.595 -> Conductance in microMhos: 137.27
10:45:02.595 -> --------------------
10:45:02.794 -> Analog reading = 760.00
10:45:02.794 -> Voltage reading in mV = 3714.00
10:45:02.794 -> FSR Wiederstand in Ohm = 3462.57
10:45:02.794 -> Conductance in microMhos: 144.40
10:45:02.827 -> --------------------

Wenn die Berechnung richtig wäre, dann müsste das durch gehen bis 1000....

Die Frage der Fragen:
Kannst Du mir für den analogwert 500, 600, 700 ... bis 1000 sagen, was da für Werte für Newton rauskommen müssen?

Moin zusammen.... Sorry für die Verspätung..
ich habe den Code durchlaufen lassen. Alles läuft erstmal super würde ich sagen. :slight_smile:.
Also bis zu 10N wird mir alles gut angezeigt würde ich sagen. Ich habe festgestellt, dass wenn ich auf maximum drücke, wird mir die Spannung bis maximal 3700mV ausgegeben. Sie müsste eigentlich gegen 5000mv gehen. Also soll ich den jetzigen Code mal durchlaufen lassen und bei den besagten Werten sagen, was da an Newton raus kommt?

Robert

No pressure
No pressure
No pressure
Analog reading Port 0: 445	Voltage reading in mV = 2174
Analog reading Port 1: 436	Voltage reading in mV = 2130
Analog reading Port 2: 485	Voltage reading in mV = 2370
Analog reading Port 3: 358	Voltage reading in mV = 1749
Analog reading Port 4: 0	Voltage reading in mV = 0
Analog reading Port 5: 34	Voltage reading in mV = 166
Analog reading Port 6: 425	Voltage reading in mV = 2077
Analog reading Port 7: 0	Voltage reading in mV = 0
Analog reading Port 8: 0	Voltage reading in mV = 0
Analog reading Port 9: 0	Voltage reading in mV = 0
FSR Widerstand in Ohm = 12999.08	Conductance in microMhos: 38.46
Gewichtskraft in Newton: 2.0680
Gewicht in gramm: 3102
--------------------
FSR Widerstand in Ohm = 13474.18	Conductance in microMhos: 37.11
Gewichtskraft in Newton: 2.2088
Gewicht in gramm: 3201
--------------------
FSR Widerstand in Ohm = 11097.05	Conductance in microMhos: 45.06
Gewichtskraft in Newton: 2.4224
Gewicht in gramm: 3312

Welchen?

Das könnte Dein Problem sein. Hab ich genau so beschrieben:

Der analogwert wird nicht passen, denn selbst bei 100N bekommst Du ja einen R von ca. 6Kohm.
Mit einem 10K/6K Spannungsteiler kommst Du nicht auf 0-1023.

Aaasalso mit diesen code, den du mir hochgeladen hast, ändern sich die Werte alle willkürlich. Sie steigen immer höher und fangen wieder von vorne an.

Das ist richtig, in der ersten Zeile steht #define SIMULATION - kommentierst die aus, kannst den Sensor abfragen.