Hello,
I am working on a project including a power supply (230V to 24V), some electronics and an arduino.
All this stuff is put into a metal enclosure.
I can start the program using a external button. In my code, I've put an interrupt which checks if the button is pressed again, to stop the program.
My main issue is when I touch the metal enclosure or move it, the program stops.
My enclosure is NOT connected to earth ground, and I'm wondering if noise is generated by moving the metal parts, disturbing the arduino...
Thank you !
If the mains enter the box, ground the box.
For the problem, show how you connected the switch. Please NO Fritzing breadboard mess, hand drawing will do.
PS Interrupt is NOT needed for user input 
Thank you for your fast reply. Yes, +230V enters the box so I will ground the box.
The switch is just connected between D4 and GND, directly on the arduino (well it's a Wemos D1 mini pro).
As for interrupt, I know it's overkill but I didn't find a solution to start the programm and stop (reset) using the same push button...
Last part isn't that hard... You just need to implement state change detection (and probably debounce). Easy way, grab a library like Bounce2.
Is that switch on that box or connected via a (long) wire?
The metal switch is connected to the metal box using 2 X 30cm wires and connected to D4 and GND.
This kind of button :
http://www.elka-electronique.com/345-thickbox_default/bouton-poussoir-anti-vandalisme-onpow.jpg
The state change looks interesting but I need to stop the program instantly when the button is pressed, and there are some delays in the program.
Interrupt is very reactive but I would like to delete this anyway ...
Internal pull up enabled? If so, try adding a higher value external and/or button debounce
Thibaultgd:
and there are some delays in the program.
Now there is your problem
Get rid of them 
And even now, how do you stop the program from the interrupt? You just keep in in the interrupt or what?
Internal pull up enabled.
The delays needs to be deleted, I agree ! 
In fact I use the interrupt to reset the arduino, with :
void(* resetFunc) (void) = 0;//declare reset function at address 0
This is not the cleanest way to restart the program I guess ...
Right
Thank you again, I'll ground the box and modify the program.
@manjulaelcid, GIO0 to 15 have pull ups. GPIO 16 has a pull down. But they are called weak pull ups for a reason 