Arduino stops working when connected to an external power supply