ATTiny/Arduino Uno MIDI to high voltage spark

how do i stop a spark generator controlled from ATTINY 2313 from crashing the chip?

its a MIDI app for a flaming pipe organ. i need to develop an arduino based board for each tube that listens for note or program midi messages and switches valves and this spark generator accordingly

2313 o/p is opto isolated to a medium power transistor which switches a relay which powers a 555 which switches a large power transistor which drives a 12 car ignition coil and spark plug.

to simplify i am using the blink sketch on the 2313 and i get about 4 or 5 nice sparks and then it stops until the system is reset.

previously when using the midi in to trigger the o/p the spark has also crashed parts of the music hardware

My only helpful hint is that with a purchased PIC based midi to parallel converter (that uses darlington arrays) the same spark generator work flawlessly but i feel i might be clutching at straws here

thanks for any help

how do i stop a spark generator controlled from ATTINY 2313 from crashing the chip?

Stop the voltage spike from getting to the ATTiny. The situation is not unlike the noise generated by electric motors, and the solution is the same. A capacitor across the noise maker to absorb the spike. Look at Grumpy_Mike's web site, and look at the motor page(s).