Why are the capacitors on the image being used with the DC motor?
The caps in your photo are common on commutator type DC machines.Thier purpose isto help EMC because the brushes make lots of electrical noise when the motor is turning .It is quite normal for equipment with such motors like many power tools to fail radiated EMC without them .If you remove the caps its more likely that cummutator hash will find its way into your Aduino causing hassles during debug.OK if you leave them in you do have to be careful about thier charging currents when running say a mosfet PWM buck convertor .The prospective charging currents would make the mosfet run hotter at normal PWM frequencies .The caps wouldnt like the currents anyway.What I do on a buck convertor that drives a motor that may have caps across it is place an inductor in series with the output .For your job 100 microhenry would be good.