Laboratory #2: Sensors, Resistance is not Futile!!

Care and Feeding of Interface Boards and Sensors

Please be cautious with wiring, and especially connecting batteries. Connecting a battery backward, only for a moment, can fry many components. Be careful with the wires connected to the sensors, as they can break off.

What to touch (and not)

Nothing in this lab can hurt you, unless you're allergic to something nobody else in the world is. Don't, however, touch any bare wires when running experimental trials (it's ok to touch them when setting up things of course). Hold the devices by the insulation on the wires, not on the soldered connections (if exposed). You'll see why in section 4 below.

The Parallax Basic Stamp II

For some of the hardware labs, we'll be using the Basic Stamp II from Parallax Inc. It's pretty cool for doing quick interface circuits, but sort of dumb from a programming perspective. It's also sort of slow compared to some processors (but so are almost all human motions).

Directories, files

You might want to make your own directory, either in your home directory as mounted and mapped from the CS or Princeton domain, or just make one on the desktop and name the folder with your name or group. Note that putting a directory on one desktop won't make it appear on any other machine in the lab, nor outside the lab. This is sort of a drag, but it's Windows.

1. Force Sensing Resistors

1.1 Measuring Position Using an FSR

First, we will use a Linear Force Sensing Resistor to measure position.
The circuit shown in Figure 1-1 will be used to measure the output of the FSR.
Figure 1-1: Linear FSR Measurement Circuit


Depending on your platform and version of the Stamp Editor/Loader,
the editor might complain and offer to fix various things.
Basically let it do what it wants and things usually work out.
If all has worked well, a debug window should appear and
numbers should begin scrolling down, in that window.
If not, check battery, wiring, serial port selection, etc.


  1. What happens as you press on the FSR in various locations ?
  2. Is the output a function of where you press it? How?
  3. Is the output a function of how hard you press?
    (Note: try to keep the surface area constant.
    For example, you could use a pencil eraser to touch the Linear
    Position FSR. Do not use anything sharp!) How?
  4. What happens when you don't press it at all? Comment on this.
  5. What is the numerical range of the sensor?
  6. How fast can you tap the sensor and see the effects?
  7. What kind of signal conditioning circuit is Figure 1.1?
  8. What are the pros and cons of using this circuit?

1.2 Measuring Force Using an FSR

Here we'll use the circuit shown in Figure 1-2:
Figure 1-2: Pressure FSR Measurement Circuit



  1. Is the output a function of how hard you press?
  2. Is it different from the Linear FSR in section 1.1?
  3. What is the numerical range of the sensor circuit?
  4. How fast can you tap the sensor and see the effects?



  1. Plot the responses as a function of the number of quarters.
  2. Was the output a linear function of the number of quarters?


If all worked right, you'll be looking at a plot that was captured from your FSR pressing experiment.
If not, check and repeat all prior instructions carefully. Questions:

  1. What is the relationship between pressure on the sensor and the numeric output of the circuit?
  2. Devise a MATLAB function to linearize the relationship between pressure on the sensor and the plotted result.
Procedure: Questions:
  1. What do you see in the two plots?
  2. Are they different? Why might this be?

2. Potientiometers

Here we'll measure the rotational position of a rotary potentiometer
shown in Figure 2-1.
Figure 2-1: Drawing and electronic symbol of a potentiometer.


  1. What is the numerical range of the output?
  2. What is the approximate degree rotation range of the potentiometer?
  3. What is the approximate resolution of the sensing system (in integer values per degree)?
  4. Based on the maximum numeric output of the A/D, how many bits are required to store this value? Assuming perfect linearity of the A/D, if Vref = 5 volts, how many volts per unit difference in the output are represented by the A/D?
Here we'll look at a linear potentiometer, as shown
in the same Figure 2-1.


  1. What is the numerical range of the output?
  2. Is is linear in position (do the positions 0.0, 0.1, 0.2, ... 0.9. 1.0 reflect similar integer outputs in the A/D readings)?
  3. If not, how might you explain the output, and how might you propose to linearize the output if required for your application?

3. Bend-sensitive Resistor

  1. What is the numerical range of the output?
  2. Is the output symmetric for bending one way vs. the other? Why might this be?

4. Oh My!! I'm resisting!

  1. What did you observe for your finger trials??
  2. Can you think of an HCI use for skin resistance? What?
  3. What would be some disadvantages of using skin resistance for a general HCI interface?

5. Photo-sensitive Resistor

  1. What is the total numerical range of the output?
  2. Describe the behavior of the photoresistor in the above experiments.
  1. General question: Based on the total range of the A/D for all sensors (largest and smallest numbers you saw), how many bits resolution is it?
  1. Practical HCI system thought problem: Range of motion in human joints is a very important metric for diagonisis and treatment of many conditions, and for the study of sports, dance, and other body-related activities.. Given what you've learned about the devices in this lab, describe and sketch a system for measuring the bending range of a human elbow or knee.

CS436: Human-Computer Interface Technology, Princeton University, Autumn 2005
Authors: Perry Cook
Copyright 2002-2005, Princeton University