How big/mAh of a battery do I need? And how many?

I going to begin building a robot and I would like to know how many mAh to I need for it. The robot will have two motors (drawing about 1-1.5 A each) and the other components use much less current (all of the components draw about 30 mA).

And do I also need two batteries? One for the motors and one for the microcontroller+low draw components?

P.S.: Any suggestions on a charger too?

What voltage do you need and

What voltage do you need and how long do you want the bot to run?

The voltage for the

The voltage for the microcontroller (Arduino) is 7-12 V and the motor would run fine at those voltages too. The robot should last around half an hour and up.

Well…

According to your specifications:

You need 3000mA for 1.5 h that means 4500mAh. You want to have at least 6V for the arduino so you will want at least 6 NiMH cells in series since the voltage of a NiMH cell supplying a current of 1-2 amps will be closer to 1V than the nominal 1.2V. Since there are no redily available cells with 4500mAh you will probably need to use two cells in parallel. that means you need something like 12 cells at 2500mAh.

Now … it is very likely that this setup won’t actually work. First of all, linking NiMH cells in series and then in parallel is a BAD idea because cells are different and they will not provide the same voltage, especially at large currents, this means that you will get one string of cells trying to charge the other string or one string providing most of the current and discharging rapidly, possibly even overheating. This setup is also susceptible to significant voltage drops depending on motor load which will reset the arduino.

My advice is to separate the supply for each major component like so:

one 9 volt battery for the Arduino (a good alkaline battery can power the arduino for at least 5 hours and up to 10)

one pack of 6 cells in series @2500mAh for each motor. 

to control the motors with the arduino you will have to connect the grounds (minus side of all these circuits togather)

unless you use optocouplers, and then you can have 3 completly independent circuits