Introduction: Convert Battery Powered Electronics to Run on AC

Picture of 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.

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

Picture of 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. 

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. 

Step 2: Connect the Power Supply Using a Power Jack With a Built-in Switch

Picture of Connect the Power Supply Using a Power Jack With a Built-in Switch

The first way to connect the power adapter to your electrical device is to use a DC power jack with a built-in switch. On this connector, pin 1 is normally connected to pin 2. But when the plug is inserted into the jack, this connection is broken and pin 1 is instead connected to the wall of the plug. This kind of connector can be used to switch the device from running on the battery pack to running on the power supply whenever the it is plugged in.

To wire up this jack to the rest of the circuit, cut the wire coming from the positive terminal of the battery pack in half. Connect the wire coming from positive terminal of the battery pack to pin 2 on the power jack. Then connect the other part of the cut wire that goes to the circuit to pin 1 on the power jack. Lastly connect the negative wire from the battery pack and the circuit to pin 3 on the power jack. This will create a common ground line.

To use this connector in this project you will need to connect the regulator circuit between the power supply and the plug. You can't put the regulator circuit inside the housing because the jack has a single output terminal and you would have to regulate the power coming from the battery pack as well as the adapter. This would waste a fair amount of electricity and saving batteries is the point of this project.

Step 3: Connect the Power Supply Using a Dummy Battery

Picture of Connect the Power Supply Using a Dummy Battery

Another option for connecting the power supply to the electrical device is to use a substitute or dummy battery. This is anything that takes the shape of the battery and fits in the battery housing, but is used to connect the power supply to the terminals of the battery connectors on the device.

Here is one quick example of how to make a dummy battery. Take a wooden dowel and cut it into section that are a little shorter than the battery. Then select some screws that will make the connections on each end. Using a drill bit that is a little smaller than the shaft of the screws drill a hole in the center of each end of the cut pieces. This will help prevent the wood from splitting. Screw the screws into each hole leaving a little room to wrap wires around the screws. Cut several pieces of wire and strip the insulation off each end. Then wrap the bare wire around the screws and tighten the screws down on top of the wires to hold them in place.  

One of the wooden pieces has an extra section of wood cut out to make room for the regulator circuit. The positive output of the regulator is connected to one screw and the negative output of the regulator circuit is connected to the other screw. Be sure to mark which end is positive and which end is negative to avoid confusion when inserting the dummy batteries into the battery pack. 

There are any number of other designs that could also work to make the connections in the battery housing. You could use bar stock, washers, pipe, quarters, etc. You could also skip the dummy batteries and just connect the output wires of the regulator circuit directly to the end terminals of the battery pack. The choice is up to you.

Lastly this method require you to cut a small slot in the wall of the battery housing or cover to accommodate the wires of the power supply. 

Step 4: Finished Battery to AC Power Adapter Conversion

Picture of Finished Battery to AC Power Adapter Conversion

Now just plug in the power adapter and you are ready to try it out. This mod give you a choice in how to power your electronics. You can have the convenience and portability of batteries, or you can save batteries and money by using AC power. 


SidF (author)2018-01-20

I have a battery holder with four 1.5v C batteries for my exercise bike. The batteries are connected in series.

There are two connection points from the battery holder to the printed circuit board.

There is one between batteries 2 and 3 which generates +3 volts and there is one at the end of battery 4 which generates +6 volts.

Should I use 1 or 2 regulator circuits? At what voltages? How should they be connected to the battery holder?

Thank you,


If you use 2 voltage regulators it will definitely work. But that might not be necessary. It depends on how much current the 3V circuit uses. If the 3V circuit is a lot current application, you might be able to get by using a couple of resistors to make a voltage divider.

Thank you. I think I'll play it safe and go with the two voltage regulators.

OwenM48 (author)2017-10-11

hi i have a wall clock having a 1.5v battery whom i have to replace daily,quit an expense,so i decided to convert it to Ac supplied from the wall switch.Could some body tell me how to do it or if it exist a converter to convert from Ac 240V to Dc 1.5V

ChrisW580 (author)OwenM482018-01-19

This will do exactly what you need, no soldering needed. Some reviews claim their clock ran slow afterwards. I had no issues with mine.

"Battery to Electric AA Converter - Convert Any AA Battery Clock/Device to Electric - NiMH Battery Will Keep Your Clock/Device Running In Case of Power Failure"

