Need advice for power sourcing

I'm making a 2W drive car with the following:

  • 1 driver L298N + 2 DC motors (the yellow ones)
  • 1 servo sg90
  • 1 arduino uno
  • 1 ultrasonic sensor HC-SR04
  • 1 IR receiver TSOP34438

I have two 9V batteries

Talking about power sourcing, which one is the correct wiring ?

I was thinking to use one battery for the L298N + 2 DC motors and the second one connected to Arduino and using Arduino itself to power the sg90 + HCSR04 + IR.
Is it correct ?

Thanks.

If the 9V batteries are the rectangular smoke alarm type you will be disappointed with them. Those batteries do not have the current capacity to power motors. They will not run an Uno for long either.

The L298 is not a great choice for battery driven projects (or any others, to tell the truth). They are very inefficient and waste a lot of power. Pololu has a good line of modern motor drivers.

groundFungus:
If the 9V batteries are the rectangular smoke alarm type you will be disappointed with them. Those batteries do not have the current capacity to power motors. They will not run an Uno for long either.

Yes, I think they are!
So, (sorry for the dump question), it is not only a matter of capacity in time [mAh] but, also a matter of how much current can a battery delivers instantaneously? How do I know that ?

Because I was thinking:"Ok, I have 9V and I don't care how long the battery lasts, I only need it for some minutes. 9V are enough for the driver motor and the little servo, as well"

groundFungus:
The L298 is not a great choice for battery driven projects (or any others, to tell the truth). They are very inefficient and waste a lot of power. Pololu has a good line of modern motor drivers.

Thanks, I will look into it for sure.
This is my first little project and I am still studing.

boggi:
Yes, I think they are!
So, (sorry for the dump question), it is not only a matter of capacity in time [mAh] but, also a matter of how much current can a battery delivers instantaneously? How do I know that ?

It is difficult to find specifications for either capacity or maximum current. We recommend against those batteries mainly from long experience of disappointed people who have tried to use them.

6xAA batteries, preferably NiMH rechargeable (Eneloop etc) will normally make a huge difference.

It's also a bad idea to power motors or servos from the Arduino 5V pin but with only a single SG90 you just might get away with it.

Steve