I am working on an art project using some modified bug zapper circuitry to produce loud and bright sparks. I have the circuit working and the sparks are very impressive, but I'm running into a issue where the EMI created by the spark gap will occasionally crash the microcontroller I'm using to control the project, necessitating a reboot.
In order to get around this issue, my plan is to mount the microcontroller inside a grounded metal chassis (creating a protective faraday cage), and have both circuits be electrically isolated from one another via an opto-isolator circuit using a chip like the OP817:
I am wondering whether it is better in this case to have the opto-isolator live inside the chassis with the microcontroller (which would run wires that have an electrical connection to the zapper circuit inside the protective chassis), or on the board with the zapper circuitry (which would run wires connected to the microcontroller outside the protective chassis, though I could potentially use grounded / shielded wire). I could see advantages and disadvantages for both, and could also see it potentially not mattering.
Which option is better for this application (if either is truly better), and what considerations are at play here?