Need some help with SoftPot and pull-up/down resistor

Hello.
I am somewhat new to the world of electronics, so apologies in advance for asking a dumb question.
At least, I'm hoping it's a dumb question; with a simple answer... :roll_eyes:

I am using a SoftPot with my Arduino.

I would like to get a nice, linear stream of data from it, i.e: the value increases an equal amount for every cm you slide your finger along the SoftPot.
I would also like a unique (either very high or very low) if the SoftPot is not being touched.

My problems are as follows...
The analogue input floats when the SoftPot is not being touched.
Connecting the SoftPot like this...

Pin 1: 0V
Pin 2: Data
Pin 3: +5V

...give nice linear data (from 0 to 1020), but with the floating input when not touched.
Turning on the Arduinos built-in pull-ups doesn't pull the voltage up enough (i.e. it sits about 750).

Using a 10K resistor as a pull-up/down breaks the linearity of the scale, and the input sits at top/bottom of the scale when not touched (not far enough away for me to be able to distinguish between a low/high input, and no input.)

Any ideas as to what I might be able to try?

Thanks,
Dan.

Does swapping pins 1 & 3 around make a difference? I don't imagine it would, but the data sheet shows it that way.
Almost appears that the design expects to have the collecter pressed all the time.

Would this work?

Enable the internal pull-up (approx 47 K). That guarantees the pin doesn't float. Then as you move your finger along you progressively ground it. So it should be close to 0 at one end and close to 1023 at the other.

There is no simple answer that will provide you with the solution you are looking for. These pots are not suitable for direct connection to an A/D converter. The best you can hope for is a compromise like that given above. The larger the pull up resistor the closer you get, but also the more floating the input is.

Thanks for the tips, everyone.
I've learned a few things about softpots that might be useful to share...

  1. If you connect them straight up the Arduino, they will burn out if you hold them at the lowest resistance. This will hurt your finger!
  2. You can get around this by putting a resistor between the +5 and the softpot - I can't recall the exact value as I am away from home at the moment but I think it was 10K... it should be equal to the max value of the softpot, effectively halving the voltage placed across it.
  3. Using a resistor to halve the voltage, halves the Arduino's read range for the softpot.
  4. This means that, by enabling the internal pull-up on the analogue pin, I now get 0 to 510 when the softpot is pressed, and 1020 when the softpot is released. Result!
  5. Also, the lower range is a little more linear in terms of response. It doesn't look perfect, but it's close enough for now!

Thanks once again everyone.
Very useful info...

:slight_smile:

Dan

Good deal.
What are you doing with yours?

I had the same issue when using a circular pot, so I put a 680 Ohm resistor before VCC, and a 1 MOhm resistor as the pull down. Here is a link to the tutorial:

Arduino SoftPot LED Meter (Membrane Potentiometer)

Here is the example wiring diagram:

Well, there are immediately two major problems with your diagram. :astonished:

You show LEDs but no series current-limiting resistors.

Secondly, you are connecting LEDs to pins 0 and 1.

The way to estimate the pushing force and whether there is a push at all is to add something like a 100k resistor
to the analog pin and a digital pin. Set the digital pin HIGH, read the analog pin, set the digital pin LOW, read
the analog pin.

The mean of the two readings is a good estimate of the position, the difference between the two readings
will be smaller when more force is used, so can be used to estimate pressure - for instance you could ignore
any reading where the pressure is too low.

Basically you are injecting a bias current of either direction and seeing how much effect it has on the
result