I have created a smal circuit with a relay to control a 230v water pump. I have one push button and two led’s to show the status (if it is on or off). In my arduino code I have attached a interupt to pin 2 so I’m able to other things in the loop (e.g. communicate with an Raspberry Pi etc). The arduino nano is at the moment powered by a USB cable.
My challenge is that any small changes in voltage in the 230v net causes an interrupt. For example when the water pump starts it might cause an interrupt, or if I connect a vacum cleaner to the same power socket as the usb power supply, the interrupt is called.
Is there any way I can stabilize the circuit? (for example by using condensators?)