5v and hooking up a pair of headphones to the arduino through D3 and GND
Sorry, I don't know anything about that project, but you should't connect headphones directly to the arduino.
The maximum current from an Arduino is 40mA, and that means a load of 125 Ohms minimum. Unless you have "high impedance" headphones, your headphones are probably around 32 Ohms. That can damage your Arduino.
It's also not good for your headphones to connect 5VDC.
I recommend a 100-200 Ohm resistor in series wiith your headphones. That will knock-down the volume, but you should still hear something (when your sketch works). And a capacitor in series (100uF or more) to block the DC, while letting the AC "sound" through.