Smoke from the motor shield

Here is the schematic diagram

Initially, the circuit looks like this:

I connect both SCL and SDA to the Arduino. But the motor driver didn't work until I connected 5V and GND of the Arduino to the motor driver(even tho the motor driver was powered by 12V plug and I dont know why I must connect 5V and Gnd between the driver and the arduino). At this time, I powered up my mega using PC and my motor driver using plug

Then, I dont want my mega to be connected to the PC and want test my power supply to supply both of the Arduino and the shield. Because I am doing a project where both of the motor driver and my Arduino mega will be powered up by a better, so this is just for testing purposes. Here is the schemetic diagram after I connected the power supply to both of the motor driver and the arduino.

I connect the 12V plug cable to the screw terminal connector of the motor driver. Then I connect a jumper from that same screw terminal to the Vin and GND for Arduino Mega.