# Convert Battery Powered Electronics to Run on AC

We use batteries to power a lot of our electronics. But there are some battery powered devices that don't necessarily need to be portable all the time. One example is my son's battery powered swing. It can be moved around but it usually stays in the same general area. In cases like these it might be nice to power these devices with an AC adapter and save the batteries. So in this project, I am going to show you how you can use an old power adapter to power your electronics in place of batteries. I will share how to modify the adapter and two different ways to connect it to your electronic devices.

Remove these ads by Signing Up

## Step 1: Use a Voltage Regulator Circuit to Set the Output of the Power Supply to the Appropriate Voltage

It is very rare to find a power supply that will perfectly match an electrical appliance unless they are sold together as a pair. So we are going to have to modify our power adapter to match the circuit that we want to power. The easiest way to do this is to use a variable voltage regulator such as a LM317. The typical configuration for this kind of circuit is shown in the picture above. This regulator uses two resistors to set the output according to the formula: Vout=1.25*(1+R2/R1).

For most applications this circuit can be simplified a little bit. The capacitors are only needed if your load circuit is sensitive to small power fluctuations. So in many cases, these can be eliminated. The variable resistor R2 is useful if you want to be able to power multiple different devices. But if you are going to use the power supply exclusively on one device you can replace it with a fixed value resistor. Wire the circuit as shown with Vin connected to the power supply and Vout connected to the circuit that you want to power. The regulator will bring down the output of the power supply down to the value that you set.

Depending on the power rating of your circuit, you may need to add a heat sink.

Example:
My son's swing normally runs on four C size batteries. So I found an old power supply with a 9V 1000mA output. I figured that would be enough to replace the battery pack. Then I soldered together the LM317 regulator circuit with a 220 ohm resistor for R1 and a 820 ohm resistor for R2. These resistor values give an output voltage of 5.9V. (It would have been ideal to use a 240 ohm for R1 and a 910 ohm for R2 but I didn't have those values on hand) This output is still well within the operating range for a four cell battery pack. Anything between 1.25V and 1.5V per battery will usually work. Since the electronics on the swing just consists of a motor and a speed controller, I decided that the filtering capacitors weren't necessary and I left them off. See the following steps for the best methods for connecting everything together.

 1-40 of 45 Next »
micthenic2 months ago

Hi, I find your instructable very cool!

Even more, because I had a similar idea with a cheap cordless drill, years back. I did it, more or less your way, but without the voltage regulator, since I used a matching AC adapter. Alas, the power was not enough, I think the drill needed more current, than the AC adapter could provide.

Now, I could use the same procedure to power a cordless jigsaw I have (MAKITAJV100DZ http://www.makitauk.com/products/saws/jigsaws/jv1... I already have the drill (MAKITA DF330DWE http://www.makitauk.com/products/saws/jigsaws/jv1... and I use the same Lithium-ion 10,8V-1.3Ah batteries. This is quite practical.

The thing is, the saw drains the batteries very fast, which is ok for simple jobs, but if I want to cut something big and thick, I need to change the batteries every couple of minutes.

Your instructable would make perfectly sence here. But I need the jig saw to have the same power with the AC adapter as it has with the batteries, not like the failed attempt I described in the beginning.

Now, here comes my question. If I use the AC adapter of an external hard disk, with an output say 12V, 2A, can you tell me what voltage regulator, and more important, what resistors and eventually capasitors should be used?

I am terribly bad with calculating electronic circuits and I don´t want to fry my jig saw. I you could help me on this one it would be great - thanks!

SIRJAMES093 months ago

Sweet! :)

I like this....A LOT! :)

TY for sharing.

Q:

the idea of doing this, the basic idea I mean,

will it work for all battery powered appliances?

Granted, everything is different & each item has to be modified independently

but is this basically how battery operated things are converted?

I prolly have 10 or 15 of these power pack things I've saved thru the years.

DIY Hacks and How Tos (author)  SIRJAMES093 months ago

An electronic device doesn't care where the power comes from as long as it has the correct voltage and can output enough power. So if you match it with a power adapter that has the right power output it will work.

3 months ago
AAAAhhh ok....
*smoke fills the room as I scheme & think....*

TY Sir. :)
sethsaffel4 months ago

This exact swing is the exact item that prompted my generic conversion search, Wonderful. Thank you Google and author.

gravityisweak5 months ago

A couple things: 1. For a device that uses 4 C batteries, couldn't you simply use a 6v wall wart instead of taking a 9 and stepping it down? 2. In most devices, you would only need to connect the leads from your wall wart to the first and last battery terminal. There is really no need to create dummy batteries as the spring connectors are really only tabs of metal connecting one battery to the other. Correct me if I'm wrong on either of these.

