Basic power question re: Arduino Mega 2560 w/ a servo shield

So I'm building a robot that includes the following ...

Arduino Mega 2560 ( requires 5V, but ideally 9V? )
Arduino WiFi Shield ( powered by Arduino )
Adafruit 12-bit 16 channel servo controller ( or possibly my Pololu 24 channel job ) ( external 5V power, 6V Max )

I'd like to run this off a deck of eight D batteries.

I don't want to fry anything and I want to hook this up right.

Do I understand correctly that I should build two voltage regulator circuits,
one with an LM7809 for the Mega,
one with an LM7805 for the servo controller,
and I can share the same 12V power supply?

Should the 5V regulator hang off the output of 9V regulator, or directly off the 12V supply?

Finally, I've seen more than one voltage regulator schematic out there with a variety of configurations. Can anyone recommend one? Would I be better off buying a pre-made voltage regulator for ~$8?

Any feedback would be greatly appreciated!

If using battries I would go for a switching regulator rather than a linear one as you get more out of your expensive battries that way. So yes buy one.

You can connect the 8 D cells (12v) direct to the Mega DC power jack.


Thanks guys! I have purchased two switching voltage regulators and hooked up my project in the manner below.

Please excuse my schematic drawing skills. Does this look correct?

Everything seems to work well, my only concern was whether the ground on the LEDs should be connected to the ground on the 9V regulator. I don't want to put inappropriate voltage on a pin. I'm not using the barrel jack to power the Mega, but rather the VIN and GND pin.

That looks fine to me, no need to connect anything to ground. If it is an isolating switching regulator ther
E is no need if it is not an isolating switching regulator it already is.

OK great! Thanks for looking at this!