You may want to Start Here, flyback diodes and why you need them. We can follow that up with posting a good schematic, even a simple hand drawn schematic helps. With those things already covered previously are all of your grounds common tied together. That would show in a schematic. Pump motors generate noise and micro-controllers hate noise. Depending on motor type it's not unusual to place a capacitor or flyback diode across motor terminals.
Ron