What is the unit of measure for the pressure data I collect using an FSR sesnor with an Arduino

167 Views Asked by At

I have written code on the Arduino to record the pressure applied to a FSR sensor connected to pin A0. Here is my code

int pressureAnalogPin = 0; //pin where our pressure pad is located.
int pressureReading; //variable for storing our reading
bool active = false; //boolean to check whether arduino should be sending pressure values 

void setup() 
{ 
    Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}
void loop() 
{
    if (Serial.available()) //checks if data is coming in
        { 
        char read = Serial.read(); //Set varaiable read to data read from mobile
        if (read == 'g') //if read is equal to character 'g' set boolean active to true 
        { 
            active = true;
        }
        if (read == 'x') //if read is equal to character 'x' set boolean active to false 
        { 
            active = false;
        }
    }
    if (active == true) //Only send data to phone when boolean active is set to true
    {   
        pressureReading = analogRead(pressureAnalogPin); // Set varaible pressureReading to the pressure value recorded by FSR 
        Serial.print(pressureReading); //Send pressure value to mobile phone
    }
    delay(100);// a delay of 100ms in loop
}

I receive results from 0 to 1023. I have conducted an experiment, by incrementing weights on top of the pressure sensor.

Excel Experiment Results

Above is an excel chart showing the increase in weight and the pressure recorded.

Can someone let me know what is the unit is for these pressure readings?

1

There are 1 best solutions below

0
Codebreaker007 On

As you gave already measured and calibrated the sensor with weights 50 - 800 gram according to your Excel, you have the option to use two methods (provided you use the same setup as in your calibration.

Oprion one programatically with map

map(value, fromLow, fromHigh, toLow, toHigh)

for each interval

map(measuredValue, 974, 978, 351, 400)

which in your case will produce very imprecise measurements as you have to have if and than map.

Or you calculate the whole range with EXCEL interpolate function than you get for every of the 1024 data points a gram value which you store in an array and retrieve with:

gramValue = interpolatedArray[measuredValue];

BUT for real use you will probably need an additional circuit, the manufacturers calibration data and a stable power supply. For playing around and learning this shoot and hope its a hit method is ok.

AND this is the sellers recommendation:

These sensors are simple to set up and great for sensing pressure, but they aren't incredibly accurate. Use them to sense if it's being squeezed, but you may not want to use it as a scale

Datasheet for the sensor including all the calibration circuits