Prevent reading stray currents

Just a simple question

Does anyone know how I can read inputs correctly without having any stray electric fields in the air from interfering with it.

Thanks!

Are we talking about digital or analogue inputs here?

Basically you need a pull up, or pull down resistor of about 10K for a digital input and a source impedance of about 10K for an analogue one.

It is not stray currents you read but stray voltages.

Is this related to https://forum.arduino.cc/index.php?topic=545947.0

Unconnected inputs are very high impedance, and thus pick up hash from the surroundings easily.

If you want to read something with an input, you must ofcourse connect it to something.
No point in reading an input if there is nothing connected to it.

Now tell us what the real problem is you’re experiencing.
Leo…