I have successfully designed & tested a circuit using arduino uno for controlling a dc motor (MAX 50A,12V,SHORT-DUTY) By using a relay module and current sensor (configuration given in schematic). Then i tried to convert it into a PCB & designed a schematic (given below) & fabricated it, I use the same Micro controller (Atmega328p-pu) which i used in arduino board (program it using arduino uno & put it into PCB). when i tried to run it works for first cycle of my application (when i press switch 1-on & when current reach 5A have to off) but after 1st cycle Atmega328P-PU freezes & it does't get any input from switches (if i use arduino uno instead of Atmega328P-PU means it works well) , i have tried all the possibilities to make it work but failed. Help me!!