Hello guys.
I have a problem. Well I made my self a stretch sensor with conductive fiber. But when it get stretched ( resistence incrase ) I got reading like resistence decrease. Anyone could help me with that ?
My conductive fiber got aroud 620k ohm to 650k ohm when is stretch ( recording to Ohm meter ). I am using "known" resistor of 600k ohm.
code :
int analogPin= 5;
int raw= 0;
int Vin= 5;
float Vout= 0;
float R1= 600000;
float R2= 0;
float buffer= 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
raw= analogRead(analogPin);
if(raw)
{
buffer= raw * Vin;
Vout= (buffer)/1024.0;
buffer= (Vin/Vout) -1;
R2= R1 * buffer;
Serial.print("R2: ");
Serial.println(R2);
delay(100);
}
}
As attachment I add screenshot of readings. When fiber is stretch reading numbers are lower then when its not.
EDIT : Imgur: The magic of the Internet <- here is picture of readings.