SoftPot Hookup Guide

Pages
Contributors: Jimb0
Favorited Favorite 3

Introduction

Soft potentiometers are very thin and very unique potentiometers. Instead of a knob or physical slider, the softpot’s wiper is any object – a finger, pen cap, stylus, etc – that can slide across its sensor membrane. Softpots can be used as position sensors in CNC machines, volume control sliders in custom stereos, throttles for drones, or in any project that requires linear movement sensing.

SoftPot Membrane Potentiometer - 50mm

SEN-08680
$4.95
1

Like any potentiometer, the softpot is a three terminal device. The middle pin is the wiper, and the other two terminals are the high and low ends of the resistive element. By supplying the outer terminals with a power and ground connection, the middle terminal can be used to produce a variable voltage.

Suggested Materials

This tutorial serves as a quick primer on soft potentiometers, and demonstrates how to hook them up and use them. In addition to the softpot, the following materials are recommended:

Arduino Uno – We’ll be using the Arduino’s analog-to-digital converter to read in the variable voltage of the softpot. Any Arduino-compatible development platform – be it a RedBoard, Pro or Pro Mini – can substitute.

Breadboard and Jumper Wires – The soft pot three terminals are breadboard compatible. The breadboard is used as an intermediary device between sensor and jumper wires to the Arduino.

Breadboard - Self-Adhesive (White)

PRT-12002
$4.95
36
Jumper Wires Standard 7" M/M - 30 AWG (30 Pack)

PRT-11026
$1.95
20

DEV-12757
127 Retired

Suggested Reading

SoftPot’s are a great entry-level component for beginners, but there are still a few basic electronics concepts you should be familiar with. If any of these tutorial titles sound foreign to you, consider skimming through that content first.

Analog to Digital Conversion

The world is analog. Use analog to digital conversion to help digital devices interpret the world.

What is an Arduino?

What is this 'Arduino' thing anyway?

Resistors

A tutorial on all things resistors. What is a resistor, how do they behave in parallel/series, decoding the resistor color codes, and resistor applications.

Analog vs. Digital

This tutorial covers the concept of analog and digital signals, as they relate to electronics.

SoftPot Overview

Softpots come in a variety of sizes. The SparkFun catalog sports 50mm, 200mm, and 500mm long softpot strips. You can also find circular, arc-shaped, or other uniquely-shaped softpots in the market.

SoftPot Membrane Potentiometer - 200mm

SEN-08679
$11.95
2
SoftPot Membrane Potentiometer - 500mm

SEN-08681
$19.95
2
SoftPot Membrane Potentiometer - 50mm

SEN-08680
$4.95
1

The 50mm and 200mm softpot’s feature a 10kΩ overall resistance between the outer-two terminals, while the larger 500mm softpot measures in at 20kΩ.

Placing your wiper at the base of the soft pot will effect a nearly 0Ω resistance between the middle pin and pin 1 (indicated by the arrow). When the wiper reaches the far end of the soft pot, the resistance will approach 10kΩ. And, if the wiper is in the middle, the resistance should be around 5kΩ.

Resistance along soft pot

The softpot is generally linear across the entire sensor area, so any math you’ll do to determine a wiper’s position should be relatively simple!

Example Circuit

By supplying a voltage to the outer pins of the SoftPot, we can generate a variable voltage on the middle wiper pin. Here’s an example hookup:

Fritzing example circuit

A 10kΩ resistor between the wiper and ground pulls the SoftPot’s analog output signal down. This ensures that the sensor’s output value doesn’t “float” – a term we use when the voltage of a signal is bouncing around with no real certainty.

By connecting pin 1 to ground and pin 3 to 5V, we cause the voltage on the middle pin to rise from 0V to 5V as the wiper moves from the bottom of the softpot (towards the terminals) to the top. Reversing the power supply can swap that relationship around.

Example Code

Here is a simple Arduino example based on the circuit above. Copy and paste this into your Arduino IDE, then upload!

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE.

If you have not previously installed an Arduino library, please check out our installation guide.

language:c
/******************************************************************************
SoftPot_Example.ino
Example sketch for SparkFun's soft membrane potentiometer
  (https://www.sparkfun.com/products/8680)
Jim Lindblom @ SparkFun Electronics
April 28, 2016

- Connect the softpot's outside pins to 5V and GND (the outer pin with an arrow
indicator should be connected to GND). 
- Connect the middle pin to A0.

As the voltage output of the softpot changes, a line graph printed to the
serial monitor should match the wiper's position.

Development environment specifics:
Arduino 1.6.7
******************************************************************************/
const int SOFT_POT_PIN = A0; // Pin connected to softpot wiper

const int GRAPH_LENGTH = 40; // Length of line graph

void setup() 
{
  Serial.begin(9600);
  pinMode(SOFT_POT_PIN, INPUT);
}

void loop() 
{
  // Read in the soft pot's ADC value
  int softPotADC = analogRead(SOFT_POT_PIN);
  // Map the 0-1023 value to 0-40
  int softPotPosition = map(softPotADC, 0, 1023, 0, GRAPH_LENGTH);

  // Print a line graph:
  Serial.print("<"); // Starting end
  for (int i=0; i<GRAPH_LENGTH; i++)
  {
    if (i == softPotPosition) Serial.print("|");
    else Serial.print("-");
  }
  Serial.println("> (" + String(softPotADC) + ")");

  delay(500);
}

After uploading, open your serial monitor, and set the baud rate to 9600 bps.

Then actuate the softpot by sliding a finger, pencil eraser, tool grip, or anything slide-able across the sensing area of the potentiometer.

Softpot slider in action

A series of line graphs should begin flowing by in the serial monitor.

Serial monitor example

The raw ADC reading is also printed out after each reading. Take that, and start building sliding control systems of your own!

Resources and Going Further

If you need any further SoftPot-related documentation, here are a few resources that may help:

Now that you’ve set your Arduino up with slide-control, what are you going to build? Need some inspiration? Check out some of these SparkFun tutorials:

Touch Potentiometer Hookup Guide

Learn how to use the SparkFun Touch Potentiometer to control lighting, volume or other inputs in your daily life.

Rotary Switch Potentiometer Hookup Guide

How to use the Rotary Switch Potentiometer breakout board, with some sample applications.

Bare Conductive Musical Painting

Learn how to make a musical painting using the Bare Conductive Touch Board and Conductive Paint.

MP3 Trigger Hookup Guide V24

Incorporate sound into your next project easily with the MP3 Trigger.