Input problems

Hello guys,

I'm completely new to the arduino world, I'm starting to program now and I've come across a problem.

Well, that's the way it is, I've prepared an arduino with an ethernet shield.

The function is very simple, read the state of an input, if the input is high then does a get httml request , if the input is low then does another get Httml request.

The problem is, the arduino is inside an electric panel of a machine, and I think there is a lot of electrical noise, for fractions of milliseconds the input goes down, and consequently my program makes a false request.

I already did a little delay, but I think it's not a definitive solution.

Follow my scheme

Any Tip??

Thank you

Move the Arduino Uno out of the machine.

Thank you your replay,

It is more convenient for the arduino to stay inside, it is an industrial environment, the arduino is more protected.

I do not know if it is possible to isolate the arduino in order to reduce the noise?

(deleted)