Sunday 16 August 2015

arduino - How would I get a full range voltage reading from a pressure sensor?


I am making an application using the DIY Force Sensitive Resistor (FSR) taken from this instructable. The resistance of this sensor typycally ranges from 20kOhm when at rest to 9kOhm when pressed.


How would I convert these resistance values to a signal where 0v corresponds to the rest condition and 5v corresponds to the "pressed" condition so that I can read it with an Arduino?



Answer



You want a signal range from 0V to 5V. Don't we all :-)? Let's go for a different approach and see where that gets us.


Starting point: cheapest and most simple solution.


That would be a series resistor to create a voltage divider. That's the absolute minimum. I've noticed that people don't give that resistor much thought, the just pick a nice round value like 10k\$\Omega\$. But I found that there's an optimal value for this.


enter image description here


The curve shows the voltage difference between the minimum and maximum reading (9k\$\Omega\$ and 20k\$\Omega\$ resp.) as a function of the series resistor (in k\$\Omega\$). See, it indeed has a maximum. That's easy to find if you remember that


\$ \left(\dfrac{f(x)}{g(x)}\right)' = \dfrac{f'(x)\cdot g(x) - f(x) \cdot g'(x)}{g^2(x)} \$



The difference \$V_{MAX}\$- \$V_{MIN}\$ has an extremum for


\$ \dfrac{d}{d R_X} \left(\dfrac{R_{MAX}}{R_{MAX} + R_X} - \dfrac{R_{MIN}}{R_{MIN} + R_X}\right) = 0 \$


Solving for \$R_X\$ gives



\$ R_X = \sqrt{R_{MIN} \cdot R_{MAX}} \$



A beauty!


So in our case the series resistor will be 13.42k\$\Omega\$, you can check this on the graph. Placing the resistors between 0V and +5V this will give us an output range of [2V, 3V]. That's the maximum range you can get with 1 resistor(*).


Is it enough? The Arduino has a 10-bit ADC, so this range will give you a range of 200 discrete levels. That should give a sufficient accuracy for a DIY sensor. So no other components like opamps needed.





(*) The accepted answer gives a 1.9V range, but it has the wrong equations. It's impossible to get a higher range than 1V with 1 resistor and only a +5V supply.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...