look for a variable power adapter that has a 1.5V output.;=variable+power+adapter&rh;=i%3Aaps%2Ck%3Avariable+power+adapter

CarlS121 (author)2018-01-01

Must add a warning; when I tried to apply this to a TENS machine who was consuming lots of batteries, the item went dead, broken. I used a 6 v. adapter with four dummy batteries. It seems as if not all appliances have a serial connection(?).

I'm sorry to hear that. Yeah. This kind of voltage regulator is not suitable for any kind of sensitive electronics.

Thanks; it was entirely my own fault, not being careful enough. Should have used capacitors. Well, I take it as learning money. Your page is great!

harlyquin (author)2017-09-18

This is tremendously helpful! Thank you for this information. I am not an electronics person, but I get enough of what's going on to repeat the process. I've got a few kitchen devices I would love to convert right away!

If you want to simplify it even further, you can buy adjustable power supplies that you could just connect directly to your device.


Using that adapter and the LED light connector, could I just take the positive and negative directly into that connector and set the voltage to what I need? Is there still a need for a regulator? This is for a battery operated LED light.

For most applications, you can just connect a variable power supply directly to the circuit that you want to power.

quinstructable made it! (author)DIY Hacks and How Tos2017-11-03

I've been doing this with small electronics that I find in second-hand stores. The small investment means I don't feel too bad if I manage to fry them while experimenting. Helps to already have a large collection of adaptors on-hand, most of which I've also picked up second hand. Have had good luck so far.

kikincognito (author)2017-11-21

cool stuff. I have a question about expanding your hack. you may even be able to sell it since i know lots of people who discuss same need with me. Here is the question:

On a Xmas village, I have about 14 small Xmas decorations that run on 2, 3, and 4 AA batteries. So that is 16 X 2 or 3 or 4 = 32 to 64 batteries. Lots of batteries!

What design would you recommend that could replace all those batteries? Since the devices are all in one location (within 5 feet of each other).

That should be fairly simple. You will need a power supply that is at least 6 volts and enough amps to power all of the pieces. Then you will need a voltage regulator for each number of batteries. So you will need one voltage regulator for 3V, one for 4.5V and one for 6V. Connect all the GND's together. Connect all the positive inputs for the regulators to the positive output of the power supply. Then connect all the village pieces with the same voltages together in parallel and hook them up to the corresponding regulator.

GraceW32 (author)2017-10-11

Hello im from india. I have a 9v baterry device can i used with a 12v adaptor directly or can you give me some idea please....

That depends on the device. If it is a low powered device, you might be able to just add a resistor to it.

My device is a distortion padel ultra um300 its powered by 9v where to add a resistor, how to do am confused

Well you could just stick a resistor between the power supply and the terminals of the battery pack. But that would require a lot of trial and error and you might risk damaging the device in the process. I recommend just using a 7809 voltage regulator;=1C1CHFX_enUS492US492&oq;=7809&aqs;=chrome.1.69i57j0l5.2336j0j7&sourceid;=chrome&ie;=UTF-8

Christian AlvarezF (author)2017-09-09

Hi, what is the output of your AC/DC Adaptor? Or Any adaptor will do?

Email me here.

Thank you.

trying_again (author)2017-07-31

I'm totally a new to this sort of thing and I fully intend on following your directions exactly, but are these resistors 1/2 or 1/4 Watt? Would it even make a difference in this application?

It doesn't make a difference, The current through these resistors is so low that you could use anything and it would be fine.

DariuszM7 (author)2017-07-21

Sorry if I sound very dumb, but isn't there something wrong with your formulas? Shouldn't Vout be somehow related to Vin, not only to R1 and R2? How do you get Volts if you have just a ratio of Ohms?

This works because the other component is a voltage regulator IC. It set a constant output voltage that is based on the ratio of the two resistors.

JeffD175 (author)2017-07-08

Great tutorial!

I am looking forward to trying this out myself! Thanks for putting this together!

stefano.mega (author)2017-06-02

This is VERY helpful! Thank you.
2 questions:
1. Do all electronics use their batteries linked in series? If not (to play it safe) could I use a Vout of 1.5V and power each mock battery individually?
2. The device I'm about to tamper with has 2 different circuits: one powered by 2 C batteries and another by 2 D batteries. The voltage is the same, but the drawn currents are not. In theory, is it possible to use a single VR circuit as long as it's able to provide the sum of both max currents?

