I'm pretty noob for Arduino and I'm trying to test linear potentiometer and rotary potentiometer.
For the rotary potentiometer, everything works ok, on Serial monitor it shows from 0 to 1032.
However, something is weird about linear potentiometer. First thing is it gets really hot very fast and another thing is on Serial monitor, the number doesn't start from 0. It starts from 200, but maximum number is 1032.
Wiring for linear potentiometer is exact same as how I did for the rotary potentiometer. I attached two images for schematics. One is just really basic way which I saw a lot online. I tried it and it was getting hot. So I tried another way which you can see on another image I attached, it's with the resistor. The linear potentiometer I'm using is 10k ohm, so I used resistor for that. I tried with resistor and it was still getting hot.
I'm not really familiar with this kind of stuff and I couldn't find out how I need to fix this.
The linear potentiometer has a power rating of 0.25 (1/4) W and it has a resistance value of 10K Ohm.
Please help me for this issue and I really appreciate for your help
I tried several time to insert image files so everyone can see directly without downloading but it didn't work so I ended up attaching those, sorry about this issue.
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(A1); // Linear
int sensorValue2 = analogRead(A3); // Rotary
Serial.println(sensorValue);
Serial.println(sensorValue2);
delay(1);
}
It must be wired incorrectly - the power dissipation of a 10k pot off 5v is 0.0025 Watts.
If you have , for example the slider connected to 5v , it would get very hot when set down one end .
Alternatively if you the Arduino pin set as an output , that might be the problem ( not the case in yr sketch )
If your circuit is actually wired like you showed in the diagram (the one without the fixed resistor) then it should work just fine. Assuming it is, then I suspect that your slider is defective.
You don't need an additional resistor, nor a capacitor.
Oh so, does that mean I need capacitor like 50v one? So it can get enough voltage to run.
No.
It looks like you have misidentified the connections on you linear slider.
The two ends can be identified by measuring the resistance with a meter. When you find two connections where the resistance does not change as you move the slider then the connector you are not measuring is the wiper of the pot.
The pinout of a linear pot is not something you can just guess, you have to check with a multimeter or
read the correct datasheet. Sometimes the end-most pin is the slider which seems confusing (until
you see how they are constructed internally).