User Tools

Site Tools


tutorials:learn:sensors:fsr.html

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorials:learn:sensors:fsr.html [2010/10/06 18:11]
daigo
tutorials:learn:sensors:fsr.html [2016/01/28 18:05] (current)
Line 1: Line 1:
- 
 ====  ==== ====  ====
 +{{  http://​www.ladyada.net/​images/​sensors/​FSR402_MED.jpg?​nolink&​350x263 ​ |}}{{ http://​www.ladyada.net/​images/​sensors/​402FSR_large.jpg?​nolink&​405x208 |}} \\ //This is a photo of an FSR, specifically the Interlink 402 model. The 1/2" diameter round part is the sensitive bit//
  
- +{{  http://​www.ladyada.net/​images/​sensors/​FSRimage.jpg?nolink&​388x281  ​|}} \\ //The FSR is made of 2 layers seperated by a spacer. The more one presses, the more of those Active Element dots touch the semiconductor and that makes the resistance go down // \\ 
-{{ http://​www.ladyada.net/​images/​sensors/​FSR402_MED.jpg?350x263 |}}{{ http://​www.ladyada.net/​images/​sensors/​402FSR_large.jpg?​405x208 ​|}} \\  +
-This is a photo of an FSR, specifically the Interlink 402 model. The 1/2" diameter round part is the sensitive bit +
- +
-{{ http://​www.ladyada.net/​images/​sensors/​FSRimage.jpg?​388x281 |}} \\  +
-The FSR is made of 2 layers seperated by a spacer. The more one presses, the more of those Active Element dots touch the semiconductor and that makes the resistance go down  \\  +
  
  
 ==== What is a Force Sensitive Resistor? ​ ==== ==== What is a Force Sensitive Resistor? ​ ====
- 
- 
  
  
Line 20: Line 12:
  
  
-FSR's are basically a resistor that changes its resistive value (in ohms Ω) depending on how much its pressed. These sensors are fairly low cost, and easy to use but they'​re rarely accurate. They also vary some from sensor to sensor perhaps 10%. So basically when you use FSR's you should only expect to get ranges of response. While FSRs can detect weight, they'​re a bad choice for detecting exactly how many pounds of weight are on them. +FSR's are basically a resistor that changes its resistive value (in ohms Ω) depending on how much its pressed. These sensors are fairly low cost, and easy to use but they'​re rarely accurate. They also vary some from sensor to sensor perhaps 10%. So basically when you use FSR's you should only expect to get //ranges// of response. While FSRs can detect weight, they'​re a bad choice for detecting exactly how many pounds of weight are on them. 
  
  
  
 However, for most touch-sensitive applications like "has this been squeezed or pushed and about how much" they'​re a good deal for the money! \\  However, for most touch-sensitive applications like "has this been squeezed or pushed and about how much" they'​re a good deal for the money! \\ 
- 
  
  
 ==== Some basic stats  ==== ==== Some basic stats  ====
- 
- 
 These stats are specifically for the Interlink 402, but nearly all FSRs will be similar. Checking the datasheet will always illuminate any differences These stats are specifically for the Interlink 402, but nearly all FSRs will be similar. Checking the datasheet will always illuminate any differences
- 
   ***Size:** 1/2" (12.5mm) diameter active area by 0.02" thick (Interlink does have some that are as large as 1.5"​x1.5"​)   ***Size:** 1/2" (12.5mm) diameter active area by 0.02" thick (Interlink does have some that are as large as 1.5"​x1.5"​)
   ***Price** [[http://​www.adafruit.com/​index.php?​main_page=product_info&​cPath=35&​products_id=166|$7.00 from the Adafruit shop]]   ***Price** [[http://​www.adafruit.com/​index.php?​main_page=product_info&​cPath=35&​products_id=166|$7.00 from the Adafruit shop]]
-  ***Resistance range:** Infinite/​open circuit (no pressure), 100K&​Omega; ​(light pressure) to 200&​Omega; ​(max. pressure)+  ***Resistance range:** Infinite/​open circuit (no pressure), 100KΩ (light pressure) to 200Ω (max. pressure)
   ***Force range**: 0 to 20 lb. (0 to 100 Newtons) applied evenly over the 0.125 sq in surface area   ***Force range**: 0 to 20 lb. (0 to 100 Newtons) applied evenly over the 0.125 sq in surface area
   ***Power supply:** Any! Uses less than 1mA of current (depends on any pullup/down resistors used and supply voltage)   ***Power supply:** Any! Uses less than 1mA of current (depends on any pullup/down resistors used and supply voltage)
-  *[[http://​www.ladyada.net/​media/​sensors/​fsrguide.pdf|**Datasheet**]] (note there are some mathematical inconsistancies in here) +  ​***[[http://​www.ladyada.net/​media/​sensors/​fsrguide.pdf|Datasheet]]** (note there are some mathematical inconsistancies in here) 
 ==== How to measure force/​pressure with an FSR  ==== ==== How to measure force/​pressure with an FSR  ====
- 
- 
  
  
 As we've said, the FSR's resistance changes as more pressure is applied. When there is no pressure, the sensor looks like an infinite resistor (open circuit), as the pressure increases, the resistance goes down. This graph indicates approximately the resistance of the sensor at different force measurements. (Note that force is not measured in grams and what they really mean is Newtons * 100!) As we've said, the FSR's resistance changes as more pressure is applied. When there is no pressure, the sensor looks like an infinite resistor (open circuit), as the pressure increases, the resistance goes down. This graph indicates approximately the resistance of the sensor at different force measurements. (Note that force is not measured in grams and what they really mean is Newtons * 100!)
  
-{{ http://​www.ladyada.net/​images/​sensors/​resistanceforce.jpg?​393x245 |}}+{{  http://​www.ladyada.net/​images/​sensors/​resistanceforce.jpg?​nolink&393x245 ​ |}}
  
  
  
-Its important to notice that the graph isn't really linear (its a log/log graph) and that at especially low force measurements it quickly goes from infinite to 100KΩ+Its important to notice that the graph isn't really ​//linear// (its a log/log graph) and that at especially low force measurements it quickly goes from infinite to 100KΩ
  
  
 ==== Testing your FSR  ==== ==== Testing your FSR  ====
- +[[http://​www.ladyada.net/​images/​sensors/​fsrmetertesting.jpg|{{ ​ http://​www.ladyada.net/​images/​sensors/​fsrmetertesting_t.jpg?​nolink&500x375 ​ |}}]]
- +
-[[http://​www.ladyada.net/​images/​sensors/​fsrmetertesting.jpg|{{ http://​www.ladyada.net/​images/​sensors/​fsrmetertesting_t.jpg?​500x375 |}}]]+
  
  
  
-The easiest way to determine how your FSR works is to[[http://​www.ladyada.net/​learn/​multimeter/​| connect a multimeter in resistance-measurement mode]] to the two tabs on your sensor and see how the resistance changes. Because the resistance changes a lot, a auto-ranging meter works well here. Otherwise, just make sure you try different ranges, between 1M&​Omega; ​and 100&​Omega; ​before '​giving up'.+The easiest way to determine how your FSR works is to[[http://​www.ladyada.net/​learn/​multimeter/​| connect a multimeter in resistance-measurement mode]] to the two tabs on your sensor and see how the resistance changes. Because the resistance changes a lot, a auto-ranging meter works well here. Otherwise, just make sure you try different ranges, between 1MΩ and 100Ω before '​giving up'.
  
  
 ==== Connecting to your FSR  ==== ==== Connecting to your FSR  ====
- 
- 
  
  
Line 74: Line 56:
 FSRs are often a polymer with conductive material silk-screened on. That means they'​re plastic and the connection tab is crimped on somewhat delicate material. The best way to connect to these is to simply plug them into a breadboard ​ FSRs are often a polymer with conductive material silk-screened on. That means they'​re plastic and the connection tab is crimped on somewhat delicate material. The best way to connect to these is to simply plug them into a breadboard ​
  
-[[http://​www.ladyada.net/​images/​sensors/​FSRbb.jpg|{{ http://​www.ladyada.net/​images/​sensors/​FSRbb_t.jpg?​500x376 |}}]]+[[http://​www.ladyada.net/​images/​sensors/​FSRbb.jpg|{{ ​ http://​www.ladyada.net/​images/​sensors/​FSRbb_t.jpg?​nolink&500x376 ​ |}}]]
  
 or use a clamp-style connector like alligator clips (see above), female header or use a clamp-style connector like alligator clips (see above), female header
  
-[[http://​www.ladyada.net/​images/​sensors/​fsrhead.jpg|{{ http://​www.ladyada.net/​images/​sensors/​fsrhead_t.jpg?​500x375 |}}]]+[[http://​www.ladyada.net/​images/​sensors/​fsrhead.jpg|{{ ​ http://​www.ladyada.net/​images/​sensors/​fsrhead_t.jpg?​nolink&500x375 ​ |}}]]
  
 or a terminal block such as [[http://​mouser.com/​Search/​ProductDetail.aspx?​qs=sGAEpiMZZMvXvCN7QvKasXNwb4IufXV%2fCdHopRH7bbg%3d|Phoenix #1881448]] or a terminal block such as [[http://​mouser.com/​Search/​ProductDetail.aspx?​qs=sGAEpiMZZMvXvCN7QvKasXNwb4IufXV%2fCdHopRH7bbg%3d|Phoenix #1881448]]
  
-[[http://​www.ladyada.net/​images/​sensors/​fsrterminal.jpg|{{ http://​www.ladyada.net/​images/​sensors/​fsrterminal_t.jpg?​500x268 |}}]]+[[http://​www.ladyada.net/​images/​sensors/​fsrterminal.jpg|{{ ​ http://​www.ladyada.net/​images/​sensors/​fsrterminal_t.jpg?​nolink&500x268 ​ |}}]]
  
  
  
-It is possible to solder onto the tabs but you must be very fast because if your iron is not good quality or you dally even a few seconds, you will melt the plastic and ruin the FSR! **Don'​t attempt to solder directly to your FSR unless you are absolutely sure you have the skills to do so. **+It is possible to solder onto the tabs but //you must be very fast// because if your iron is not good quality or you dally even a few seconds, you will melt the plastic and ruin the FSR! **Don'​t attempt to solder directly to your FSR unless you are absolutely sure you have the skills to do so. **
  
  
 ==== Project examples ​ ==== ==== Project examples ​ ====
- 
- 
  
  
 Here are just a few examples of projects that use FSRs! Here are just a few examples of projects that use FSRs!
  
-<object width="​550"​ height="​415"​><param name="​allowfullscreen"​ value="​true"​ /><​param name="​allowscriptaccess"​ value="​always"​ /><​param name="​movie"​ value="​http://​vimeo.com/​moogaloop.swf?​clip_id=1046776&​server=vimeo.com&​show_title=0&​show_byline=0&​show_portrait=0&​color=00ADEF&​fullscreen=1"​ /></​object>​ +{{ vimeo>​1046776 ​}}
- ​\\ ​+
 Interfacing with Flash (or Processing would work well too!) to change the screen display Interfacing with Flash (or Processing would work well too!) to change the screen display
  
-<object width="​425"​ height="​344"​><param name="​movie"​ value="​http://​www.youtube.com/​v/​6duIGjwv6CM&​hl=en&​fs=1"></​param><​param name="​allowFullScreen"​ value="​true"></​param><​param name="​allowscriptaccess"​ value="​always"></​param></​object>​ +{{ youtube>​6duIGjwv6CM ​}}
- ​\\ ​+
 Control LEDs (its a little dark but he's pressing an FSR) Control LEDs (its a little dark but he's pressing an FSR)
  
-[[http://​protolab.pbworks.com/​TutorialSensors#​ForceSensitiveResistorFSRThumbWrestling|{{ http://​www.ladyada.net/​images/​sensors/​2245842706_7fe1c82fc0.jpg?​500x333 |}}]] \\  +[[http://​protolab.pbworks.com/​TutorialSensors#​ForceSensitiveResistorFSRThumbWrestling|{{ ​ http://​www.ladyada.net/​images/​sensors/​2245842706_7fe1c82fc0.jpg?​nolink&500x333 ​ |}}]] \\ [[http://​protolab.pbworks.com/​TutorialSensors#​ForceSensitiveResistorFSRThumbWrestling|FSR thumb-wrestling (example from Stanford U. class)]]
-[[http://​protolab.pbworks.com/​TutorialSensors#​ForceSensitiveResistorFSRThumbWrestling|FSR thumb-wrestling (example from Stanford U. class)]]+
  
-<object width="​550"​ height="​413"​><param name="​allowfullscreen"​ value="​true"​ /><​param name="​allowscriptaccess"​ value="​always"​ /><​param name="​movie"​ value="​http://​vimeo.com/​moogaloop.swf?​clip_id=1908805&​server=vimeo.com&​show_title=0&​show_byline=0&​show_portrait=0&​color=00ADEF&​fullscreen=1"​ /></​object>​ +{{ vimeo>​1908805 ​}}
- ​\\ ​+
 [[http://​www.arijoseph.com/​blog/​2008/​10/​itppcomp-tapper-proposal/​|Tapper,​ a musical interface that works by having you tap your fingers to the music]] [[http://​www.arijoseph.com/​blog/​2008/​10/​itppcomp-tapper-proposal/​|Tapper,​ a musical interface that works by having you tap your fingers to the music]]
  
 +\\
  
  
-  *[[http://​www.gneumatic.net/​2008/​10/​03/​physical-computing-assignment-analog-input/​|Massage shirt using FSRs]]+  *[[http://​www.gneumatic.net/​2008/​10/​03/​physical-computing-assignment-analog-input/​|Massage shirt using FSRs]] ​
  
 ==== Analog voltage reading method ​ ==== ==== Analog voltage reading method ​ ====
- 
- 
  
  
Line 124: Line 99:
  
  
-{{ http://​www.ladyada.net/​images/​sensors/​fsrpulldowndia.png?​427x338 |}}{{ http://​www.ladyada.net/​images/​sensors/​fsrpulldownsch.gif?​184x334 |}}+{{ http://​www.ladyada.net/​images/​sensors/​fsrpulldowndia.png?​nolink&427x338 |}}{{ http://​www.ladyada.net/​images/​sensors/​fsrpulldownsch.gif?​nolink&184x334 |}}
  
  
Line 132: Line 107:
  
  
-The way this works is that as the resistance of the FSR decreases, the total resistance of the FSR and the pulldown resistor decreases from about 100Kohm to 10Kohm. That means that the current flowing through both resistors increases which in turn causes the voltage across the fixed 10K resistor to increase. Its quite a trick!+The way this works is that as the resistance of the FSR decreases, the total resistance of the FSR and the pulldown resistor decreases from about 100Kohm to 10Kohm. That means that the current flowing through both resistors ​//increases// which in turn causes the voltage across the fixed 10K resistor to increase. Its quite a trick!
  
  
-^Force (lb)^^Force (N)^^FSR Resistance^^(FSR + R) &​Omega;​^^Current thru FSR+R^^Voltage across R^ +^Force (lb)^Force (N)^FSR Resistance^(FSR + R) Ω^Current thru FSR+R^Voltage across R^ 
-^None^^None^|Infinite| \\ |Infinite!| \\ |0 mA| \\ |0V| \\ +^None^None|Infinite|Infinite!|0 mA|0V| 
-^0.04 lb^^0.2 N^|30K&​Omega;​| \\ |40 K&​Omega;​| \\ |0.13 mA| \\ |1.3 V| \\ +^0.04 lb^0.2 N|30KΩ|40 KΩ|0.13 mA|1.3 V| 
-^0.22 lb^^1 N^|6 K&​Omega;​| \\ | 16 K&​Omega;​| \\ |0.31 mA| \\ |3.1 V| \\ +^0.22 lb^1 N|6 KΩ| 16 KΩ|0.31 mA|3.1 V| 
-^2.2 lb^^10 N^|1 K&​Omega;​| \\ |11 K&​Omega;​| \\ |0.45 mA| \\ |4.5 V| \\ +^2.2 lb^10 N|1 KΩ|11 KΩ|0.45 mA|4.5 V| 
-^22 lb^^100 N^|250 &​Omega;​| \\ |10.25 K&​Omega;​| \\ |0.49 mA| \\ |4.9 V| \\ +^22 lb^100 N|250 Ω|10.25 KΩ|0.49 mA|4.9 V| 
-This table indicates the approximate analog voltage based on the sensor force/​resistance w/a 5V supply and 10K pulldown resistor +//This table indicates the approximate analog voltage based on the sensor force/​resistance w/a 5V supply and 10K pulldown resistor//
  
 Note that our method takes the somewhat linear resistivity but does not provide linear voltage! That's because the voltage equasion is: Note that our method takes the somewhat linear resistivity but does not provide linear voltage! That's because the voltage equasion is:
  
-Vo = Vcc ( R / (R + FSR) ) |+<​code>​Vo = Vcc ( R / (R + FSR) )</​code>​ 
 + 
  
 That is, the voltage is proportional to the **inverse** of the FSR resistance. That is, the voltage is proportional to the **inverse** of the FSR resistance.
Line 154: Line 130:
  
  
- +{{ http://​www.ladyada.net/​images/​sensors/​FSRandLED.png?​nolink&384x390 |}}{{ http://​www.ladyada.net/​images/​sensors/​FSRledsch.gif?​nolink&311x387 |}}
- +
-{{ http://​www.ladyada.net/​images/​sensors/​FSRandLED.png?​384x390 |}}{{ http://​www.ladyada.net/​images/​sensors/​FSRledsch.gif?​311x387 |}}+
  
  
Line 200: Line 174:
  
 ==== Simple code for analog FSR measurements ​ ==== ==== Simple code for analog FSR measurements ​ ====
 +{{  http://​www.ladyada.net/​images/​sensors/​fsrpulldowndia.png?​nolink&​427x338 ​ |}}{{ http://​www.ladyada.net/​images/​sensors/​fsrpulldownsch.gif?​nolink&​184x334 |}}
  
  
-{{ http://​www.ladyada.net/​images/​sensors/​fsrpulldowndia.png?​427x338 |}}{{ http://​www.ladyada.net/​images/​sensors/​fsrpulldownsch.gif?​184x334 |}} 
  
- +{{ http://​www.ladyada.net/​images/​sensors/​simpletestout.gif?​nolink&533x247 |}}
- +
-{{ http://​www.ladyada.net/​images/​sensors/​simpletestout.gif?​533x247 |}}+
  
 This code doesn'​t do any calculations,​ it just prints out what it interprets as the amount of pressure in a qualitative manner. For most projects, this is pretty much all thats needed! This code doesn'​t do any calculations,​ it just prints out what it interprets as the amount of pressure in a qualitative manner. For most projects, this is pretty much all thats needed!
- 
  
 <code C> /* FSR simple testing sketch. ​ <code C> /* FSR simple testing sketch. ​
Line 227: Line 198:
  
 void loop(void) { void loop(void) {
-  fsrReading = analogRead(0);  ​+  fsrReading = analogRead(fsrPin);  ​
   ​   ​
   Serial.print("​Analog reading = ");   Serial.print("​Analog reading = ");
Line 246: Line 217:
   delay(1000);​   delay(1000);​
 } </​code> ​ } </​code> ​
- 
 ==== In-depth code for analog FSR measurements ​ ==== ==== In-depth code for analog FSR measurements ​ ====
 +{{  http://​www.ladyada.net/​images/​sensors/​fsrpulldowndia.png?​nolink&​427x338 ​ |}}{{ http://​www.ladyada.net/​images/​sensors/​fsrpulldownsch.gif?​nolink&​184x334 |}}
  
- +{{  http://​www.ladyada.net/​images/​sensors/​fsrtester.gif?​nolink&540x597 ​ |}}
-{{ http://​www.ladyada.net/​images/​sensors/​fsrpulldowndia.png?​427x338 |}}{{ http://​www.ladyada.net/​images/​sensors/​fsrpulldownsch.gif?​184x334 |}} +
- +
-{{ http://​www.ladyada.net/​images/​sensors/​fsrtester.gif?​540x597 |}}+
  
  
  
-This Arduino sketch that assumes you have the FSR wired up as above, with a 10K&​Omega; ​pull down resistor and the sensor is read on Analog 0 pin. It is pretty advanced and will measure the approximate Newton force measured by the FSR. This can be pretty useful for calibrating what forces you think the FSR will experience+This Arduino sketch that assumes you have the FSR wired up as above, with a 10KΩ pull down resistor and the sensor is read on Analog 0 pin. It is pretty advanced and will measure the approximate Newton force measured by the FSR. This can be pretty useful for calibrating what forces you think the FSR will experience
  
 <code C>/* FSR testing sketch. ​ <code C>/* FSR testing sketch. ​
Line 317: Line 285:
   delay(1000);​   delay(1000);​
 }</​code> ​ }</​code> ​
- 
 ==== BONUS! Reading FSRs without analog pins  ==== ==== BONUS! Reading FSRs without analog pins  ====
- 
- 
  
  
 Because FSR's are basically resistors, its possible to use them even if you don't have any analog pins on your microcontroller (or if say you want to connect more than you have analog input pins. The way we do this is by taking advantage of a basic electronic property of resistors and capacitors. It turns out that if you take a capacitor that is initially storing no voltage, and then connect it to power through a resistor, it will charge up to the power voltage slowly. The bigger the resistor, the slower it is.  Because FSR's are basically resistors, its possible to use them even if you don't have any analog pins on your microcontroller (or if say you want to connect more than you have analog input pins. The way we do this is by taking advantage of a basic electronic property of resistors and capacitors. It turns out that if you take a capacitor that is initially storing no voltage, and then connect it to power through a resistor, it will charge up to the power voltage slowly. The bigger the resistor, the slower it is. 
  
-{{ http://​www.ladyada.net/​images/​sensors/​RCtimecapture.jpg?​640x480 |}} \\  +{{  http://​www.ladyada.net/​images/​sensors/​RCtimecapture.jpg?​nolink&640x480 ​ |}} \\ //This capture from an oscilloscope shows whats happening on the digital pin (yellow). The blue line indicates when the sketch starts counting and when the couting is complete, about 1.2ms later.//
-This capture from an oscilloscope shows whats happening on the digital pin (yellow). The blue line indicates when the sketch starts counting and when the couting is complete, about 1.2ms later.+
  
  
Line 334: Line 298:
  
  
-{{ http://​www.ladyada.net/​images/​sensors/​RCtimediag.png?​443x314 |}}{{ http://​www.ladyada.net/​images/​sensors/​RCtimesch.gif?​209x340 |}}+{{ http://​www.ladyada.net/​images/​sensors/​RCtimediag.png?​nolink&443x314 |}}{{ http://​www.ladyada.net/​images/​sensors/​RCtimesch.gif?​nolink&209x340 |}}
  
  
Line 340: Line 304:
 In this case, our '​bucket'​ is a 0.1uF ceramic capacitor. You can change the capacitor nearly any way you want but the timing values will also change. 0.1uF seems to be an OK place to start for these FSRs.  In this case, our '​bucket'​ is a 0.1uF ceramic capacitor. You can change the capacitor nearly any way you want but the timing values will also change. 0.1uF seems to be an OK place to start for these FSRs. 
  
-<code C><pre style="​border:​ 1px solid #CCCCCC; background-color:​ #f5f5f5; font-family:​ Fixed, monospace;​ +<code C>/* FSR simple testing sketch. ​
-       ​font-size:​ 95%;">/* FSR simple testing sketch. ​+
  
 Connect one end of FSR to power, the other end to pin 2. Connect one end of FSR to power, the other end to pin 2.
Line 406: Line 369:
 }</​code>​ }</​code>​
  
- +{{ http://​www.ladyada.net/​images/​sensors/​RCtimeout.gif?​nolink&743x357 |}}
-{{ http://​www.ladyada.net/​images/​sensors/​RCtimeout.gif?​743x357 |}}+
  
  
/home/ladyada/public_html/wiki/data/attic/tutorials/learn/sensors/fsr.html.1286388708.txt.gz · Last modified: 2016/01/28 18:05 (external edit)