0

PROBLEM WITH ARDUINO CODE
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PROBLEM WITH ARDUINO CODE

by lmgarcia8 on Mon May 31, 2021 5:27 am

I'm doing an university proyect with force sensor. I have been seeing your articles and they all are so interesting.
I have a question for you in this article:

https://learn.adafruit.com/force-sensit ... ing-an-fsr

In the code in wich you calculated the force in Newtons, you put this:
// Use the two FSR guide graphs to approximate the force
if (fsrConductance <= 1000) {
fsrForce = fsrConductance / 80;
Serial.print("Force in Newtons: ");
Serial.println(fsrForce);
} else {
fsrForce = fsrConductance - 1000;
fsrForce /= 30;
Serial.print("Force in Newtons: ");
Serial.println(fsrForce);
}

And I don't know where you get this value "fsrForce = fsrConductance / 80;"
and this one "fsrForce /= 30;"
¿Can you help me?
Thank you very much, I congratulate you for your work!

lmgarcia8
 
Posts: 3
Joined: Mon May 31, 2021 5:23 am

Re: PROBLEM WITH ARDUINO CODE

by blnkjns on Mon May 31, 2021 6:55 am

I think the values originate in the FSR datasheet:
https://www.adafruit.com/product/166#description
If you look at the graph, it has a kink in the line. It probably deals with the section before and after the kink.

blnkjns
 
Posts: 663
Joined: Fri Oct 02, 2020 3:33 am

Re: PROBLEM WITH ARDUINO CODE

by lmgarcia8 on Mon May 31, 2021 8:44 am

I guess that graph will be different for each sensor.
I have bought this sensor

https://es.aliexpress.com/item/32960696 ... web201603_

and I need to change those values ​​that I mentioned before so that my project can work, but I cannot understand the graph, since the one they provide me in the place where I bought it is not logarithmic
Attachments
Imagen1.png
Imagen1.png (87.96 KiB) Viewed 279 times

lmgarcia8
 
Posts: 3
Joined: Mon May 31, 2021 5:23 am

Please be positive and constructive with your questions and comments.