Yes. Almost all electronics have the batteries wired in series. The thing to keep in mind with the multiple battery packs is that they are most certainly independent of one another. And it may cause problems to try to run them off the same supply.

AllJacks (author)2017-04-26

Jason, Thanks very much for this and your patience with all the mad questions. I for one found this very helpful and am currently applying it.

iula72 (author)2017-04-04

How would you wire something like this? Seems to have 2 negative wires going to possitive and negative terminals for battery.

One wire is positive and the other is negative. They both just happen to be black.

CraigieD (author)2017-03-14

Would it be possible to convert something that runs on 3 little AG13/LR44 batteries? If so, how would i go about doing this? I ask because i just got a statue of the division agent made by Ubisoft from the game, The Division, and it has 3 LED's in it. 1 for the ball grenade, 1 for the watch and 1 for the ring on the backpack. I tested it out today to see how long the batteries would last. Within about 4 hrs, the batteries are almost dead already. That is why i would like to convert it to ac power. So, if it can be done, could i get some clear instructions on how to go about doing this and what i will need to do this please? Any help would be appreciated :)

You could follow the example given. But for something low powered like LEDs, you could simply things a little. How are the batteries and the LEDs wired together?

tmzaman (author)2017-03-05

Thanks for your instructable.
I have fisher price swing for babies it's using 4 C ( LR 14)1.5V batteries. I want to convert to Ac source
I have 2 questions
1) if I am using 6 Volts adapter, do I need LM 317 and resistors.
2) if I am using 12 Volts adapter( which I have one) what voltage regulator and resistors do I need .

Thanks and appreciate for your response

Four batteries at 1.5V each makes 6 volts. So an appropriate 6V power supply might work by itself.

JohnO231 (author)2017-02-08

How might this work in a device that has batteries oriented vertically, such as a flashlight? i have a dremmel-like tool for trimming my dogs nails that drains way too many C batteries.My first thought was to adapt an actual dremmel, but this seems much easier.

If the batteries are vertical, just make one long dummy battery instead of multiple smaller ones.

ElleZ (author)2017-02-13

My son has lit up letters that hed like to connect to a plug. Will this work

It should

blakennsizoukgvc (author)2017-01-24

Couldn't you just use a universal adapter and wire it into the device?

RomanW9 (author)2017-01-18

Thanks for the Instructable. I would like to power a door lock this way but I still want to keep batteries for power outage backup. If I replace the alkaline batteries with NiCad or Li, can this circuit charge the batteries as well?

I would not recommend charging lithium batteries because they need a special kind of charging to make sure that everything is safe. NiCd are a little safer to trickle charge.

meraki (author)2017-01-23

Thanks for the simple but very useful instructable.

Just a small edit to the formula in the figure in step 1. The correct formula should be : Vout=1.25V*(1+R2/R1)

Acmanek (author)2017-01-18

Can you please help me I have that Nine Stars motion sensor garbage can that uses 4 D batteries I built your circuit and tested it with a multimeter and there's 5.96 volts coming through when I connect to the garbage can there is no power at all does this mean I need more amps?

pjfsdias (author)2017-01-11

how easy is to do it for this door bell and how do I do it?

This is a basic way to convert any battery powered device to run on AC power. The process should be basically the same regardless of what device you use it on.

drewracer406 (author)2016-09-02

Hi, thanks for the tutorial. I have used a LM317t, 240 ohm and 910 ohm resistors, and followed your circuit layout, but I am getting a voltage reduction from my 9v 1000ma power supply with no load from 9.36v to 8.51v. I have tried building it twice with all new resistors and regulator to attempt to eliminate the faulty components variable, but same results. Do you have any idea what I have done wrong? Playing with various different resistor values does not seem to affect the v-out much. I am trying to do something similar to you, but rather than a baby swing, it is a crib 'soother' that gobbles up 4 C batteries at least once a month. Thanks for any tips!

Could you post a few pictures of the circuit. That would help me see what might be happening.

And a noob question...
Would this work?
Its just a potentiometer. I can get the correct output voltage when i set it just right, but is it a good solution?

About This Instructable




Bio: My name is Jason Poel Smith I am a Community Manager here at Instructables. In my free time, I am an Inventor, Maker, Hacker, Tinker ... More »
More by DIY Hacks and How Tos:36 Things to Cook in a Coffee MakerHow to Make a Festivus PoleAdd Wings to an Infant's Halloween Costume
Add instructable to: