Arduino Switch Without Resistor Malfunctioning

I would like make a button with internal pull-up resistor. It is still fine with the dupont wire but when I solder it to 16awg wire, it became unstable and activating unpredictably. The solder is solid and introduce almost no resistance.

What is the problem?

Edit: 0.5 meter

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project :wink: See About the Installation & Troubleshooting category.

How long is that wire?

Bad solder joint(s) is my best guess based on what I can see. Which is nothing.

Post some photos showing the wiring and soldering.

Post a schematic showing how the wiring should be.

Thanks bro. It is 0.5 meter. I remove the solder and it will trigger when i touch the end of the dupont wire.

That usually means a floating input. Post your code as well as photos and a schematic, please.

Are you sure that the wire from the switch connects to the pin with the internal pullup enabled with INPUT_PULLUP?

Always show us a good schematic of your proposed circuit.
Show us a good image of your ‘actual’ wiring.

In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch.
Use the </> icon from the ‘reply menu’ to attach the copied sketch.

I have a feeling that the below two actually contradict each other. But I don't know what "it is still fine" means.

How hot did you get the switch while soldering to heavy 16 AWG wire?
Maybe you ruined the switch.

Do you mean the pull-up resistor is internal to the button or do you mean the optional pull-up internal to the Arduino (INPUT_PULLUP)?