Master VESC Arduino tail brak LEDs

Hello everybody. I hooked to the Master VESC an Arduino nano for tail brakes.

There are some problems. I feed the Arduino from the VESC. The VESC has a built-in switch. When I power on the BMS and the VESC it works, but if I power off only the VESC it doesn`t power off because the Arduino is feeding back power through the LED data pin going to VESC through the Tx Rx pins and it stays on and sometimes it burns the Arduino, same thing when I feed the Arduino from the DC-DC converter (5V) separately. How can I wire properly the Arduino to eliminate this problem?

I have been searching on forums but no success.

Here is a wiring diagram of how I hooked everything up.

Thankyou everybody.

Use diode.

you could use a dc dc converter which has an enable function and use the vesc 5v to enable the DC DC converter. So even if you feed your DC DC converter from your BMS, it will only output 12V when your VESC is alive. Or you can use any digital pin from your arduino to enable the converter as well but like i said it has to have enable function.