stepper motor jitters when dc motor is run at the same time

Thing im doing:
driving a stepper motor with stepper driver a4988
using arduino nano
npn transistor 2n3904 to toggle dc pump

The Problem:
The stepper motor runs fine when the stepper motor is run alone...but as soon as i connect the other dc motor the stepper motor jitters and completely ignores any command coming from the microcontroller...

Schematic:

EasyEda file if you can't see things properly:
https://easyeda.com/editor#id=|77797604f9d148dfa95f3873d10544f3

Things i tried:
1-Tried running the dc motor and the stepper motor with different power supplies
2-Tried running both dc and stepper with one power supply rated 12V 2A
3-Tried running both dc and stepper with 17V 3A transformer powersupply
4-Tried not mixing stepper motor ground with arduino's ground. connected it directly to the a4988 vmot gnd
5-Tried mixing the grounds of both motors

My Observation:
When i mix the grounds of these two motors this problem occurs....somehow stepper motor loses control might be cause of noise of high current flowing in the gnd...

main project source: (this is where i got the idea about the schematic and everything)
This is an automatic water filling project. uses the stepper to move to next bottle and uses the pump motor fill water in the bottles...

I also added fly back diode in the dc motor but i forgot to mention it in the schematic

Please post links to the product pages for the pump and the stepper motor.

The schematic for the transistor switch makes no sense. You need a base resistor, and a 2N3904 cannot handle any significant amount of motor current. You need a driver that can handle the stall current of the motor.

Recommended circuit for DC motor control:

2N3904 is rated at 0.2A, way too low for a motor, its a small signal transistor. Driving it without a base
resistor will endanger the Arduino pin and the transistor - either or both may be toast now.

You've given no details of the DC pump so we have no clue how much stall current it pulls. This might be
several amps, and the power supply will need to handle this without issue too.

MarkT:
2N3904 is rated at 0.2A, way too low for a motor, its a small signal transistor. Driving it without a base
resistor will endanger the Arduino pin and the transistor - either or both may be toast now.

You've given no details of the DC pump so we have no clue how much stall current it pulls. This might be
several amps, and the power supply will need to handle this without issue too.

thats fair enough...

the 2n904 runs the pump with no problem..although i see what you mean...and its a generic 12v water pump can't find datasheet..... and i am using a resistor in series with the base but i forgot to mention in the schematic...

the problem occurs when the stepper motor runs with it and the dc runs fine while the stepper jitters....
i think it is necessary that i mention a new observation...

when i measure the current by having the multimeter in series with vmot and +12V i see the stepper pulls 900ma while stepper is connected.... and as soon as i connect the dc motor..the amperage drops to 500 and then it jitters so i think its because the power supply isn't actually rated for 2 amps and the sticker is misleading.. i am going to check again tomorrow

because the power supply isn't actually rated for 2 amps

More likely, the pump and stepper draw more than 2 A.

i need to drive dc motor and stepper motor at same time what to do

Hariniji318:
i need to drive dc motor and stepper motor at same time what to do

Provide adequate power for both of them under all conditions (ie stall current for the DC motor).
Provide suitable drivers for each motor.