Convert Battery Powered Electronics to Run on AC

411K944165

Intro: 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

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. 

STEP 2: 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

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

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. 

137 Comments

I have a question, but I think I already know the answer...I Am an electrician, and I have a client that wanted me to hang (15) Christmas wreaths on their house. I agreed, and ran all of the necessary 120 Volt GFCI protected outlets necessary to plug the wreaths in without using a ton of extension cords. BUT, when the client received the wreaths...they were battery powered! He asked me if I could assist him in the conversion from battery to 120 volt. He showed me this post, and I “quickly” read through it, and agreed to assist. I was in a bit of a rush when I put the material list together for the project, and only ordered (15) 6V AC to DC power packs. I then forgot about the project, until the material arrived. When it was time to complete the conversion, I simply removed the (4) AA battery packs, and connected the (+) line from the string of LED lights that needed power on the wreath, to the (+) output from the power pack. I then completed the same step with the (-) wire. I plugged it in, AND it worked!!! Everything looked amazing! I completed this to all (15) wreaths and completed the holiday installation. NOW...the wreaths LED lights are going dim! So here is my question...after rereading this post, did I simply skip the installation of the Voltage Regulator? Or did I miss something else too? I need to fix the wreaths and don’t want to return multiple times, as they are very high up on the windows of a two story home. Thanks in advance! Chris.
Hi Jordan. this is great. I am also trying to get my son's rocker on AC. I am having trouble finding the Voltage Reg and Power jack on Amazon. There seems to be many different types of each. Could you please post with a link to each item on amazon? Thanks in advance!
Please can you advise whether or not the ampage/mAh differences will make a difference to this conversion? Or can I just use a 12v for any 12v requirement? (Almost all chargers/adaptors show different mAh figures.)
I have 4 LED lantons each having 2 1.5 batteries that's 12 volts
to covert to power can I use a transformer 24v-250mA 6 VA
Thank You. Ken.
Would/could this hack be applied to a device with a provided A/C adapter meant to charge the device's battery? I'm asking specifically for the purpose of converting a Swiffer Sweep Vac (because 16 hours of charging for 12 minutes of use--on a new battery, is bananas). Thanks! :)
Could you tell me why the dummy batteries were necessary? Was it just for cosmetic reason or was there a purpose?

They aren't 100% necessary. You could just connect the wires directly to the terminals on your device. I just did it as a way to make it quick and easy to connect and disconnect.

I think they put the full 6v across 1 dummy battery. The 3 orange batteries are just short circuits. Maybe.

Would like to add LED to circuit. Can you please validate that I've picked the right resistor values for 6V output and LED?

Thank you.

The resistor that you need for an led depends on the operating voltage of that LED.

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?

@RomanW9, did you find a solution? I too am attempting the same thing. I have Schlage Connect locks I want to power on A/C but want to trickle charge batteries as backup.

"@DIY Hacks and How Tos" how might your how-to differ to be able to trickle charge the batteries? My lock specifically has 4 AA batteries. I am thinking of just buying a 6V 1000 mAh adapter. My batteries sit in a battery tray that is connected to the device by a 9-volt connector (simply used as a way to connect/disconnect and allow for removal of the battery tray).

Thanks for the tutorial, really great.

Here is a picture of what the battery pack and connector looks like.

I did finally find a solution after some research and discussion on the forums at All About Circuits. I am using a NiHM battery pack (just slightly too large to completely close the cover) and an a/c adapter to trickle charge. I will try to write up the details in a couple of weeks when I need to make some adjustments to it.

I should clarify, it isn't just an a/c adapter, the adapter has a time-out to trickle charge automatically.

Nope, have not given it much thought. The charging circuit should be easy enough but wiring the lock through the door is the biggest challenge

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.

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,

Sid

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.

More Comments