Laboratory #3: Capacitive (and Related) Sensors

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

Nothing in this lab can hurt you, unless you're allergic to something nobody else 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).

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 many human motions).

1. The RC Time Constant, using a capacitor to measure an FSR

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



  1. Is the output a function of how hard you press?
  2. What is the numerical range of the sensor circuit?
  3. Note, while pressing and releasing a number of times, the minimum and maximum value for the FSR. Which is for maximum pressure and which is for minimum? Does this make sense given what you know about the resistance as a function of pressure, the circuit, and the RC time constant? (Please say more than "yes" here or you won't get any points).

2. Measuring capacitance

Procedure: Questions:
  1. Squeeze and release the FSR some and note the minimum and maximum values. How do these relate to the min and max values for the green capacitor?
  2. If I state that the green capacitor is 0.022 microfarads, then estimate the capacitance value of the orange capacitor.
  3. Do notice anything about the time required to do the RCtime function vs. how hard you're pressing the FSR? Why might this be? Could this be bad for any reason? Can you comment on some situations where this could introduce difficulties?

3. You have capacity too!

Procedure: Questions:
  1. Alternately touch and release the B0 terminal with your finger. Do you see any difference in the displayed value? What are the min and max values?
  2. If I say that the base capacitance of the untouched terminal is 0.0001 microfarads, then what is the capacitance with your finger added into the circuit?
  3. Delete the debug statement in the PBasic program, and replace it with:

    if myword < 100 then nopress
      debug "Hi!! "

    What happens when you touch and release the B0 terminal? Describe some possible applications of this most wonderful circuit.

4. Piezo sensor

Procedure: Questions:
  1. Is the output a function of how hard you press? Can you tell?
  2. How fast can you tap the sensor and see the effects?
  3. Is it a function of how hard you tap it? Can you tell?
  4. Let the sensor rest and note the values coming out. Now lay a quarter on the sensor and note the values. Comment on this sensor's usefulness for measuring constant pressure, vs. changing pressure or tapping.
Procedure: Questions:
  1. What's the min and max you were able to get the A/D to read?
  2. Comment on this code versus the last, and what this might mean.
Procedure: Questions:
  1. Can you see in the plot how you tapped the pattern on the sensor?
  2. What are the minimum and maximum values in the plot?
    (Note you can do this using the matlab max and min functions).
  3. How much noise is there between taps? (make up your own way of quantifying and describing this).
  4. Modify the code to print out the word "Bang" when you bang on the Piezo sensor (see section 3. above). Include a listing of your entire "Bang" program with your lab report.

5. Accelerometer

Procedure: Questions:
  1. What were the down, rest, and up values?
  2. What were the min and max values?
  3. The rest value corresponds to zero gravities (Gs)of acceleration.
    The down and up values correspond to 1 and -1 Gs.
    Given that, how many Gs maximum positive and negative did your shaking induce?
  4. Could you use this device to track head tilt?
  5. Go back and take measurements for flat, 45 degrees, and 90 degrees, -45 degrees, and -90 degrees tilt.
    Plot these values, number vs. tilt.
    Is it linear? Why (or not)?
    If not, come up with a function that converts the PulseIn numbers to tilt in degrees.

And finally.....

  1. Practical HCI system thought problem: Pick two of the sensors/systems you've looked at in this lab, and describe a new and novel computer application. Draw a block diagram of the system, sketch a user using it, and describe a simple test you might run to evaluate the performance of this new system.

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