Hey all, I'm having issues getting consistent performance out of my potentiometer. This is part of a much larger project, although I have stripped everything else away in an effort to better diagnose the problem and ask for help. Even with the most basic setup the problem still remains.
I have a 10K pot (specifically this one) connected to the +5V/GND pins of the arduino, with the signal wire going into analog pin A1. My code is as follows:
double side_pot = 0;
void setup() {
Serial.begin(115200);
#if !defined(__MIPSEL__)
while (!Serial); // wait for serial port to connect
#endif
}
void loop() {
side_pot = analogRead(A1);
Serial.println(side_pot);
delay(20);
}
About as simple as you can get. About half of the time I can get good readings out of my pot (a bit jittery but nothing abnormal), but the other half of time it stays stuck at the max value of 1023. If I bend the wires coming out of the pot with my finger I can get it to jump between the two states (good reading and stuck at max value). However I can't narrow the problem down to an individual wire - I can get it to happen consistently with any one of the three. The pins going into the arduino seem fine, if I wiggle the wire going into A1 the readings stay fine, and same for the 5V and GND. Clearly something is up with the pot itself, or the connections coming out of it.
My solder joints look ok (I think) so I'm not really sure if one of the wires is bad, especially since it happens with all of them. I've read online that excess heat from soldering can damage pots - is this to blame?
I'm using this pot to (eventually) measure and constrain the movement of a motor, so if the values are unreliable it will break my whole mechanism.
You should NOT have used the holes to solder the wires on.
Those holes are the rivets that connect the lug to the carbon track.
That connection is now unreliable because of the mechanical stress and the flux in between.
Throw away the pot, and connect the wires to the pins (or lugs) of the pot.
Leo..
Ok, had a rough time soldering onto the little pins. Still pretty new to this. :-[ Looks pretty bad but the joints feel strong-ish just moving them with my fingers. I tested the lines with a continuity tester and everything seems stable.
The results (as far as getting good values out of it go) are about the same if not worse than before. Is it just another botched solder job or is something else up?
With 10k pot at mid-range.
Measure resistance black to yellow, move dupont connectors.
Measure resistance red to yellow, move dupont connectors.
You should always see ~5k ohms, i.e. never infinity.
Measure Bk to Y resistance, rotate shaft, should be a ‘smooth’ 0 to 10k reading.
vice versa for R to Y.
Assume soldered wires under heat shrink are soldered.
Assume proper crimping in dupont pins.
I think the assumptions you stated are fair - I feel confident about those.
I measured between the different points as specified and found that the reading would frequently jump to infinity when I moved the connectors. This is was true for both Bk to Y and R to Y.
If I keep everything still I can see a smooth 0 to 10k when turning the shaft.
Would I still expect to see no infinity readings if the pot was damaged in some way? Just curious how everything works.
I just performed the test again taking extra care to make sure the leads are pressed firmly against wires and saw a lot less infinity readings. I also did a similar test with the leads directly touching the pins of the pot itself and saw the same results. I think its safe to say the leads may have been slipping a bit when I moved the wires around.
What I do with pots is thread the wire through the hole and back round to the solder lug. That provides a little relief on the solder joint- not much, but at least a little, if the wire gets bumped.
I'm going through the same issues right now and finding this thread helpful. What was the final fix? Was this all just making sure you had good solder joints?