Hi,
I am using 5 potentiometers (b560K) with Arduino mega. When we rotate the potentiometer the value shown on the serial monitor is up and down automatically and not stable on one value. Can you tell me how to stable these values?
Can you suggest which potentiometer (ohms) can control the servo motor?
Please post your sketch, using code tags when you do, and a schematic of your project. A photo of a hand drawn circuit is good enough as long as it shows how the components are connected and powered and the type of Arduino board that you are using
As to controlling a servo using a potentiometer, take a look at the map() function. It will allow you to convert the output from analogueRead(), which will be 0 to 1023, to the range needed to control the servo which is likely to be 0 to 180
The best approach is to lower the impedance of your circuit. According to the ATmega328P datasheet (Table 28-16 on page 328), the analog input resistance is specified as 100 MΩ. However, during an actual sample, the input resistance drops significantly as the sampling capacitor charges.
To achieve the best accuracy, it's recommended that the output impedance of whatever you connect to the A/D be 10kΩ or less. The sampling capacitor will hold the last sampled voltage, and you can lower the impedance by using a unity gain op-amp. If you're using potentiometers, their resistance value should be 10kΩ or lower.
You can also add a cap from the wiper to ground, that will help some.
A high value keeps current draw to minimum, we recommend you use a 10k linear potentiometer.
These have 270 degrees of movement. (Some are ten (10) or more turns)
You can take several readings on an analog input and do an average.
Welcome to the analog world You didn't specify how much your value is moving, however I'm going to guess it is a few counts. If this is the case then your issue is electrical noise coming in on the pot output line to the computer. In the analog world things are not absolute like digital. There is always some slight variation.
You can reduce this variation by putting a 0.1µf ceramic capacitor at the analog input pin of the Arduino board, and the closest ground on the board.
You stated it is B560k... the B indicates it is linear...
560k indicates it is 560kOhm... (end to end).
As said above this is on the high side...
Add small caps. Keep wires short. Bundle wires together. Use shielded wires. Accept some noise...