5 months ago
The problem is finding a 6V adapter that has the appropriate output current. Most power adapters aren't regulated so their output voltage will change depending on how much current is being used. By using a voltage regulator circuit, you don't need to worry about matching the current.

Yes, in most cases you won't need dummy batteries but some battery terminals can be difficult to make a temporary connection to.
boondawgy7 months ago

Do the dummy batteries need to connect to each other?

DIY Hacks and How Tos (author)  boondawgy7 months ago
No. They just fill the space. All you need is for the end terminals on the battery pack to connect to the output of the regulated power supply.
philjor7 months ago

I'm puzzled by Step 2. I don't see this in your setup.
It seems to me you can't very well have the batteries in your device and connect the power supply unless you use the modified cell outside the battery compartment. I dont see this in your setup. ???.

DIY Hacks and How Tos (author)  philjor7 months ago

Here is a different picture. The numbers are different but it does a better job of illustrating. The barrel contact 2 is normally connected to the pin 3. But when the power jack is inserted, it presses on the barrel contact and pushes it away so that it is no longer connected to the pin 3. This can be used to disconnect the battery when the power jack is inserted.

This is the same type of connector that is often used for head phones. When the head phone plug is inserted into the head phone jack, the speakers are disconnected at the same time that head phones are connected.

7 months ago
I am not too well versed in electronics, so please bear with me. I do have a basic understanding of electricity and do design my own lighting units for photography. But I do have some questions:
1.What is the source for the value of 1.25 in your formula?
Alkaline AA batteries output 1.5v; rechargeable AA batteries output 1.2v (I no longer use them they are a PITA). How does this affect your formula.

2. In what way do the resistors and capacitors affect the output?

I am trying to make an adapter for a 6v battery pack for an electronic flash. I have done this for a Nikon SB800 and a Vivitar 285. Just a regular 6v power adapter does the job. But it does not work on an Aputure Magnum Speedlite MG-68. There is a delay when the on/off button is pressed before starting. 4 AA alkalines work fine, but the 6v external power adapter does not activate the battery.
DIY Hacks and How Tos (author)  philjor7 months ago

The 1.25V has nothing to do with batteries it is just a ratio of the resistor values and the corresponding output. Maybe the wikipedia article would help give some details on the design.

http://en.wikipedia.org/wiki/LM317

7 months ago

Thanks much. Appreciate that.But I sill have some questions:

BTW, I found the problem with my flash and it works in the same way as the others did; fro the usual 6v power supply. The problem was a clever little trick in the + connector to the aa battery: the connector had to be a smaller diameter; otherwise a large screw head would push the connector out of contact. Silly how simple.

I don't quite know how to interpret (or understand some things in the schematics:

1. what determines the resistance values in your schematic: why 240 ohm and 910. I know that gives an out v of ca. 5.98. So, if I wanted 12v output, I would use R1=240 and R2=2064. But what if I used larger or smaller resistors in the same ratio?

2. In another schematic on wikipedia there was a reference regarding limiting current with the notation IQ (subscript Q). Where could I get some information on that kind of notation. There seems to be a bit of that kind of notation and I would like to understand what these references are and where do they originate?

And I do really appreciate your help. I won't bother again. :))

DIY Hacks and How Tos (author)  philjor7 months ago

The formula that I list is a simplified version of the formula

VO = 1.25 V (1 + R2 / R1) + Iadj * R2

