You are seeing crosstalk between the analog input channels. In the datasheet of the microcontroller you can see the analog input circuitry. See the capacitor labeled "CS/H"? This is the "sample and hold" capacitor. Its job is to hold the voltage being read while the ADC performs the conversion. When you measure channel A5, you are charging this capacitor to 3.3 V. Then, when you switch to ana floating input, the capacitor has no path to discharge, and you end up measuring the same voltage.
Actually, you do not measure exactly the same voltage. The reason is that each input pin has a parasitic capacitance. When you switch from A5 to A0, the charge in CS/H splits between this capacitor and the stray capacitance of the pin A0. Then, you switch to A1 and the remaining charge is split between CS/H and the stray capacitance of A1, and so on. Eventually, when you come back to A5, you charge again CS/H to the full 3.3 V and the cycle starts again. The net effect is that you are progressively moving charges between the successive pins. This is why the curves look like exponential relaxations, where each successive pin charges more slowly than the preceding one.
The solution, as already written in other answers, is to avoid leaving the pin floating. The datasheet recommends making sure the connected source has an impedance no larger than 10 kΩ.
You are seeing crosstalk between the analog input channels. In the datasheet of the microcontroller you can see the analog input circuitry. See the capacitor labeled "CS/H"? This is the "sample and hold" capacitor. Its job is to hold the voltage being read while the ADC performs the conversion. When you measure channel A5, you are charging this capacitor to 3.3 V. Then, when you switch to an floating input, the capacitor has no path to discharge, and you end up measuring the same voltage.
Actually, you do not measure exactly the same voltage. The reason is that each input pin has a parasitic capacitance. When you switch from A5 to A0, the charge in CS/H splits between this capacitor and the stray capacitance of the pin A0. Then, you switch to A1 and the remaining charge is split between CS/H and the stray capacitance of A1, and so on. Eventually, when you come back to A5, you charge again CS/H to the full 3.3 V and the cycle starts again. The net effect is that you are progressively moving charges between the successive pins. This is why the curves look like exponential relaxations, where each successive pin charges more slowly than the preceding one.
The solution, as already written in other answers, is to avoid leaving the pin floating. The datasheet recommends making sure the connected source has an impedance no larger than 10 kΩ.
You are seeing crosstalk between the analog input channels. In the datasheet of the microcontroller you can see the analog input circuitry. See the capacitor labeled "CS/H"? This is the "sample and hold" capacitor. Its job is to hold the voltage being read while the ADC performs the conversion. When you measure channel A5, you are charging this capacitor to 3.3 V. Then, when you switch to a floating input, the capacitor has no path to discharge, and you end up measuring the same voltage.
Actually, you do not measure exactly the same voltage. The reason is that each input pin has a parasitic capacitance. When you switch from A5 to A0, the charge in CS/H splits between this capacitor and the stray capacitance of the pin A0. Then, you switch to A1 and the remaining charge is split between CS/H and the stray capacitance of A1, and so on. Eventually, when you come back to A5, you charge again CS/H to the full 3.3 V and the cycle starts again. The net effect is that you are progressively moving charges between the successive pins. This is why the curves look like exponential relaxations, where each successive pin charges more slowly than the preceding one.
The solution, as already written in other answers, is to avoid leaving the pin floating. The datasheet recommends making sure the connected source has an impedance no larger than 10 kΩ.
You are seeing crosstalk between the analog input channels. In the datasheet of the microcontroller you can see the analog input circuitry. See the capacitor labeled "CS/H"? This is the "sample and hold" capacitor. Its job is to hold the voltage being read while the ADC performs the conversion. When you measure channel A5, you are charging this capacitor to 3.3 V. Then, when you switch to an floating input, the capacitor has no path to discharge, and you end up measuring the same voltage.
Actually, you do not measure exactly the same voltage. The reason is that each input pin has a parasitic capacitance. When you switch from A5 to A0, the charge in CS/H splits between this capacitor and the stray capacitance of the pin A0. Then, you switch to A1 and the remaining charge is split between CS/H and the stray capacitance of A1, and so on. Eventually, when you come back to A5, you charge again CS/H to the full 3.3 V and the cycle starts again. The net effect is that you are progressively moving charges between the successive pins. This is why the curves look like exponential relaxations, where each successive pin charges more slowly than the preceding one.
The solution, as already written in other answers, is to avoid leaving the pin floating. The datasheet recommends making sure the connected source has an impedance no larger than 10 kΩ.