Floating power

I have a project for an Escape Room. In this project voltage from the 3V is routed through a wire and back to an input digital pin. Sometimes, even though the wire is not attached, the pin reads HIGH.

Being a software guy, I'm seeking some advice on how I can be certain that the line only reads HIGH when the wire is properly attached. What is it I should add to the circuit to suppress random voltage on the lines?

Thanks.

Use a ~10K pull down resistor (between pin and GND)

How long is this wire? Is it a single wire?
When you say "even though the wire is not attached" what do you mean? Which end? What
was it previously attached to?

Perhaps a sketch of the wiring would be good, so we know what you have?

Check out the interwebs for "floating pin arduino" to see why pull-ups / pull-downs are needed.

Thanks for the replies. The wires are several feel long, as they go through a panel where the players must make connections. It is all powered from the 3 volts input from the USB to the Feather.

IUnknownCA:
Thanks for the replies. The wires are several feel long, as they go through a panel where the players must make connections. It is all powered from the 3 volts input from the USB to the Feather.

Then make the pull-down more like 1k than 10k to reduce noise. You might also add some
capacitance to ground at the input pin. 10n to 100nF perhaps.