sensor FSR ( force sensitive resistor)

I want to ask, how to coding for FSR ( force sensitive resistor) pressure sensor calibration. in order for the output to match the effective weight sensor

wafihumam: I want to ask, how to coding for FSR ( force sensitive resistor) pressure sensor calibration. in order for the output to match the effective weight sensor

Well, that'll depend a lot on what sort of sensor you have, the circuit it's in and how you are reading the value.

This might be useful to read, along with an example... Force Sensitive Resistor Hookup Guide

And this goes into some detail: FSR Guide pdf

Yours, TonyWilk

I've read books and journals, which I ask coding for calibration for FSR sensors can produce accurate output :)

wafihumam: I've read books and journals, which I ask coding for calibration for FSR sensors can produce accurate output :)

Sorry, I do not understand that.

Yours, TonyWilk

ok, thank you

Well, first of all, they're not exactly accurate. They're mostly use to sense pressure vs. no pressure (like in touch applications).

Secondly, you calibrate them like you would do for any sensor. Apply a known input (pressure), check the actual output (resistance). Do that for a few values of input (pressure) and you have a number of corresponding outputs (resistance).

After that it's a (sometimes not so) simple matter of fitting a line or curve to those data points. The more data points the more accurate your calibration curve becomes. Now with your calibration curve known, all you have to do is put that formula in your code, and you can calculate the unknown input (pressure) from the measured output (resistance), at least over the range of inputs (pressures) you calibrated for, and usually a bit outside that range, too, but then your accuracy tends to go down.

code for censor FSR calibration how ??

#include <Dhcp.h>
#include <Dns.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <EthernetUdp.h>

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial

#include <dht11.h>
dht11 DHT;
#define DHT11_PIN 7
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>

char auth = “7893b452ae8d440ba90161ee7f911f43”;

int fsrAnalogPin = A0; // FSR is connected to analog 0
int fsrAnalogPin1 = A1; // FSR is connected to analog 1
int fsrAnalogPin2 = A2; // FSR is connected to analog 2
int tepung_terigu=0, telur=0, bawang_merah=0, temp=20, humid=60;
int fsrReading; // the analog reading from the FSR resistor divider
String quantity = " ";

void setup()
{

Serial.begin(9600);
Serial.println("DHT TEST PROGRAM ");
Serial.print("LIBRARY VERSION: ");
Serial.println(DHT11LIB_VERSION);
Serial.println();
Serial.println(“Type,\tstatus,\tHumidity (%),\tTemperature (C)”);

Blynk.begin(auth);

}

void loop()
{
check_pantry();
Blynk.run();

int chk;
Serial.print(“DHT11, \t”);
chk = DHT.read(DHT11_PIN); // READ DATA
switch (chk){
case DHTLIB_OK:
Serial.print(“OK,\t”);
break;
}

Serial.print(DHT.humidity,1);
Serial.print(",\t");
Serial.println(DHT.temperature,1);
Blynk.virtualWrite(V3, (DHT.temperature));
Blynk.virtualWrite(V4, (DHT.humidity));
delay(100);
}

void check_pantry(){
fsrReading = analogRead(fsrAnalogPin);

Serial.print("Analog reading 0 = ");
Serial.println(fsrReading);
Blynk.virtualWrite(V0, (fsrReading));

fsrReading = analogRead(fsrAnalogPin1);
Serial.print("Analog reading 1= ");
Serial.println(fsrReading);
Blynk.virtualWrite(V1, (fsrReading));

fsrReading = analogRead(fsrAnalogPin2);
Serial.print("Analog reading 2= ");
Serial.println(fsrReading);
Blynk.virtualWrite(V2, (fsrReading));

}

wafihumam:
code for censor FSR calibration how ??

Come on… lazy much?!

#define FSRpin A0

void setup() {
  Serial.begin(115200);
  pinMode(FSRpin, INPUT);
}

void loop() {
  Serial.println(analogRead(FSRpin));
  delay(1000);
}

This is the code you need to calibrate the sensor. Plus some work in your favourite spreadsheet, depending on the results of your calibration.

If you think I’m not serious here, read my comment #5 again.

if that's it I tried yesterday, and the results can not be as real as the original scales

I need a script or coding if the item weighs 250gr then in the pressure sensor also 250 gr, which I experienced in the pressure sensor can not be 250gr, only 20gr

Please read comment #5 again, and when you're at it, read up on how an FSR works.

Ok, I will wait

For what? We're not here to do your homework.

I'm making a tool that can be useful for the community