Difference between revisions of "SparkFun: 0.5" Force Sensitive Resistor"

From eLinux.org
Jump to: navigation, search
Line 14: Line 14:
  
 
== Example Program ==
 
== Example Program ==
 +
[[File:Force-Sensitive Resistor LED program.jpg|thumb|200px|Bone config for example program]]
  
More to come...
+
I've written a program which demonstrates usage of the force-sensitive resistor, available [https://github.com/shinnsm/ECE497/blob/master/MiniProject02/miniProj2.c here]. The input is the force-sensitive resistor on pin 36 (AIN5), and the output is an LED on pin 12 (GPIO1_28). The physical configuration is shown in the image on the right.
 +
 
 +
The result of this program is that the harder one squeezes on the force-sensitive resistor, the brighter the LED illuminates. It is configured to require quite a bit of force for maximum brightness.
  
 
[[Category:ECE497]]
 
[[Category:ECE497]]

Revision as of 13:43, 22 September 2012

The force-sensitive resistor.

Overview

The SparkFun 0.5" Force Sensitive Resistor varies its resistance based on the amount of force applied to it. The larger the force, the lower the resistance of the device. When no force is being applied, the resistance is larger than 1MΩ. Like a regular resistor, it only has two leads. The FSR Integration Guide can be accessed here.

Bone Usage

The force-sensitive resistor works well when used with one of the BeagleBone's analog inputs. The images below outline how to hook it up. This schematic on the left is modified and originally from the SparkFun tutorial on the force-sensitive resistor. The example on the right outlines one way to hook-up the resistor to read values from the Bone.

Schematic Bone example

A 27kΩ resistor is used to connect the 3.3V source (pin 3) from the Bone to one pin of the force-sensitive resistor. Then, the other pin of the force-sensitive resistor is connected to ground (pin 1). An analog pin (AIN) on the Bone connects to the node containing both resistors, and values can be read off of that AIN. I'm using AIN5 (pin 36) to read values on the Bone.

Example Program

Bone config for example program

I've written a program which demonstrates usage of the force-sensitive resistor, available here. The input is the force-sensitive resistor on pin 36 (AIN5), and the output is an LED on pin 12 (GPIO1_28). The physical configuration is shown in the image on the right.

The result of this program is that the harder one squeezes on the force-sensitive resistor, the brighter the LED illuminates. It is configured to require quite a bit of force for maximum brightness.