Analogue outputs mixing

What exactly happened --->>
Hello !
I use Arduino Uno. Recently I discovered about unojoy & uploaded the code it's on chip. It all worked VERY FINE until I connected the same Arduino Uno into my friend's PC via usb cable (using the same cable that I used to connect Arduino Uno to my PC except he had a USB extension cable which I think was faulty which caused all the problem). My Uno had 2 potentiometers with their middle pin outputs going to pins A0 (steering wheel) & A1 (accelerator pot) respectively. Until the problem appeared, the controller testing screen was showing distinct outputs for 2 potentiometers according to the potentiometer movement. But suddenly something went wrong. :confused:

MAIN PROBLEM --->> Now, consider this case. I connect ONLY 1 potentiometer to any of the analogue pins (i.e any pin from A0 to A5) in this case let's say A0. My program reads input of 2nd potentiometer from another pin as well, lets say A1. This means I'm taking output for 2 potentiometers through 2 pins. Now, in this case under normal conditions, the controller testing screen should show me output from A0 very precisely & A1 pin output should go haywire as there is no input given to it. But now after the problem appeared, the A1 pin is also showing the EXACT SAME & PARALLEL reading as that of the A0 potentiometer pin. No matter what pin I use from A0 to A5, all the outputs which I'm reading through the program, show THE SAME READING & are getting controlled by SINGLE POTENTIOMETER SIMULTANEOUSLY. This means all the analogue outputs are being controlled simultaneously by the input pin from which the very first analogue input is read. If I connect another potentiometer (or more than one) to the A1 (or other more pins), the value jumps to constant 1023 & shows full reading which doesn't change with potentiometer movement. What is the problem ?
I suppose that the USB extension cable at my friend's was faulty & something is damaged on the circuit board due to the leakage current but exactly what component is damaged ?!

Installation & Troubleshooting
For problems with Arduino itself, NOT your project

TheMemberFormerlyKnownAsAWOL:

Installation & Troubleshooting

For problems with Arduino itself, NOT your project

So basically I shouldn't be posting this problem under this section ?!

There is one A2D converter. I works by taking a sample of the input and saving it on a capacitor, then measuring the voltage on the capacitor. If you then immediately switch to an unconnected pin the voltage on the capacitor might well remain what it was for the previous reading, giving you the same result. No guarantee this will happen, but it might.

Why are you reading an unconnected pin to start with? :confused: :slight_smile:

What do you read if you ground unused pins rather than allow them to float?

Ron

JCA34F:
Why are you reading an unconnected pin to start with? :confused: :slight_smile:

No no. See, I'm reading the pins in order. First I read A0 to which a potentiometer is connected. Then I'm reading A1 which is just free. So I'm reading a pin A0 to which the pot is actually connected. And it's showing some value on the output screen of controller testing window. Now another pin A1 is just free or not connected to anything. But it shows the same reading as that of the 1st pin. I hope I could explain properly

Ron_Blain:
What do you read if you ground unused pins rather than allow them to float?

Ron

Firstly consider, I connect only 1 potentiometer. In this case, all the pins I'm taking output for, show the same & parallel value or change in value. BUT as soon as I connect another pot (in which case SOME signal is being sent to this new pin to which the pot is newly connected now.....) shows full 1023 reading regardless of potentiometer movement. But the first potentiometer still shows VERY PRECISE reading as per the pot movement.
So.....
When I try to read more than 1 pin, the result is the same. THAT IS - A CONSTANT 1023 VALUE for EVERY next pin other than the 1st potentiometer pin I'm reading (which is in chronological order in my program. So let's say only the A0 shows accurate potentiometer movement. Other pots when connected simultaneously, show constant 1023 reading no matter what......) :frowning:

I don't think anyone can help much more without seeing code and schematic, and maybe some photos.

PerryBebbington:
There is one A2D converter. I works by taking a sample of the input and saving it on a capacitor, then measuring the voltage on the capacitor. If you then immediately switch to an unconnected pin the voltage on the capacitor might well remain what it was for the previous reading, giving you the same result. No guarantee this will happen, but it might.

Thank you for your help.
Well, to say..... I'm actually getting fresh data (with a syntax or program line written for it) for every read instance of function when it's called.
To mention, it didn't use to happen earlier like this. Only after the problem showed up, it started to happen.
Something is damaged or what ?
I don't see any burn spots, components or anything on the PCB. It's still as shiny......
What to do ?

PerryBebbington:
I don't think anyone can help much more without seeing code and schematic, and maybe some photos.

I will soon update the post with pics & code !

unojoygeek:
Now, in this case under normal conditions, the controller testing screen should show me output from A0 very precisely & A1 pin output should go haywire as there is no input given to it. But now after the problem appeared, the A1 pin is also showing the EXACT SAME & PARALLEL reading as that of the A0 potentiometer pin. No matter what pin I use from A0 to A5, all the outputs which I'm reading through the program, show THE SAME READING & are getting controlled by SINGLE POTENTIOMETER SIMULTANEOUSLY.

I'd totally expect this, unconnected inputs should be completely ignored, you cannot guarantee anything about
what voltage they will read, and this sort of crosstalk is completely normal in CMOS circuits (but
not guaranteed either).

This means all the analogue outputs are being controlled simultaneously by the input pin from which the very first analogue input is read. If I connect another potentiometer (or more than one) to the A1 (or other more pins), the value jumps to constant 1023 & shows full reading which doesn't change with potentiometer movement. What is the problem ?

That means the wire is at Vcc. You know the pin can vary in voltage, so the problem is in the wiring
to the pot. Most likely a missing ground connection to the second pot.

BTW the title of thread says outputs, whereas we are talking about inputs...

Sorry for late reply. I wasn't able to log in because of some issue.

I tried to switch the main IC chip of my damaged board i.e. atmega 328p (or whatever that main chip is.....) with other working Uno board's chip, uploaded the same program to it & voila ! Everything was working properly again !!

So, changing the main chip worked PERFECTLY !

So to my understanding, whatever wrong or bad you do to the Uno board (idk about other boards but still mostly) your main chip gets damaged. I was holding the board in my hand. That may have short circuited the chip or something like that & the chip got damaged.

Another thing to mention -
Unojoy flashes the communication chip (also an atmega chip) on the Uno board with new firmware because of which the board is identified as a controller by windows. This chip was intact & that wasn't causing the problem at all.....

Thank you for all of your time & support !
You guys are awesome !!
Cheers !

Ps. - I've written "chip" more times here than I may have said it in my whole life in total ;p

unojoygeek:
No no. See, I'm reading the pins in order. First I read A0 to which a potentiometer is connected. Then I'm reading A1 which is just free. So I'm reading a pin A0 to which the pot is actually connected. And it's showing some value on the output screen of controller testing window. Now another pin A1 is just free or not connected to anything. But it shows the same reading as that of the 1st pin. I hope I could explain properly

The basic rule is if you read the analog voltage or digital state on an unconnected pin you
ignore the result, as it could be anything and no value should be expected nor surprizing,
same as the voltage on an isolated pin is fundamentally undefined. In practice the
sample&hold capacitor in the ADC is coupling the pins together, but there could also be
capacitive coupling on the PCB too.

Worrying about what value you see when the value is undefined is pointless!