To start with I'm a little rusty with electronics, I haven't done much in 20 years and it was only a hobby back then.
In my car I have a head unit with a touch screen which relies on software to run it.
My problem is that it starts to load the software when you turn the key to accessories but when you go to start the car it cuts power to the head unit which hasn't finished loading the software. After the car has started (key returned to the on position) the power is restored to the head unit and it tries to load the software again.
This cut in power, I believe, is causing the head unit to malfunction, it messes with the software.
So I need to supply power to the unit when the key is turned to ACC or On position but held on while the engine starts. After the engine has started the key will return to the On position and power the unit as normal. When the car is turned off then the unit needs to turn off.
I was thinking of powering the unit through a relay wired direct to the battery and then using the signal from the ignition, in parallel with a timer, to trigger the relay. If I use the loss of power when starting the engine to trigger the timer then the unit has already lost power and it would start loading again, so that would be of no use.
I tried to use the initial connection to power (when the key is first turned to ACC) to trigger the timer. If I am correct then with my circuit the timer is put into an endless 10 sec loop while the key is turned on and when the key is turned off only the timer powers the unit till the end of the time period. If the key is returned to the On or Acc before the end of the time period then the unit will stay on but if the ignition is turned off for longer than the time period then the timer stops and the unit turns off.
(This is also a diesel so needs the ignition to be turned on for a period of time before starting. I'm not sure if 10 secs is enough time but I don't think you can stretch it out further).
Can anybody verify if this circuit will work?
Is there a better way to do this?
If this is the best choice, is there anything wrong and what should I do to fix it?
(I wasn't sure if the 10k and 1k resistors connected to the base of the transistor were needed).