TL;DR: How can I "splice" two different cords for different barrel jack sizes?

I'm rather new to this sort of stuff, so bear with me here.

I am attempting a project where I need to create a port on the outside of a case for a barrel jack. I am getting power from a USB hub for a Raspberry Pi, and this is my basic setup:

|             |
|             |

Where | = Case Wall, - = Wires, < = male barrel port jack and [ = female barrel port jack.

I ordered a USB hub online, and the company assured me that the barrel jack size would be 5.5mm by 2.1mm. I went ahead and ordered a 5.5mm x 2.1mm extension cord, so the male end would plug into the hub and the female end would go through the outer case, creating a port.

Sadly, the USB hub company was woefully incorrect. I received the hub to find that they used some weird barrel port size -- none of the wires I tested at RadioShack would fit. RadioShack recommended I go to this other store, but first I had an idea.

What if I could change the barrel port size?

I am thinking that I would wire my now useless 5.5mm x 2.1mm extension cord's female end to the male end of the power supply that came with the USB hub. Then I would order a 5.5mm x 2.1mm power supply with the same voltage, and use that size for the outer port instead.

In essence, I would be combining two extension cords.

Would this work? Can I just connect the wires on the two cords and both will work?

Here's the diagram of what I'm thinking, if it doesn't quite make sense:

|              |
|              |

Where | = Case Wall, - = Generic Wires, < = Weird proprietary male barrel jack, [ = Weird proprietary female barrel port, / = standard male barrel jack, { = standard female barrel port, and the different squiggly lines are two spliced wires.

Would it be possible to solder these two power jacks together and have them work?

  • \$\begingroup\$ If this is a DC power supply, be careful not to get the wires mixed up (+) to (-). Connect the first wire, then use a DVM to check before soldering the second wire. If you use heat shrink tubing to insulate the slice, remember to cut it to length and thread the wire through before soldering the wires together... \$\endgroup\$
    – MarkU
    Commented Oct 10, 2014 at 9:50
  • \$\begingroup\$ @MarkU Thanks for the advice! So I'm guessing it is in fact, possible? Anyway, is there a way to test it without a DVM? I don't currently have one (but I can get one if necessary). If I do need to get one, how exactly should I test it? xD \$\endgroup\$
    – Aaa
    Commented Oct 11, 2014 at 19:54
  • \$\begingroup\$ Yes, a DVM is required; I'll post an answer with more details. \$\endgroup\$
    – MarkU
    Commented Oct 12, 2014 at 3:18

1 Answer 1


Splicing a power cord to effectively get a different connector is possible. This doesn't change the voltage or available supply current, it just changes the physical connector. Starting with a working wall transformer power supply that has the wrong type of connector, the goal is to remove the old connector and splice on a different connector.

This assumes that you have some basic electronics tools and experience:

  • soldering iron for electronics
  • wire cutter
  • wire stripper
  • needlenose pliers
  • Digital voltmeter (DVM)
  • optional: butane micro torch or butane lighter

And some electronics supplies:

  • solder
  • heat shrink tubing

Step 1. Plug in the power, and use the DVM to check that the power supply is working. There's no point in doing all this wiring only to find the power supply is dead. Wall transformers normally are marked with the output power and voltage rating. With no load, the measured voltage may be a slightly higher than the nominal rating. For safety I assume the voltage is less than 50V DC and less than 10V AC. If you see higher voltage than this, or if you feel a tingling or a shock, STOP.

Step 2. Unplug the transformer, then use the wire cutters to cut the cable. If you think you're likely to reuse the connector, you might make the cut about halfway along the length -- but if you're going to discard the original connector, then make the cut as far away as you can to save the maximum power cord length.

Step 3. With the power cord cut open, take a look at how the cable is constructed. Separate about an inch or two of the the two wire ends, then strip about 1/4 inch of the insulation off the end. Most likely each of the wires is made of several strands of copper, twisted together. Be sure to keep each conductor's strands twisted the same way.

Step 4. Plug in the power again, and measure the exposed wires with the DVM in volts mode. This is how you will determine which wire is the positive (+) and which is the negative (-). If these connections are swapped, the device may be permanently damaged. Make sure you can tell which wire is which -- hopefully they have different colored insulation. Red=(+), Black=(-) is commonly used, but you can't assume. If you can't distinguish the wires without the DVM, use some tape to mark the wires so they don't get mixed up.

Step 5. Unplug the transformer, and prepare the new connector. If the new connector is already attached to another power cable, make sure the wires are cut and stripped.

Step 6. Check the load requirement. There should be a label describing whether the power connector is center-positive or center-negative. Unfortunately barrel connectors are not really standardized, you need to check.

Step 7. Use the DVM in continuity mode (or ohms or diode check). One lead on the new connector's center contact, and use the other lead to find which of the wires connects to the center. Again, mark it with tape if you can't distinguish the wires. Just to be sure, check the other wire as well, just in case there's a bad connection.

Step 8. Match up the wires on the power supply side and the new connector side. You will need to make sure the new connector's center contact connects to the power supply's positive or negative supply, depending on the requirement established in step 6. Cut a length of the heat-shrink tubing, about 1/2 inch, and slide it over each end of the power supply wire. Then solder the new connector's wire to the power supply's wire (lap joint splice). Then do the same thing with the other pair of wires.

Step 9. Check your work: plug in the power again (being careful to keep the exposed splices apart), use the DVM in volts mode to verify the power supply still works and the power delivered to the new connector is the right polarity. If it's backwards, you can unplug the transformer, go back and re-do step 8 with the wires switched around right.

Step 10. Unplug the transformer, and slide the heat-shrink tubing over the wire splices. If you have a butane lighter or a small butane torch, that would be the ideal tool for heating and shrinking the tubing -- but it can also be done by contacting the barrel of the soldering iron to the tubing. Don't contact the tip of the iron, just the barrel. And don't stay very long in any one spot, the idea is to try to heat the surface of the tubing evenly until it conforms to the shape of the splice.

There's a lot of variations on this basic technique.

The new connector could be wired directly to the exposed wire ends of the power supply cable. Usually a connector includes some housing or mechanical strain relief, to prevent the end of the wire from breaking off when the cable pulls and flexes in normal use.

Heat-shrink tubing can shrink down to about half of its initial diameter. If the connector is fairly close to the diameter of the power cable, you can fit a large diameter piece of heat shrink tubing over the spliced area after you're done -- but it's better to plan ahead and get the cut length of heat shrink tubing in place before making the splices. Heat shrink tubing is good for insulating the splices and also provides good mechanical strain relief.

There are solderless connectors such as crimp wire connectors, but these don't work quite as well for smaller diameter stranded wires such as you're likely to have in a typical wall transformer power supply. Crimp connectors also require a special crimping tool; pliers can sometimes work but not always reliably.

  • \$\begingroup\$ Thanks for all the helpful information! This will come in useful. One more thing before I try this: I'm not actually splicing a power adapter, I'm splicing a male port to a female port to make an extension cord (and to buy an adapter for the new size on the other end). Does this change anything? I almost don't see how I can check the polarity with only wires (and without an adapter). \$\endgroup\$
    – Aaa
    Commented Oct 12, 2014 at 15:21
  • \$\begingroup\$ I guess you could use the DVM in ohms mode to verify that the center contracts of your extension cords are connected thru... but somehow you have to make sure that the device gets powered correctly. \$\endgroup\$
    – MarkU
    Commented Oct 13, 2014 at 2:24
  • \$\begingroup\$ I managed to figure it out! I ended up connecting the old DC adapter to the male end of the extension cord, and plugged that into the female end of the extension cord. Using this, I was able to find the polarity and connect the black wire to negative and the red wire to positive. (Here I assumed they color coded the wires correctly, I would be extremely surprised if they didn't.) It is now happily sitting in the corner charging my phone. :D Thanks for the help! \$\endgroup\$
    – Aaa
    Commented Oct 14, 2014 at 5:20
  • \$\begingroup\$ Great, glad to help. \$\endgroup\$
    – MarkU
    Commented Oct 14, 2014 at 5:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.