For an engineering project I need to power a Nema 17 42BYGHW609 stepper motor, a servo, a IR sensor and the Arduino itself. To control the stepper motor I will use an L298N Motor driver and there will be an AMS1117 5V voltage regulator to go from 12v to 5v. The battery consists of 8 AA batteries is series to get approximately 12v. I will power the sensor directly from the Arduino
The question: "Should I power the Arduino and servo on a second battery to circumvent any voltages spikes because of the stepper motor"
Yeah it won't last very long but that's ok, it only has to run for 5 min at a time. Correct me if I'm wrong but the motor draws 1.7 Amps and we will be running it at 12 Volts. The AA batteries have a capacity of 2200 mA so (1.712)/(2.212)= 0.77. that equates to about 45 min, however that is without the Arduino, the servo and the sensor.
I reckon 22 minutes would a better estimate. Battery manufacturers tend to exaggerate
More importantly, an AA alkaline cell won't be able to produce 1.7 amps for long without a big dip in its voltage. Rechargeable NiMh cells will be much better, but you would need 10 of them to get 12v.
A 12v lead-acid battery would be a lot more sensible - but still second best to a mains power supply.
When you say "run for 5 min at a time" do you mean that the batteries will be replaced or recharged after every 5 minute run?