Under Pressure

For my first big interactive puzzle, the primary form of input was in the form of a number of pressure plates. Sensitivity needed to be high enough to reliably detect whether or not a person was standing on a plate, but did not need to be fine enough to distinguish weights. A number of them were going to be necessary, so ease of construction was a factor as well. Three possible approaches were identified:

  • Simple electrical switch relying on a purely mechanical ‘pressure’ detection. In effect, a spring or similar mechanism keeping a top plate from touching the bottom plate, which would allow contact under weight, and wiring the plates so that when they touch a circuit would be complete.
  • Strain Gauge Load Cells. These are the components that are used in digital scales for actually measuring weights electronically.
  • Velostat Conductive Sheets. Sheets of a material whose resistance varies when pressure is applied to it.

Choosing The Approach

The first option, relying on a simple mechanical approach to open and close a circuit based on weight had a significant advantage in being the simplest approach from an electrical wiring perspective. The significant difficulty was that it would very heavily rely on the actual physical construction of the housing and mechanisms. Theoretically, something as simple as two pieces of plywood, with foam along the border to keep a little distance between the two, but with enough give that someone stepping would bring them together, could work. However, issues such as warping of the plywood, whether the foam(or spring, or other means of creating a ‘gap with give’) would deform, meant that there might be significant reliability issues. Making a physical mechanism to work reliably would actually be potentially prohibitive, so this option was removed from the running.

The strain gauge load cells would provide far more accuracy than was needed, and should prove fairly resilient to the potential reliability issues identified with the purely physical mechanisms. Actual construction would be much more forgiving than the physical mechanism approach. The components were the priciest of the three options however.

Velostat lacked the precision of the strain gauge, but had enough fidelity for the purposes of simple ‘is someone standing on this or not,’ was cheaper than the strain gauges, and was perhaps the simplest of all the options to actually construct. The combination of good enough, cheap and easy to assemble was what lead to this being the final choice for how to implement the pressure plates.

Velostat Basics

There are actually a large number of different variations of Velostat. Some have very high resistance, almost no resistance variation due to pressure, and are used as antistatic packaging. However, the type useful for this particular context exhibits a highly variable resistance based on pressure applied to the sheet. The particular variant I used was purchased from https://www.adafruit.com/

If you were to take a multimeter set to measure resistance, and place the leads on two different points on a Velostat sheet and then tried to press the sheet between the two points, you would not see much of a difference in the resistance at all. In fact, the resistance may be high enough a multimeter wouldn’t recognize it as having a closed circuit. The way to use the velostat is to take two flat conductive surfaces and sandwich the velostat between the two. Connecting a multimeter to two different surfaces sandwiching a velostat sheet, you will see a fairly high but measurable resistance if they are gently touching, and by applying pressure it should drop to near zero. The exact resistance without applied pressure will vary based on surface area touching, just how much weight or pressure is provided by the basic sandwiched position.

Measuring the Velostat from a microcontroller involved wiring a voltage divider circuit, with the Velostat serving as one resistor, and a fixed resistor as the second. Since reading the voltage that is ‘output’ by the voltage divider depends on the ratio of the Velostat resistance to the fixed resistor, it is important to choose a value for the fixed resistor that produces easily distinguished ranges for ‘pressed’ and ‘unpressed.’ I encountered issues with this when by improving how well the conductive surfaces and Velostat were touching I drastically shifted the ‘unpressed’ resistance(dropping it to at least 1/1000 of the previous value). Unfortunately, this meant the fixed resistors I had initially used were far too high and meant I had to rewire the microcontroller side of the system with different far lower resistance resistors.

Actual Internals

Here are the actual internals of the pressure plates. Two pieces of plywood, one with an upraised edge, the other cut just smaller so it will fit just within that upraised edge. The shiny foil like bits are copper tape. One word of caution, adhesives can serve as an insulator, there are copper tapes with conductive adhesive. For this sort of use, you definitely want the copper tape with conductive adhesive. The top side, with the visible copper tape, actually has a very thin(1/16 inch or less) square of foam underneath the copper tape. Since plywood can have some curve or bend, this helps maintain contact. On the opposite side, you see a square 12″ by 12″ piece of Velostat. Underneath that, there is a similar layer of copper tape. Wire is attached to both sides, and holes were drilled so the wires could be run out the bottom. In addition, the bottom piece of plywood had tracks routed so that the wires could be run underneath without the pressure plates resting directly upon them.

Software

Software to run the pressure sensors was actually fairly simple. A basic ‘analogRead’ on the appropriate pin would produce a value based on the voltage ‘output’ by the voltage divider. First, the software would need to calibrate itself. A number of readings would be taken over a configurable ‘calibration time.’ This would be multiplied by a configurable percentage, and if the value was below this threshold, then that would be considered ‘pressed,’ if above it would be considered ‘unpressed.’ There is an additional layer of very basic ‘debouncing.’ In order to avoid false positives, or values rapidly switching from one state to another when during a transition, it’s normal to apply what are called debouncing algorithms. In this case, I used a very simple approach, where the voltage had to be on one side or the other of the threshold for a set number of readings in a row before acknowledging the change. This number of readings was configurable as well.

Leave a Reply

Your email address will not be published. Required fields are marked *