Problems with vibrating motor

Sorry, I have to leave the discussion and must continue my work
But I would expect that you will see several "Hi there" messages.
You can get the reason for the reset from an MCU register. There should be a bit named "BOD" which means "Brown Out Detect". In the MCU is a circuit which observes the supply voltage and if it drops below a certain voltage level, the bit is set. You can adjust yur code then and output a message like "Illegal voltage drop detected" if the bit is set in your setup code.

But if it is a voltage drop then the start current of the motor is too high because it is more "frozen" by something as in normal modules.

And supplying 12V from outside will not help, because the voltage drop appears on the +5V and I believe, that there is a regulator which generates the 5V from the 12V and behind the 5V regulator the 3V3 regulator is located. If the 5V drops, the 3V3 behind will also drop and reset the MCU.

Hope you all can solve the problem.
Harald

Could not leave you alone with this:

ATmega2560 datasheet:

12.5.1 MCUSR – MCU Status Register

Bit 2 – BORF: Brown-out Reset Flag
This bit is set if a Brown-out Reset occurs. The bit is reset by a Power-on Reset, or by writing a logic zero to the flag.

Unfortunately it looks to me that reading the register might not help you, because I have found this and at least in year 2016 the bootloader cleared the bit (I have no idea why???):

At the end of the thread I found "How Optiboot passes the MCUSR register value to the application" so there is a different bootloader which can transfer the BOD status to your appplicaton.

But if you see a lot of "Hi there ..." messages, the reason is clear as described above.