Circuit shutting down after a while of use

Hello,

I'm putting together a project for a machine that manufactures 3D filament from a PET bottle.

So far the circuit looks like this:

The circuit is not finished yet, because this way it just turns the engine on/off, informs the status on the display and also informs the RPM. However, a temperature control for the printer nozzle via PID, inductive sensors to control the actual RPM and the status of the filament manufacturing process and a module for connection with a smartphone to function as a supervisory will still be placed in the circuit.
However, with this circuit I already have problems. I can turn on the circuit and put it to work normally, but as I increase the engine RPM, the circuit starts to lose power until everything turns off (display and engine). I've tested it by feeding the circuit only with the arduino, I've tried feeding it only with an external 5V source and I've also tried it with both. However, in all cases the same problem occurs.

Could anyone tell me what could be wrong?

I'll leave the code used so far below:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(32,16,2);

int valor=0;
int botao = 9;
int sensor = 8;
int tip = 10;
int estadoBotao = 0;

void setup(){
	pinMode(botao, INPUT);
	pinMode(sensor, INPUT);
	pinMode(tip, OUTPUT);
	lcd.begin(16,2);
	lcd.init();
	lcd.backlight();
}

void loop(){
	estadoBotao = digitalRead(botao);
	if(estadoBotao == LOW){
		analogWrite(tip,0);
		lcd.setCursor(0,0);
		lcd.print("EXTRUSORA");
		lcd.setCursor(0,1);
		lcd.print("DESLIGADA");
		delay(1000);
	}
	else{
		lcd.clear();
		lcd.print("EXTRUSORA");
		lcd.setCursor(0,1);
		lcd.print("LIGADA");
		valor=map(analogRead(A3),0,1023,0,255);
		Serial.print("Valor lido=");
		Serial.println(valor);
		delay(1000);
		analogWrite(tip,valor);
		lcd.clear();
		lcd.setCursor(0,0);
		lcd.print("ROTACAO:");
		lcd.setCursor(0,1);
		lcd.print(valor);
		lcd.print("rpm");
		delay(5000);
	}
	if(digitalRead(sensor) == HIGH){
		analogWrite(tip,0);
		estadoBotao = 0;
	}
}

The Arduino is not a power supply, and the 5V output cannot be used to power motors or servos. The on board voltage regulator is overheating and shutting down.

Use a separate power supply for the motor. Be sure to connect all the grounds.

Keep in mind that breadboards are for temporary experiments with low power logic circuitry and the tracks will burn if subjected to motor currents. Connect the motor and motor power supply directly to the motor driver, using soldered leads or screw terminals if supplied.

Choose the motor power supply based on the stall current of the motor and the motor supply voltage. The stall current can be several times the running current. The stall current will be drawn, briefly, every time that the motor is started. The stall current should be listed in the motor data sheet. In the absence of a data sheet.

Is this the same as this one?

Do not duplicate posts.

HINT! A Power Supply the Arduino is NOT!