我使用带Arduino的FSR传感器收集的压力数据的测量单位是多少

我使用带Arduino的FSR传感器收集的压力数据的测量单位是多少,arduino,sensors,units-of-measurement,pressure,Arduino,Sensors,Units Of Measurement,Pressure,我已经在Arduino上编写了代码,用于记录施加到连接到针脚A0的FSR传感器上的压力。这是我的密码 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 p

我已经在Arduino上编写了代码,用于记录施加到连接到针脚A0的FSR传感器上的压力。这是我的密码

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
}
我收到从0到1023的结果。我做了一个实验,通过增加压力传感器顶部的重量

上面是一张excel图表,显示了重量的增加和记录的压力


有人能告诉我这些压力读数的单位是多少吗

根据Excel,您已经测量并校准了重量为50-800克的传感器,您可以选择使用两种方法(前提是使用与校准中相同的设置)

使用map编程操作1

map(value, fromLow, fromHigh, toLow, toHigh)
每间隔

map(measuredValue, 974, 978, 351, 400)
在你的情况下,这将产生非常不精确的测量,因为你必须有if和than图

或者使用EXCEL插值函数计算整个范围,然后从1024个数据点中的每一个点获得一个gram值,该值存储在数组中,并使用以下方法检索:

gramValue = interpolatedArray[measuredValue];
但要真正使用,你可能需要一个额外的电路,制造商的校准数据和一个稳定的电源

这是卖方的建议:

这些传感器设置简单,非常适合感应压力,但是 它们并不是难以置信的准确。用它们来感知它是否被激活 挤压,但您可能不想将其用作标尺


现在没有压力单位。你只有一个0到1023之间的无单位量,表示0到5V之间的电压。你必须查看传感器的数据表,找出如何从电压转换为更有用的单位。或者通过测量一些已知的力值和计算来进行某种校准g校准曲线。将模拟读数转换为电压使用(模拟读数*5.0/1024.0)假设你有一个5V参考电压。如果你用其他参考电压代替5.0,没有人知道,因为只有你有这个传感器的制造商数据表。你有,对吗?我投票结束这个问题,因为它不是关于编程,而是关于电子传感器的性能特征OP正在使用。谢谢@Delta_G-这很有道理!我没有传感器的制造商数据表,这就是我购买的传感器?