1

I'm trying to tackle a problem where I want to wall-mount a USB device on a brick wall that only has a single 2-wire (14AWG) cable available, and no room / capability to run a new cable or remove the current one (have tried both - it's an old house, who knows what is happening in the wall...)

I plan to plug a 240 V AC (Aus) to 5 V DC transformer (can be another transformer - the cable is NOT rated for 240 VAC however) in the roof space, and connect it to the cable. The other end of the cable comes out of a small hole in the wall (probably around 70mm high x 50mm wide x 30mm deep that I can put a small circuit board into.

The problem is that, as I am sure everyone here knows, you can't charge a modern USB device (based on my tests) using just 2 wires, a USB cable for charging these devices has 4 wires, it needs "something" on the two data (+/-) cables.

It is that "something" that I want to put in the wall, where there is limited space. I assume that this will be some sort of circuit that convinces devices that they are OK to charge, simulating (??) the communication that would normally happen on the 2 data wires inside a USB cable, effectively a very small DC-to-DC USB charger.

Is there anything off-the-shelf that can be bought to go from 2-wire to a (4-wire) female USB Type-A plug that allows the device to receive power? I'm also happy to put something together myself if anyone can point me at a circuit diagram :-)

Thanks in advance, hope all that made sense!

ocrdu
  • 8,705
  • 21
  • 30
  • 42
Dominik
  • 119
  • 3
  • 2
    Is there a reason you’re not bringing AC directly to that space and just add a regular USB charger with the relevant cable? Also, how long is the cable? – jcaron Nov 30 '20 at 12:06
  • This is a prohibited question about the *usage* of an iPad. If you could state the iPads technical requirement with accuracy in your question (the "something"), then implementing that could be on topic. But asking what the iPads requirement is, or what you can buy, is not. You can't "design" it until you have the interface requirement sorted out. – Chris Stratton Nov 30 '20 at 13:12
  • 2
    @Chris-Stratton: Isn't that just a tad over-critical? It is not about the usage of an iPad; it's about where to buy OR how to wire up a USB cable so it will charge an iPad. Besides, it's an Apple; the interface requirement could be unsortoutable without experimentation. – ocrdu Nov 30 '20 at 13:45
  • It's exactly about usage of the iPad! This question is asking for the very design requirement detail an allowed question would be required to bring as part of the problem statement. A usage site like ask different might allow it, especially if the focus were strictly on what the asker wants to know, which is how to convince an iPad that it is connected to a charger. – Chris Stratton Nov 30 '20 at 13:58
  • 3
    @Chris-Stratton, no it's not about the usage of an iPad. It could just as easily be about the usage of any other USB device that requires "something" on the positive and negative data lines. I need the circuit information, this is an electronics question. Yes, you are a tad over-critical, I'm a reviewer myself on stack overflow so know how this process works. – Dominik Dec 01 '20 at 21:43
  • 1
    @jcaron, unfortunately it's a brick wall with only a single cable that is not rated for 240VAC, so I can't run power behind the tablet. There is also no access, short of me forcibly removing the attic floor :-) – Dominik Dec 01 '20 at 21:44
  • @Chris-Stratton I have updated the question, can you (pretty please) allow answers now? – Dominik Dec 01 '20 at 21:48
  • No. Your edit does nothing to fix the problem identified above, which is that you cannot design such a circuit until you identify the design requirement, which is to say, what the ipad expects. If you can state exactly what the ipad expects of the charger, then perhaps some detail of its design would be on topic. But once you know exactly what the ipad expects, chances are you already know how to accomplish that. Determining the expectations of an ipad is not on topic here, as that is a question about ipads, not a circuit design question. – Chris Stratton Dec 01 '20 at 21:56
  • 7
    @Chris-Stratton That is a bit strange, how can I know what that iPad expects when I am asking a question about what any (including iPad) USB device expects on those lines? How am I meant to answer my own question? This seems a bit ridiculous, if I knew what it expected I would either not ask the question or just "do it" – Dominik Dec 01 '20 at 21:59
  • 4
    OK, I have re-phrased the question, have removed all references to iPads, it's now about creating a USB charger from 2-wire DC. How's that? Also, it would help for you to guide me as the the "where", if you know, this question would be more relevant. I am finding this whole process very unhelpful, for a site that is supposed to help people like me I find it counter-productive. Certainly not how I approach moderation on SO, but I guess each person is very different. – Dominik Dec 01 '20 at 22:06
  • Now it's too broad to be answerable, because these devices don't all have the same expectations. As for where you might get help, I've not once but rather twice named the stack exchange site that covers ipad usage questions... – Chris Stratton Dec 01 '20 at 22:07
  • 4
    So me asking how do I go from 2 wire DC (5V or other) to 4-Wire USB Type-A female with all 4 wires connected is too broad? Interesting, does smell a little of playing games IMHO, but I'll play along. How do you recommend making the question more specific, without mentioning iPads which is of course, very incorrect in this forum... – Dominik Dec 01 '20 at 22:09
  • It seems you really aren't reading what is being written, as I've repeatedly explained that devices have differing requirements for this, and that questions seeking knowledge of the requirements of consumer products are not on topic here. If you can state the specific requirement your device has for signalling from the charger, then and only then can we help you. But identify that is not a question for there. I've twice suggested where you *could* ask that question about your ipad. – Chris Stratton Dec 01 '20 at 22:10
  • 1
    Please provide the location of where I should move this question. I have been through the forum, have found a bunch of very, very similar questions, and they were not closed and have answers, so perhaps some double standards? I am happy to be guided by a moderator such as yourself, but your comments provide little guidance I'm afraid, they are actually just wasting my time. – Dominik Dec 01 '20 at 22:14
  • 4
    I'm sorry, I'm escalating at this point. It's not an iPad question. I have other devices I wish to power in this manner. Bye. – Dominik Dec 01 '20 at 22:15
  • Not a specialist when it comes to home wiring, but 14 AWG seems like more than enough for 240V AC to carry a few watts, especially if you put an appropriate breaker at the other end. But that would probably a question for https://diy.stackexchange.com – jcaron Dec 02 '20 at 00:53
  • "The problem is that, as I am sure everyone here knows, you can't charge a modern usb device (based on my tests) using just 2 wires" is that true for any USB device or do you have any specific device in mind? As far I know most android phones (samsung) charge without the data lines – user13267 Dec 02 '20 at 03:04
  • @user13267 no, pretty much no quality phone will charge at more than the USB limit of 500 mA (or just a little higher) without determining it is connected to a charger and not a USB port, and that may not be enough to run an ipad continuously with the screen on. The problem is that _how_ they detect this is vendor specific, and Apple in particular (original form of the question) tends to play their own game. The generalities of these device behaviors are widely known, but their technical specifics are not really on topic _here_ as they are details of consumer products, not design questions. – Chris Stratton Dec 02 '20 at 05:08
  • I didn't read this article in detail but may be some parts of it are helpful: https://batteryuniversity.com/learn/article/charging_from_a_usb_port – user13267 Dec 02 '20 at 05:46
  • "To activate the DCP, the D- and D+ pins are internally connected by a resistor of 200 ohms or less. This distinguishes the DCP from the original USB ports that carry data." May be look more into this part of the article – user13267 Dec 02 '20 at 05:47
  • 1
    @Dominik Please read the help center on guidelines for questions this one is off topic – Voltage Spike Dec 02 '20 at 05:51
  • Others had closed this question. I reopened it and then reclosed it. I've added information that is related to the general requirement. – Russell McMahon Dec 02 '20 at 10:26

