Arduino Leak code problem !!! HELP !!!

Hi Everybody ,
i made a board for standalone arduino to work in the car .
the board contain: 7 segment , LCD , and Shift register .
i use 7805 to convert 12V 50A (car battery) to 5V.
the board works very fine on my power supply at home , and works on car battery too .

::THE PROBLEM::

When i sart the car engine or switch light on , LCD clear every thing and ATMEGA 328P stop working .
if i tried to do it more than 5 times , the code is leaking from ATMEGA 328p. and i must upload the code again.

::NOTE::
i test the current on the board => when the board works fine the current =4.5mA ,
when the the current go down to 3mA , the problem appears.

::HELP::
1-how can i solve this problem ??
2- how can i get constant current (maximum = minimum = 1A or any constant current) ?

Any help ???

(deleted)

Thanks for your reply .

i tried with second battery (another car) ,and i used capacitor too . but not solved.

(deleted)

i use LM8705 connect to car battery with diode

Ok
I will use second battery
But how can i disconnect the the battery after full charging ?
Is 7805 will cut off the current from the second battery after full charging ??

Thanks

(deleted)

Is there a problem to keep the second battery connected to the car battery ?
I mean is there a problem to keep it charging?

Thanks

(deleted)