Using an arduino to control whether or not a phone is charging or not
If anyone else has this question, the thing that solved it was connecting a 10K resister from the gate on the mosfet to ground, and I also added a 1K resistor between the digital pin and the mosfet.