Iadj is small (less than 100 microAmps. If you use 240 ohm for R1, then this part of the equation is very small and can be ignored for the most part. But if you use a different value for the resistor, then you may need to include this part. If you want a lot of more detail you can read the data sheet for the part.

http://www.fairchildsemi.com/ds/LM/LM317.pdf

cparker110 months ago
Heck if that was one of them models that leaked acid all over the child that sat or laid in that would be a great fix
bdinyou1 year ago
is this the same if it was one battery?
DIY Hacks and How Tos (author)  bdinyou1 year ago
The voltage regulator should still work. You just need to select the appropriate value for the resistors.
TwistedFrosty1 year ago
I keep reading about an overheating factor which does worry me I admit, but there is an easy way to avoid any risk of that, they sell socket power timers and they can get pretty customizable. I suggest this one for this application for anyone worried about overheating, and if you really wanted to go over board you could plug in a portable GFCI plug before the timer then the devise
rredmon1 year ago
As a parent, I would like to add a couple points to the safety discussion.

1. Why would your child be in the swing with a drink?
2. Common sense overrides over safety.
tammasus1 year ago
Cool! But no dummy batteries are required I believe. Only the first and last connectors are needed since the batteries are connected in series.
1 year ago
I agree, no dummy batteries required. Even if there were individual battery taps having dummy batteries wouldn't help because you wouldn't be supplying 1.5v between each terminal. The dummy batteries short out any individual taps.
1 year ago
I thought the same thing, but I have an Arvin radio from 1958 that uses 6 c cell batteries in total and taps from the first one for the amplifier circuit
1 year ago
Nope. not always. I've had one thing where the device tapped individual batteries to get variable voltage. Not standard, but it does exist.
LestatAlmighty1 year ago
I think everyone is forgetting that his example was on a baby swing, this is not only meant for that device, else it would say "Convert battery powered baby swing" instead of the actual title. Also, this is setup to be no more harmful than the batteries it is replacing, cut him some slack. God forbid anyone mention batteries exploding....
mrfrossard1 year ago
why don't use directly a 6v ac power to prevent all the job of a voltage regulator circuit?
gdaily11 year ago
Those who are posting about the safety of using a DC power adapter to power this infant swing don't know anything about electricity. First of all it's a low-current DC supply and wouldn't cause any injury even if the DC voltage was able to reach anyone. If a drink were spilled on the DC transformer plugged into the wall, it would trip the circuit breaker. Besides, the child will be in the swing and not crawling around on the floor near the transformer plugged into the wall without supervision. (If the child is doing that, the problem is with an unobservant parent, not with the modification to the swing.) The only salient point I saw posted regarding safety was the possibility of the cord getting entangled in the swing mechanism, but using some electrical tape, zip ties or other fastening method to attach the cord to one of the swing legs would take care of that.
I'm all for a hack to power something from the wall instead of batteries but you've got some things to consider when hacking a child/baby product. You could call me an overly cautious parent but I think would think twice about "electrifying" something where it could be a potential hazard for the little ones. Having direct connection to the wall where the kid could splash their drink or get entangled in the cord is a possibility. Having the regulator overheat or some surge to blow the motor causing a runaway rocker... If that thing plays a musical song and doesn't shut off because the battery power never goes out... I would use an appropriate UL listed grounded wall wart with a pull away power connector to the rocker.
1 year ago
He is using a wall wart. Not Direct AC. He is using a 9vdc wall wart and regulating it to 6vc. The series voltage of (4) 1.5v D Batteries.
1 year ago
True, you still have to pull the rocker closer to the outlet.
1 year ago
I would assume you do not have any outlets in your house? Scared the electricity will jump out and kill your child?
1 year ago
Bless the beasts and the children too.
1 year ago
Hey caitlinsdad, I had the same concern regarding this. Between the wooden dowel rod touching the unshielded wire, and fact that the person using this rocker wouldn't be able to get out on his/her own in the event of a fire, I have definite qualms.

@sarge89or: that's a pretty foul response.  It's also pretty irrelevant.  There's a huge difference between having an electrical outlet in your house, and hacking an infant's rocker seat to run on a hacked wall wart.

Like caitlinsdad, I totally support the impetus for this instructable - i.e. the desire to move away from a less efficient battery, charged from the wall (best case scenario), to simply running the electronics from the wall.  I think it's well written and well-documented.  It's just the implementation that is worrisome to him and to me.

That said, I just saw this was featured in Hackaday - kudos DIYHacksAndHowTos!
1 year ago
Can we all just tone down the warning comments on instructables. Everyone seems to be trying to out-safety the next guy. There is nothing wrong with this at all. Lets try this, if you do not like it don't do it.
1 year ago
I did qualify my comments based on experience as a parent and expressed my concern. Everyone has a different level of acceptable risk and I will support anyone going for the Darwin Award. Nothing wrong in commenting on any ible to provide feedback to the author. I don't know about you but if you become a professional or knowledgeable in any area, basic ethics are that you should have a responsibility to educate others including pointing out potential hazards or pitfalls. So I don't think anyone is trying to out-safety anyone. Just discussing and learning.
hertzgamma1 year ago
Why you don't use any heat sink for the voltage regulator? There must be figures in the manufacturer's datasheet for the emitted wattage of heat energy for the amount of required power consumption. With this you would calculate the area of the heat sink.
DIY Hacks and How Tos (author)  hertzgamma1 year ago
The circuit that I was powering didn't use enough power to need a heat sink
mprzymusiński1 year ago
heh you don't have to use a fake battery :) only need to connect by clips to both side + and - of this battery container.
Yard Sale Dale1 year ago
If the unit you are powering takes a pretty low amount of juice, there are selectable voltage AC/DC adapters from Walmart etc. You can cut off the end and add a quick-connect to the wires, and solder on wires and a quick-connect to the appliances battery tabs or power wires. Just plug in the "wall-wart", select voltage, and plug into the appliance. I use mine for guitar-effects pedals that eat batteries, and sometimes little fans.
KillerGardevoir1 year ago
May want to correct the second to last sentence, the ("weren't unnecessary" part). Otherwise very interesting!
 1-40 of 45 Next »