2 Answers2

3

Yuck, Apple charging.

The configuration of resistors on the data lines you need for this is proprietary (a polite way of saying "customer lock-in") Apple and will not only depend on the type of Apple device (IPhone, IPad, IPod), but also on its generation, and possibly on the phase of the moon at the time of manufacture.

What you want is doable, but I don't know about an off-the-shelf solution you can just connect to the end of your wire.

There are a few articles on the on the interwebs, like here and here, that show different resistor configurations for wiring things up yourself, but you have to be careful to check if they apply for your specific generation of IPad, and test before you install.

You could try, as an experiment, shorting the D+ and D- and otherwise leave them floating, and see how much current, if any, the IPad pulls when charging. If it works, and if the charging current is enough to keep the IPad running when connected to its charger continuously, you're done.

You can probably google the exact required resistors and connections needed to comply with the IPad's demands, but to be honest, I would just get a charger that is known to work well with your IPad and wire that in place, USB cable and all.

ocrdu
  • 8,705
  • 21
  • 30
  • 42
2

There is enough information in the various answers and comments to meet your requirements - either for an Apple charger or for another custom of more general charger that needs special arrangements to enable charging. The following is a quick summary of what's needed to tie things together:

In non standard situations you will often need combinations of components on the data leads or between all 4 leads. Specific requirements are often available from hobbyist articles and the refs provided by others may be enough for your needs. You can feed power via your two wires to the charging point and then construct the 4 wire arrangement at the charge point.

An alternative would be to obtain an in-car charger that worked with the target device(s) of your choice. Then feed it about 12 VDC via two wires. Or you could dismantle a mains based charger, find the point where low voltage DC is produced internally and feed an appropriate voltage in at that point. That requires a certain amount of skill and knowledge and you may need assistance taking that path.

Another possibility (not overly recommended) is to provide a mains to low voltage transformer at the feed end and a low voltage to main transformer at the far end and then run a standard mains charger. This allows lower voltage in the wall wiring - but higher current. You need to be aware of any possible fire hazards and possible regulatory requirements.

Russell McMahon
  • 147,325
  • 18
  • 210
  • 386