# How can I modify a USB cable with a voltage-divider to provide 3V? [duplicate]

I want to power a small device, that normally uses 4 AA/R6 batteries arranged in 2 pairs (so the device requires about 3V DC and drains probably 100mA or less).

Is it possible to cut an old USB cable, keeping the type-A connector to plug into an adapter or a computer, and solder the +5V and GND wires to a couple of components (to divide the voltage) then to the + and - of the battery compartment of the device?

The answer to this question suggests to avoid resistors to divide voltage. Is is still the case in the above example ? Is there another simple solution?

• That is a recurrent question on this site: "Can you use a restive divider to lower the voltage to power a device." The answer in almost all cases is NO. It is only possible if the 'item to be powered' always draws (nearly) the same current. Oct 3 '18 at 11:45
• Yes, indeed I have seen other similar questions - including the one I linked in my comment. I understand the issue created by adding a load into a resistor-based voltage divider. However I hope somebody more knowledgeable than me will propose a solution for that specific case.
– YAG
Oct 3 '18 at 11:53
• Yours isn't really a specific case though. It is the exact same as the case in your linked question. It just has different voltage levels.
– MCG
Oct 3 '18 at 12:04
• Maybe my question is a duplicate. If so, sorry for that. Fact of the matter, I did not understand the answer provided to the other question ("A switching regulator... is probably the best choice if your device needs more than 10 or 20 mA of current."), while I do now thanks to ratchet freak and MCG. They both correctly pointed to line regulator instead of a switching regulator.
– YAG
Oct 3 '18 at 13:22
• A switching regulator is still a valid option btw
– MCG
Oct 3 '18 at 13:35

It is possible, but you need to remember that the load is going to have an effect on the voltage.

Take a look at this circuit:

simulate this circuit – Schematic created using CircuitLab

Nice and simple yes? Vin is going to be divided by 2, because both R1 and R2 are the same. Now let's add a load on there and see what happens.....

simulate this circuit

Hmm.... As you can see, there is now something in parallel with R2. This is going to affect the value of Vout. So... What can we do to stop that happening? Well, we are going to need a buffer to make sure the voltage stays constant!

simulate this circuit

Great! We now have a constant voltage. But hang on, there is more to consider.... What if the load requires more power than your buffer can handle? Remember, an op amp has a low impedance output (an ideal op amp has a zero impedance output), so will not be able to operate under heavy loads. Well, we can now use a circuit like this:

simulate this circuit

This is the basic schematic to the majority of linear regulators. All you need to do is use the negative feedback to control the output voltage.

If you didn't want to do all that, just use a 3V regulator from any electronics manufacturer that fits your specs

• Well, my attempt at making the schematics a readable size failed miserably, they all ended up different! If anyone can fix it, it would be appreciated!
– MCG
Oct 3 '18 at 11:51
• "Remember, an op amp has a high impedance output" doesn't a general opamp ideally have zero (low output impedance)? Oct 4 '18 at 10:00
• @RemcoVink correct, my mistake! Thanks for noticing. I'll update it now
– MCG
Oct 4 '18 at 10:22

The problem with using resistor-based voltage divider as power supply is that your load is also a resistor (and often varies in the current it pulls throughout it's operation) and you need to take that into account when setting the resistor values. You can replace the bottom resistor with a zener diode to fix the voltage drop but that has issues with the power dissipated through the zener.

For 100mA dropping 2V you can use a voltage regulator instead. Those come in a 3-pin package and will provide a proper regulated voltage supply.

• A linear voltage regulator (such as the mentioned 3-terminal device) is actually a self-adjusting voltage divider which automatically adjusts the resistance of its pass element to account for the load. On a practical level, many should have small capacitors added at the input/output leads for stability. Oct 3 '18 at 13:03
• Great, I found where I can source cheap 3-pin voltage regulators. I'll go with a 3.3V fixed one. Do you think I need to add capacitors in there, as suggested on this tutorial : learn.edwinrobotics.com/tutorial-breadboard-power-supply I see @ChrisStratton mentions the need for capacitors. Any advice on the type of capacitors? Should I follow what's in the tutorial (which is designed to provide 5v from a 9v battery) ?
– YAG
Oct 3 '18 at 13:13
• How come this was the accepted answer, rather than the other one which gives pretty much the same answer, but also gives more information and explanations? Yes, it is correct, but the other is probably better all round Oct 3 '18 at 13:16
• @YAG, just FYI, you didn't have to change the accepted answer because someone suggested it. You may have found this one easier to understand, or maybe some of mine didn't make sense to you (Which you could have always asked for clarification in the comments), or maybe you just thought this had the most relevant information to you. It's up to you which answer you accept, and it should be the one that you found to be most useful
– MCG
Oct 3 '18 at 13:27