I made a simple water level sensor with an Arduino. A digital pin supplies 5V to a probe in a coffee machine boiler. Boiler chassis is connected to AC ground (earth) and the ground to an analog IO pin on Arduino. A pull down resistor is between the analog pin and GND pin on Arduino. If there's water in the boiler, the analog pin detects the voltage, if there's not, it reads zero.
The digital pin is turned on every 1s to slow down corrosion of the probe.
Now, a lot of things are connected to the AC ground - the pump, boiler heater, power supply etc. Should I do anything to protect the Arduino in case anything goes wrong? Is there a better design for this?