Detect when a device has been connected to Vcc
I suggest using another method:


You do not do anything to data input pin on Arduino
Guess you have one more input pin available on Arduino, right? Call it "V"
So you change the SW to ignore all data when this V pin is Low
All the electronics you need is:
-- common PNP transistor
-- resistor 4K7 or about
-- resistor 47K or about
Connect:
-- pnp Emitter to +5 V power supply and to 47K resistor
-- pnp Base to Power Input of NES controller and to another end of 47K
-- pnp Collector to 4K7 resistor and to V input pin of Arduino
-- other end of 4K7 goes to Ground


Current consumed by NES makes PNP transistor conducting and it holds V pin at logical High. That's it







simulate this circuit &ndash; Schematic created using CircuitLab