Hi, I’m trying to hookup 8 analogue pots in parrallel. Using a common ground and 5V and sending each wiper to it’s own analogue pin (A0, A1, A2 etc). However, I am getting all kinds of weird results. It seems as though when I move the cables slightly it effects my readings. For instance; one of the pots might not be working at all but then i move the cables a bit and suddenly it works but with loads of noise and then sometimes it works perfectly (with no noise).
I then unplugged all of the pots and tried testing each one idividually and it was doing the same thing on all of them on their own... more or less.
I am using 1 Kohm potentiometers and have duplicated ‘reading = analogRead(A0);’ in order to ensure that the ADC has enough time to approximate the value. Like this: -
I have also soldered all of my cables onto male pin headers in order to ensure that the connections with the arduino are as stable as they possibly can be. I really can’t think of anything else that might be causing these unstable readings apart from possbily either that I have used stranded cables for the potentiometer wipers or that maybe 1kohm is too low of a value of resistance. But if the amount of resistance was the problem then why would they sometimes be working but then sometimes not?
One other possiblity is that the pots are dud. They were pretty cheap to be fair. They cost about £1 each. Should I be spending more on them tthan this? If so... could someone please provide me with a link to some worthwhile pots as this problem has happened on a few occassions for me and every time i buy a set of pots that happen to be not good enough i end up wasting my money
the schematic below shows how i am connecting the pots and the here is my code (all very simple):-
You say "unplugged all of the pots". May we guess you are using a breadboard?
Also. go and read the instructions, then go back and modify your post (use the "More --> Modify" option to the bottom right of the post) to mark up the code as such so we can examine it conveniently and accurately.
This may seem trivial for your example, however it is anything but.
yeah i know how to use the <> button but for some reason (probably that i was tethering off my phone and had a bad connection) that button was not showing as available when i posted this yesterday. However, it is now so here you go: -
Like I said however, I dont think it's the code as A; the code is pretty basic and B: it works perfectly on some pots but not others.
The wiper cables are about 11cm long (on average). Is this too long? The common ground and 5v are connected through perfboard with the cables from each pot to the perfboard between 3cm and 5cm and then the two GND and 5V cables which go from the perfboard to the Arduino are about 10cm.
Can you please post a picture of your project so we can see your layout and the type of potentiometers you are using.
Do you have a DMM to check the voltages at the analog inputs when you have problems?
Thanks.. Tom...
PS I have noticed too that some of the icons will not initially work on first click.