# How do I convert 9 V DC to 5 V?

What's a good way to reduce the output from a 9V battery to the 1.8V to 5V required by an ATmega328 controller? The context is a small robotics platform with low power requirements (very slow movement).

• A similar question, but with different voltages: What is the coolest way (using passive cooling only) to step 12V DC down to 5V DC Commented Dec 20, 2010 at 23:06
• Is 9v dc converted into 5v dc using 7805 ,0.33microF cap & 0.1 microF cap? pl answer me fast..
– user3209
Commented Mar 2, 2011 at 4:38
• @Rajesh, yes, this does get the job done. Commented Mar 2, 2011 at 7:31

I would use a 7805 to get 5 volts simple circuit. Here is a image:

idea: please make sure that caps are ceramic/polymer caps. The ceramic caps only have low ESR value. specially the right hand one.

• And for reference, here is how to decide what value to make the capacitors electronics.stackexchange.com/questions/8121/… Commented Dec 21, 2010 at 0:23
• +1 since the 7805 is simple and good for rapid prototyping. But remember that this solution will drain the battery really fast! So if you are thinking about power management go with another solution. Commented Dec 22, 2010 at 12:13
• What would be the ground current for a 9v input with an LM7805? Commented Dec 27, 2010 at 23:47
• @Kortuk, ground current is related to power wasted irrespective of load. According to the Fairchild LM7805 datasheet, graound current for lm7805 is 5mA typ, 8mA max, and doesn't change much with load or input voltage. This current will drain a standard 9V Energizer 522 flat in about 100 hours, so if the circuit will be on standby it would be better to use a more modern regulator with lower ground current. Commented Mar 1, 2011 at 7:40
• @markrages, I did not know the term ground current and took a shot at answering since he asked a while ago. Thank you for taking the time to clear that up! Commented Mar 1, 2011 at 7:54

Since you want to power from a 9V battery we have to look out for possible current losses. While a three-legger like LM7805 may be an obvious choice, this regulator has a ground current of 8mA maximum. An LDO (low drop-out) regulator typically needs far less, e.g. the ground current of an LP2981 is only 800$$\\mu\$$A maximum. That's only 10%!
LDOs are as easy to use as an LM7805. The output capacitor is a bit larger, though, important for stability.

edit
Johan wanted an example:

If not used, the ON/OFF input must be tied to $$\V_{IN}\$$. The output capacitor value of 3.3$$\\mu\$$F is the minimum required for stability. "More capacitance provides superior dynamic performance and additional stability margin" (dixit NS)

edit 2
You can even save more power, but it's probably not worthwhile; your motors may consume a lot more than the LDO's 800$$\\mu\$$A.
Anyway, there are LDOs with < 1$$\\mu\$$A ground current, like the Seiko S-812C50. Input voltage up to 16V, output voltage is selectable from 2V to 6V in 100mV increments. Output current is limited, however, to 50-75mA.

• Where the heck do you get one of these (the LP2981) that can be used on a breadboard? I can only find tiny pcb versions of this regulator. Commented Jul 9, 2020 at 5:57

I might consider just providing the ATmega328 unregulated power unless you have something that actually requires it on the board. 2-3 AA cells should remain within 1.8 to 5.5 V over their life.

A schottky might be prudent if you insert the batteries the wrong way (probably will need 3 cells then), and you could add a TVS if you want to be even safer.

• yea this is almost certainly the way to go, on the other hand the QA is asking specifically about using a 9V battery... Commented Dec 20, 2010 at 21:34
• @tyblu: it can't be the best solution since it doesn't comply with the given input voltage of 9V. Isaac may have his reasons to use a 9V battery instead of AA cells, like a stock of 2000 of them :-) Commented Dec 21, 2010 at 12:10
• My particular application uses motors that I intend to run at 9v. Commented Dec 27, 2010 at 23:43

It depends how efficient you need it to be. Simplest would be an LM317, but it will waste a lot of power. A switcher would be better, like those made by Nat Semi.

I wouldn't use a 9V battery, though.

• What power supply would you suggest instead? -- I'm curious to know what you would suggest as a good power supply for using during development as well. Commented Dec 20, 2010 at 19:23
• Four AA cells would be a lot better, with an LDO if you need 5V. I use a bench power supply for development. Commented Dec 20, 2010 at 19:40
• @Issac Sutherland, AA batteries are simply better batteries than 9V cells. A boost regulator would allow you to follow a "constant power performance" curve on a battery datasheet and drain it to just over 1V/battery (fully drained), whereas a linear regulator would follow a "constant current performance" curve and drain each to ~5.35V/#batteries (best for 5+ AA's). You have to run the numbers to figure out for sure which solution is best, but it's usually the switcher that comes out on top. Commented Dec 20, 2010 at 20:21
• a 9V battery isn't a bad choice in terms of physical size if you can live with the inferior mAh they tend to provide. Commented Dec 20, 2010 at 20:39
• A 7805 (as shown in Dean's answer) is simpler because it doesn't require any resistors. Commented Dec 20, 2010 at 21:58

if you want an efficient solution, using a Buck Converter would be a smart choice. you can build it with discrete components (inductor, diode, capacitor and transistor) or you can use some IC.

Another way to drop the voltage down from 9V would be to put an appropriate number of forward biased diodes in series with the positive supply. Typically you get about 0.7V drop per diode, so to bring it down to 5V from 9V you'd need something like 6 diodes in series.

Fine... or a single Zener diode!

• If the micro ever went to sleep, the sudden drop in current would cause the voltage to easily rise over 5 V. Commented Dec 20, 2010 at 21:20
• You can use combinations of LEDs, too, if you can't quite get the right number with typical silicon diodes. For example, you can use a red ~1.7V drop LED to get 3.3V from 5V. This also removes some of the heat dissipation. Commented Dec 20, 2010 at 21:21
• This is not the right way to do it: the voltage will vary widely with load, temperature and supply input. Commented Dec 20, 2010 at 21:26
• @Thomas I agree, it's not the right way to do it, but it is a way to do it in principle under some constrained contexts. Commented Dec 20, 2010 at 21:31
• If you really want to use series diodes, a single zener would be a better choice in terms of load regulation and temperature. It wouldn't help with line regulation. Nick T's caution is important, though. Commented Dec 20, 2010 at 21:57