Maker Portal

View Original

Arduino SoftPot LED Meter (Membrane Potentiometer)

See this content in the original post

See this content in the original post

The SoftPot uses touch to connect the internal resistance to the data pin within the potentiometer. Therefore, if we are not touching the SoftPot, we have a reading of 0 V (assuming there is also a pull-down resistor to stabilize the signal). The figure below shows the inner workings (simplified) of the potentiometer. We can think of it as a varying resistance connected in a voltage divider. If we have no contact with the SoftPot, we get close to 0 V running through the data pin:

And if we touch the SoftPot at some point along the circular membrane, we create a connection between the data pin, the internal resistance of the membrane, and the voltage pin. Depending on the touch location, the resistance of the membrane will change, therefore resulting in a change in voltage (in the case of Arduino, from 0V - 5V). A touch can be visually modeled as shown below:

The SoftPot has a linear resistance response based on touch location, meaning that as we move along the circular path, we expect a linear voltage increase based on the touch location. This means that we could rev-up a motor or open a valve linearly based on the touch location. And in our particular case, we can divide the touch location into the amount of LEDs we are using, and get each LED to light up based on its particular fraction along the path of the circular membrane. If any of this is unclear, I will demonstrate later in this tutorial.


See this content in the original post

The parts used in this tutorial are shown below:

See this content in the original post

The wiring is incredibly important because of the sensitivity of the SoftPot. If the SoftPot experiences too much current, it will burn up and overheat, making the potentiometer useless. Therefore, I recommend using a several-hundred valued resistor on either end of the power/ground wiring, and a pull-down resistor to handle the data pin. The pull-down resistor will allow the user to set the untouched value to zero, and the maximum value to nearly 1023 (for the 10-bit Arduino).

See this content in the original post

I also elected to use 5 LEDs in my case, but up to 19 LEDs can be used (assuming the SoftPot is switched to pin A5). The easiest and most robust solution is to keep the SoftPot on A0 and use 14 LEDs from D0 - D13.

Also note: the middle pin on the SoftPot is the data pin.


See this content in the original post

The Arduino code below uses the number of LEDs inputted by the user to create a visual meter showing how much voltage is being transmitted through the SoftPot. In other words, as the user presses along the SoftPot, the LEDs will light up in succession, and turn off in succession as the user lets go of the SoftPot. This can also be used to power other devices like fans, simply based on the point of depression on the SoftPot.

See this content in the original post

See this content in the original post

In this tutorial, I demonstrated how potentiometers work and how to apply their linear response to a set of LEDs. The SoftPot, or soft potentiometer, demonstrated that the change in resistance of a voltage divider changes the voltage output of the SoftPot’s data pin. We can read the corresponding voltage using one of the Arduino’s analog pins. From there, we used a series of LEDs (5 in my case) to represent the voltage change visually through a light meter (or real-time LED meter). This gives us a visual representation of where the SoftPot is being pressed at any given time. Potentiometers are used in everyday consumer electronics from volume and tone knobs on guitars to heating and air-conditioning rheostats. The use of a SoftPot is a modern adaptation of a simple concept used everyday.


See More in Arduino and Engineering:

See this gallery in the original post