Now the puzzle works fine, I connect the MOSFET to the 12volt power supply with a common ground, use analog 1 to switch mosfet on and off. Now I wanted to run the arduino off of the same 12 volt power source, so I added another line from the positive end of the power jack to the VIN pin in arduino.
This is when I started having issues, ranging from the arduino not executing the code when the puzzle is complete, or just straight out frying. Went through two nanos.
I've been able to run an UNO of a 12 volt power supply, but not sure why the nano is having issues.
Use an external 5v regulator (linear if current is fairly low, or buck converter otherwise - suitable buck (step down) converters are a dollar or two on ebay), the one on the nano is only suitable for running the nano itself with nothing connected to it, and even then with 12v input, only barely. I think some of the nano clones use regulators even less suitable than the official ones, but even the official ones have a regulator that is not good enough for any real application with 12v input. With 7v in, it is usable in low current applications, barely. With 12v, drawing almost any current will overheat the regulator
As for regulator recommendations - 1117-series for linear (that's what the Uno uses), or just search dc-dc step down on ebay for cheap buck converter (pololu has nicer but more expensive ones)