# I want to have a 9v battery to give a 4.5v - 5v power supply? [duplicate]

I am trying to download a program on to my PIC circuit. As you know the pic isn't supposed to operate with anything larger than 5v. I don't have any access to a battery pack which could hold 3 x AA batteries. What i do have are lods of other stuff, that may be useful. I was thinking that if i used two 330 ohm resistors to create a potential divider then had another battery snap going off from that to the pic circuit. Would that work?

]2

• Tape or rubberband 3 AA batteries (and some wires or bits of metal) together. Properly bent wires on a protoboard will do, too. Or wedge them into a suitable cardboard, wood or plastic box, or tube (tube may be easier as you don't ned to provide any inter-battery connections.) 9V has MUCH less capacity (amp-hours) than AA - so even if you use a switcher, you'll have comparatively poor runtime. Cost is usually worse, too. Feb 14, 2016 at 1:17
• Why is this being voted negatively Feb 14, 2016 at 18:06
• Google "9V to 5V regulator cap". Or build your own. Jun 21, 2018 at 20:51

That's not usually a good idea for a couple of reasons.

• It wastes power. From $V = I \cdot R$ we can calculate the current, $I = \frac {V}{R} = \frac {9~V}{660~Ω} = 13.6~mA$ without doing anything useful!
• More importantly, the voltage will vary depending on what the processor load is. If the PIC has a wide voltage tolerance you might get away with it.

You really need a voltage regulator.

A quick work-around is to use a USB port as power supply. Get a cheap USB cable or broken USB device, keep the A-plug end (that goes into your computer) and cut the plug or device off the other end. The red (+) and black (-) should give you a 5 V regulated and current-limited supply. Check with your multimeter.

USB cable pintout

Red   | Vcc (+5 V)     | Connect to circuit +
White | USB Data -     | Not used
Green | USB Data +     | Not used
Black | Ground         | Connect to circuit -
Shield|                | Not used (probably connects to laptop ground)

• I'll try that. Thanks. So the potential divider won't work? Feb 13, 2016 at 12:41
• Very good answer ! I did not consider a USB supply Feb 13, 2016 at 12:41
• What do i do with the earth wires? Feb 13, 2016 at 12:52
• I presume you mean the shield / screen. See update. If you have a USB charger you may wish to use it in preference to your laptop. Cost of replacement will be less if you have an accident. If you're only running a few LEDs or similar from your PIC it is very unlikely that you could cause any damage. Feb 13, 2016 at 13:06
• @HasanImtiaz: The potential divider might work but consider what would happen if the PIC went from drawing almost zero current to drawing 20 mA. The voltage would collapse from 4.5 V to, maybe, 2 V. You need to regulate the supply. Feb 13, 2016 at 13:23

You could try to use a voltage divider along with a voltage-buffer OpAmp. (if you connect the pic directly the voltage diviser output, it will not work since it will draw current)

• I don't have access to many things, which is why i am asking otherwise i would order a 3x AA battery pack, but delivery is 10 pounds and I don't want to spend that kind of money for a 50p thing. Will the potential divider work? I'm asking because i have only just started my ecpirience with electronics? Feb 13, 2016 at 12:38
• voltage divider alone will not work, because its output current has to be zero, that's why I was suggesting a voltage buffer. Can't you just buy those 3 AA batteries in a shop or something ? Feb 13, 2016 at 12:40
• Then how would i connect it to the circuit? Feb 13, 2016 at 12:43
• What about wires ? Feb 13, 2016 at 12:44
• I understand how it would work with a 9v battery. How'd i do that with aa batteries Feb 13, 2016 at 12:51