No.
If you have the amplifiers 5V input connected directly to the extra 5V-powersupply
the big current flows in directly from extra-power-supply into the amplifiers 5V-input
The AUDIO-inputs named Left Channel Input / Right Channel Input have a
HIGH input-RESISTANCE. The current that can flow in there is limited down to microamperes throughg the big internal input-resistance.
No ! Because the potentiometer creates a voltage-divider.
Only a part of the voltage that comes from the GPIO-pin goes into the amplifier.
How big this part is depends on the potentiometers position.
Of course if you turn the potentiometer completely to the end where GPIO is connected
you still "give" 5V into the amplifier.
Anyway
current is always I = U / R
current = voltage / resistance
The input-resistance of the amplifier is minimum 100 kOhm = 100000 Ohm
current: 5V / 100000 Ohms = 0.00005A = 0.05 mA = 50 microampere
Your IO-pin can stand 20 mA = 20000 microampere
Not a lot of power because it is a small speaker with a small coil that has a small inductivity
= small "power"
But it is not the power. It depends on the voltage and the resistance.
Disconnecting power is not a problem because the speakers are still connected.
By Disconnecting the power the same happends as with power connected where the voltage goes up/down in the rythm of the AUDIO-signal.
The main purpose of an amplifier is to "move" up and down the voltage in the exact same way as the input-voltage "commands" Just with higher voltage-numbers.
And this up and down of the voltage causes an up and down going current.
This current change causes this reaction you described but as it is the intention of the amplifier to do exactly this all the time this is no problem.
I haven't done any calculations about this for speakers but as you can buy speaker-switches that connect / disconnect the speakers from the amplifiers output this can't be a problem with speakers.
It is a different case with stepper-motors. The coils of a stepper-motor can indeed cause high voltage-spikes that can destroy the stepper-motor-drivers.
These high voltage-spikes occur do two things:
- not switching of the powersupply but instead keep the powersupply switched on
- if you dis-connect the motorwires from the stepper-driver while the powersupply is still switched on
Through disconnecting the resistance of the circuit goes up from a few Ohms to millions of ohms.
The coil wants the current to continue to flow with the same vaue and increases the voltage very high.
Though the energy-source is disconnected no additional energy is brought in
result:
a very short voltage-spike as the energy stored in the coil as "magnetic" energy is "used" and gone in a very short time.
This applies ONLY to stepper-motors and their stepper-motor-drivers.
It does not apply to amplifiers
It is good that you want to learn so much.
Anyway if you are worried so much to damage anything you maybe should do intensive and a lot of simulations with software like P-Spice and Tinkercad
But all these simulations will distract you for MONTHS before you can come back to real life electronics.
So a middle way is to measure voltages and currents with a digital multimeter before wiring a component to your arduino
example:
taking your amplifier connecting the amplifier only to the speaker
then connecting the digital multimeter to measure current that flows through the 5V amplifier-input an then measure the current that flows in
- if nothing is connected to the input
- if some audio-source is connected to the amplifiers input making the amplifier playing the audio
too see what currents do flow.
Same thing for measuring the current flowing into the amplifier through the AUDIO-input
etc. etc.
And as a general safety-thing:
connecting your arduino to whatever other component over a 1000 Ohm resistor
This resistor will limit the maximum current down to
5V / 1000 Ohm = 0.005A = 5 mA.
Maximum current per IO-pin 20 mA. So 5 mA is 25% of 20 mA. A safe value.
In some cases the 1000 Ohm-resistor will cause a malfunction as pure "not functioning" but never as destroying anything.
best regards Stefan