Need help with linear Potentiometers

Hello, This is my first post here and I'm not really that much into electronics, I only know the basics, so please go easy on me and try to not get too technical :slight_smile: I already tried to search this issue on google, but the ''answers'' were too technical so it didn't really help me.

I build myself a Cessna Throttle quadrant for the upcoming Microsoft flight simulator.
It's a very simple 2 metal rods attached to 2 linear sliding pots powered by a Arduino Leonardo.
The problem i'm having is, the linear pots aren't very linear. When the physical slider is on 50%. my pc shows 60%. The other pot even shows 70 to 80% when it's on 50%.

Is this a fixable thing if I install new pots? If so which ones would you recommend?
Btw I read that this is normal because of the 20% tolerance rating. But I know there are joysticks with pots in them which have true linear input, so it must be possible.

This is the pot i'm using from Conrad. ''ALPS 401768 Schuifpotmeter 10 kΩ Stereo 0.5 W Lineair''

Wiring is:
Pin 1 to 5v
Pin 2 to A0 and A1
Pin 3 to GND
(5v and GND are chained on the 2 pots)

The code (I didn't write it)

#include <Joystick.h>

Joystick_ Joystick;

int zAxis_ = 0;
int Throttle_ = 0;

const bool initAutoSendState = true;

void setup()
{
Joystick.begin();
}

void loop(){

zAxis_ = analogRead(A1);
zAxis_ = map(zAxis_,0,1023,0,255);
Joystick.setZAxis(zAxis_);

Throttle_ = analogRead(A0);
Throttle_ = map(Throttle_,1023,0,255,0);
Joystick.setThrottle(Throttle_);

delay (1);
}

Fixed pitch prop? Not constant speed?

CrossRoads:
Fixed pitch prop? Not constant speed?

Yep, I prefer the C172 and 152 So I didn't see the need for a prop lever.

Looks like you have a log taper "volume control" pot rather than a linear taper type.

JCA34F:
Looks like you have a log taper "volume control" pot rather than a linear taper type.

But it's advertised as linear on Conrad. However they do say it's for audio, video and lightmixing panels.

You can 'fix' some non-linearity of a linear pot (10KB) with a suitable (high value) resistor between analogue input and ground OR between analogue input and VCC. Start with 100k, or use a 100k trim-pot.
Correcting a log pot (10KA) is harder.
Are you sure you didn't connect it wrong when testing. Carbon tracks easily burn.
Leo..

Hi,
Double check with a DMM.
Put the slider in the middle position and measure the resistance between slider and one end, then slider and the other.

Also with the pot connected to your Arduino measure the voltage on the slider with it positioned at halfway.

Usually you use a rotary pot for joysticks and most resistor types of joystick use pots.

Tom... :slight_smile:

Wawa:
Are you sure you didn't connect it wrong when testing. Carbon tracks easily burn.

Actually.. I have to admit I was very sloppy with the soldering and some of the solder connected with the pot casing which caused a spark every time I moved the slider. that only happened on 1 of the pots, but they both have the same problem. Could they have burned both because they were chained together?

The data sheet shows the resetability to be +- 15%. IS that what you are seeing? That means moving the slider to either end and back to the original position will be withing 15% of the beginning resistance. Nothing to do with linearity.

Paul

Change your loop() to this, what does it read with the pot in the center position? Should be near 512.

void setup()
{
   Serial.begin(9600);      
   Joystick.begin();
  }
void loop(){
 
zAxis_ = analogRead(A1); 
Serial.print(zAxis); Serial.print("\t");
zAxis_ = map(zAxis_,0,1023,0,255);
Joystick.setZAxis(zAxis_); 
 
Throttle_ = analogRead(A0);
Serial.println(Throttle);
Throttle_ = map(Throttle_,1023,0,255,0);         
Joystick.setThrottle(Throttle_);               
 
delay (500);
}

JCA34F:
Change your loop() to this, what does it read with the pot in the center position? Should be near 512.

Can't use the code. It says zAxis was not declared in this scope

Paul_KD7HB:
The data sheet shows the resetability to be +- 15%. IS that what you are seeing? That means moving the slider to either end and back to the original position will be withing 15% of the beginning resistance. Nothing to do with linearity.

Paul

But if the pot is at 50% and it reads at 70 or 80% that's more then 15%

At least I think that's what you mean.

davidkarji:
But if the pot is at 50% and it reads at 70 or 80% that's more then 15%

At least I think that's what you mean.

It means if you put a piece of tape ACROSS the pot so as to mark the return position, measure the resistance at the point, and move the slider to one end and back to the tape, the resistance at the point will be withing +- 15% of what the first resistance showed. That seems like a lot of slop in the mechanical connection between the slider handle and the contact with the resistance strip.

Paul

I have to admit I was very sloppy with the soldering and some of the solder connected with the pot casing which caused a spark every time I moved the slider.

You shouldn't be able to get a spark (arc) from low voltage. You can get a high voltage kick-back (back EMF) from inductor (or inductance from a motor or solenoid).

However you can get heat and a "glow" or smoke with excess current.

Could they have burned both because they were chained together?

About the only to burn a "normal pot" with low voltage is by mis-wiring it and connecting the slider to a voltage source or ground. With the slider toward one end you can have a low resistance (high current) path and it can get burned/damaged.

Hi,
Try this edit;

void setup()
{
   Serial.begin(9600);     
   Joystick.begin();
  }
void loop(){
 
int zAxis_ = analogRead(A1);
Serial.print(zAxis); Serial.print("\t");
zAxis_ = map(zAxis_,0,1023,0,255);
Joystick.setZAxis(zAxis_);
 
int Throttle_ = analogRead(A0);
Serial.println(Throttle);
Throttle_ = map(Throttle_,1023,0,255,0);        
Joystick.setThrottle(Throttle_);              
 
delay (500);
}

Do you have a DMM, please read post #6.

Tom... :slight_smile:

Guess I should have posted a video. ::slight_smile:

TomGeorge:
Hi,
Try this edit;

Do you have a DMM, please read post #6.

Tom... :slight_smile:

It's still giving me the same error.

nope I don't have a DMM :slight_smile:

Hi,
This should be better, user the Monitor in the IDE, set baud to 9600.

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  int zAxis_ = analogRead(A1);
  Serial.print(zAxis_); Serial.print("\t");
  zAxis_ = map(zAxis_, 0, 1023, 0, 255);

  int Throttle_ = analogRead(A0);
  Serial.println(Throttle_);
  Throttle_ = map(Throttle_, 1023, 0, 255, 0);

  delay (500);
}

Tom... :slight_smile:

davidkarji:
Actually.. I have to admit I was very sloppy with the soldering and some of the solder connected with the pot casing which caused a spark every time I moved the slider. that only happened on 1 of the pots, but they both have the same problem. Could they have burned both because they were chained together?

Now, we HAVE to see a schematic. You have something seriously wrong if you are seeing sparks from the pot.
(Please NO Fritzing pictures).

Connecting the wiper to VCC or ground causes the carbon track to burn up, with sparks.
Been there, done that (~60-years ago).
That explains the non-linearity as well.
Get a new pot, after you have shown us how you have (and had) hooked it up.
Leo..