Hello everyone. I did a midi controller pedal with Arduino. Everything works great when powered with the usb b port to your PC. When Instead I use an external power supply the midi control does not work well, that is, it is as if it were pressed continuously. How could I solve the problem? I would like to point out that I have already tried more than one power supply.
Gee can you give us a hint of what your circuit is?
Please read your post again and consider how one might be able to help you with the information provided.
Others will likely tell you to read the forum posting rules. However I think slowing down a little, add in some common sense and you should see how to post more successfully.
There may be a misunderstanding here.
You refer to a 9 V power supply.
A very real danger is that the obsolete tutorials on the Arduino site and others misleadingly imply that the largely ornamental "barrel jack" and "Vin" connections to the on-board regulator allow a usable source of 5 V power. This is absolutely not the case. It is essentially only for demonstration use of the bare board back in the very beginning of the Arduino project when "9V" transformer-rectifier-capacitor power packs were common and this was a practical way to power a lone Arduino board for initial demonstration purposes. And even then it was limited because an unloaded 9 V transformer-rectifier-capacitor supply would generally provide over 12 V which the regulator could barely handle.
If you are asking this question, it is highly likely that you will wish to connect something else to the Arduino board. In which case, the answer is regulated 5 V.
This is because the on-board regulator is essentially capable of powering only the microcontroller itself and no more than a couple of indicator LEDs. The on-board regulator might be able to power a few other things if it had a heatsink, but on the (older) Arduinos, it does not.
Powering via the "barrel jack" or "Vin" connections is asking for trouble. The "5V" pin is not by any means an output pin, if anything a "reference" pin but most certainly the preferred pin to which to supply a regulated 5 V.
A practical power supply for the Nano (or UNO, Pro Mini, Leonardo etc.) is a "phone charger" with a USB output connector for 5 V, generally up to a couple of Amps though you can not feed more than 500 mA through the USB connection.
If you want to power it from 12 V or a car system, you need a 5 V switchmode "buck" regulator to supply the 5 V.
The OP, having difficulty with the English language, moved to the Italian section. Thank you all.
P.S.: I think I can close this thread which can then be deleted.