Step 2: Get an IRF730 from Mouser
But I had been trying for a number of weeks to perfect this, as in, find the correct transistor that would not overheat or burn out (one that is rated for a high enough voltage since it’s using AC 120 V). I followed this circuit from Dmitri’s blog, except instead of the IRF 250 I used an IRF730.
You can purchase those particular transistors at the above link from Mouser for under $2.
At first, I was using the IRF 520, with a 100 V drain source voltage and a 9 amp continuous drain current. It worked fine at first, and then it burnt out (there was connectivity between the gate-source and gate-drain). So I got an IRF540, with a 100 V drain source voltage and a 33 continuous drain current. This similarly worked at first, then burnt out.
Finally, I used the IRF730 which works pretty well so far! And doesn’t burn out – it is rated upto 400 V (which far surpasses the 120 V wall voltage in the US).