## Variable Resistors

Types:

Force Sensing Resistors:

• Made up of a resistive material applied to a film, a spacer adhesive, and another film printed with interdigitating contacts.

• The resistive material makes an electrical path between the two sets of conductors on the other film.
• When a force is applied, a better connection is made, resulting in a lower resistance.
• Three basic regions of operation:
1. initial abrupt change (around 10 grams of force) in resistance
2. a large region where force is basically proportional to 1/R
3. a saturation region where additional force produces little additional decrease in resistance

• Not appropriate for accurate measurement of force.

Reading Variable Resistances with the Arduino:

• We can read voltages across a variable resistor using the built-in analog-to-digital converters on the six analog pins of the Arduino board.

• One generic option is to connect the resistor as shown below. You could potentially use other resistors in the circuit to adjust the voltage values to a desired range, but it is usually easier to make the adjustments after the values are read. The 10 K ohm resistor keeps the current relatively low in the circuit and reduces power consumption.

• Use the analogRead( pin ) routine to obtain a value proportional to the resistance of the sensor.

• The analogRead( pin ) converts voltages from 0 - 5 volts into integer values from 0 to 1023 (or 10-bits of resolution). It takes the system about 0.0001 seconds to perform the operation, so the maximum read rate is about 10000 Hz.

 int ledPin = 13; // LED pin int analogPin = 3; // potentiometer pin int val = 0; // variable to store the value read int threshold = 512; // threshold void setup() { pinMode(ledPin, OUTPUT); // sets the digital pin 13 as output } void loop() { val = analogRead(analogPin); // read the input pin if (val >= threshold) { digitalWrite(ledPin, HIGH); // sets the LED on } else { digitalWrite(ledPin, LOW); // sets the LED off } }