L298N ground potential difference fried arduino nano

Hello Dr. :slight_smile:

it's an electronic plug in transformer. I just made a picture. Most of my projects with wired power supply are done with this sort of power supply. It is connected to 12V and GND of the L298N
Regarding the L298N: It is this one L298N

to the motor:
it is a 12V DC motor with encoder. Encoder signal wires are green and yellow, encoder power supply are blue and black (on the motor directly)
--> the encoder is working properly, the arduino code is counting up and down as it should be.