Homemade charger for ipad. What do we need? Pinout of USB connectors on the plug

Sent by:

Victor Pankov sent an interesting link to an article that describes in detail the pinout features of USB connectors for correct charging various gadgets, after all, it’s no secret that gadgets often refuse to charge simple USB drive or computer port, or do not behave as expected.

Majority modern gadgets (mobile phones, smartphones, players, e-books, tablets, etc.) supports charging via a USB mini/micro socket. There may be several connection options:

The device can be charged from a PC via a standard data cable. Usually this is a USB_AM-USB_BM_mini/micro cable. If a device requires more than 0.5 A of current to charge (this is the maximum that USB 2.0 is capable of), then the charging time can be painfully long, even indefinitely. The USB 3.0 port (the blue one) already produces 0.9 A, but this may not seem enough to some.

Using the same data cable, your device can be charged from a native charger (mains or car) equipped with a 4-pin USB-AF socket, like on a computer. Of course, this is no longer a real USB port. The charger socket only outputs approximately 5V between pins 1 and 4 of the 4-pin socket (plus on pin #1, minus on pin #4). Well, still in between different contacts All kinds of jumpers and resistors can be installed in the sockets. For what? This witchcraft will be discussed below.

The gadget can be connected to a third-party or homemade charger that provides 5 volts. And this is where the fun begins...

If you try to charge from someone else's charger with USB output your gadget may refuse to charge under the pretext that Charger supposedly doesn't suit him. The answer is that many phones/smartphones “look” at how the Data+ and Data- wires are connected, and if the gadget doesn’t like something, the charger will be rejected.

Nokia, Philips, LG, Samsung, HTC and many other phones will only recognize the charger if the Data+ and Data- pins (2nd and 3rd) are shorted. You can short them in the USB_AF socket of the charger and easily charge your phone via a standard data cable.

If the charger already has an output cord (instead of an output jack), and you need to solder a mini/micro USB plug to it, then do not forget to connect pins 2 and 3 in the mini/micro USB itself. In this case, you solder the plus to 1 contact, and the minus to the 5th (last).

U iPhones In general, there are some occult requirements for switching the charger socket: the Data+ (2) and Data- (3) contacts must be connected to the GND contact (4) through 49.9 kΩ resistors, and to the +5V contact through 75 kΩ resistors.

Motorola“requires” a 200 kOhm resistor between pins 4 and 5 of the USB micro-BM plug. Without a resistor, the device does not charge until it is completely charged.

To charge Samsung Galaxy The USB micro-BM plug must have a 200 kOhm resistor between pins 4 and 5 and a jumper between pins 2 and 3.

For a more complete and “humane” charge of the tablet Samsung Galaxy Tab recommend another circuit: two resistors: 33 kOhm between +5 and jumper D-D+; 10 kOhm between GND and jumper D-D+.

Apparatus E-ten(“Raccoon”) is not interested in the state of these contacts, and will support even a simple charger. But he has an interesting requirement for charging cable- “Raccoon” charges only if pins 4 and 5 are short-circuited in the mini-USB plug.

If you don't want to bother with a soldering iron, you can buy USB-OTG cable- in his mini-USB plug, contacts 4 and 5 are already closed. But then you will still need USB adapter AM-AM, that is, “dad” - “dad”.

The Ginzzu GR-4415U car charger and its analogues, which claim to be universal, are equipped with two output sockets: “HTC/Samsung” and “Apple” or “iPhone”. The pinout of these sockets is shown below.

For power or charge Garmin navigator A special data cable is required. Just to power the navigator via a data cable, you need to short-circuit pins 4 and 5 in the mini-USB plug. To recharge, you need to connect pins 4 and 5 through an 18 kOhm resistor:

So, if you want to convert a regular charger into a USB charger for your phone:

Make sure the device produces approximately 5 volts DC voltage

Find out if this charger is capable of delivering a current of at least 500 mA

Enter necessary changes to connect the USB-AF socket or USB-mini/micro plug

The inner world of a complex accessory.

A real scourge for iOS device owners is Lightning cables. There are many of them, they are different, but you can’t choose all of them.

Let's look at the structure of this seemingly simple accessory with a whole arsenal of secrets.

In bondage to Lightning

Apple has never been shy about unilaterally come up with standards and transfer your users to them.

While manufacturers mobile devices last ten years confidently sat on the type of charging sockets DC with a wide variety of plug diameters, for your players iPod Apple chose the interface FireWire.

Apple met the smooth transition of thousands of brands producing smartphones to miniUSB with a unique 30-pin port in the first iPhone.

Now the “single standard” in the world mobile gadgets the connector remains microUSB with the prospect of replacement by USB Type-C . In the meantime, I registered on iOS devices Lightning, and for a long time at that.

Find the charging cable " regular smartphone" very easy. But Lightning – not so much. Therefore, it is common among owners of Apple equipment to take it with them.

The niche of “spare”, consumable, travel cables for iPhone and iPad was promptly closed Chinese. There’s just one “but”: it’s not so easy to fake them.

What's inside Lightning and why the original is expensive

It is possible to understand why Apple remains a company whose accessories sometimes seem unreasonably high only after a technical opening procedure.

Note: we breathe evenly to Samsung. Just a comparison of the South Korean and American manufacturers.

Here are two original accessories for smartphones from companies that have been the main competitors in the mobile device market for several years now. The cost of cable from Samsung is in the area 500 rubles. An original Lightning cable for iOS devices will cost 1590 rubles, 3 times more expensive.

Let's take out a scalpel and try to figure out what is the reason for such a difference in price. I’ll say right away that Samsung plastic is cut very easily. And take the clip in Lightning " with bare hands» not so simple - provided powerful protection from penetration.

We get to the insides and observe.

The best board option you can find in microUSB looks like this:

In the worst case (and it will really be an original cable, but from a different manufacturer), you won’t even see a voltage rectifier. Just four multi-colored wires with braided shielding (which is also often saved on).

After the torment of disassembling the original Lightning cord, we are greeted with this “inner world”:

And a larger shot of the miniature board:

Lightning hidden inside full microcomputer, which not only analyzes the entire process of charging an iOS device, but also makes it easier for the user to operate the accessory.

And if before today you looked at the cost in bewilderment original cable Lightning - Now you know it's all about the components and quality.

What happens inside Lightning and how it works

Underneath the protective metal cover of the Lightning plug is the circuit shown above. Of course, now we are talking about the original, and the problem Chinese consumer goods Let's touch on it a little below.

The board has four chips and several auxiliary ones. computing devices, responsible for transferring data to the computer and using a cable for a Data connection. After iPhone connections to the charger, curious processes come to life inside this circuit.

The inner world of one of the chips

Two of the presented chips are very simple in design and consist of only a few transistors, whose task is to convert the incoming signal electric current into a state that is maximally adapted to the battery installed in the smartphone.

Another chip with markings NXP NX20P3 provides control over the level of the current state of the battery, calculating the accumulated useful amount of charge.

The microprocessor installed in the cable helps determine which side you insert the cable into the device connector.

The standard Lightning cable wiring looks like this:

And this is where the Apple magic works. You don't have to think about which end to install the plug. The above-mentioned microprocessor and the asymmetrical placement of contacts are responsible for this.

Those. As long as you insert the cord, the filling automatically determines which contacts to supply voltage to.

All these technologies are accompanied by dozens of patents owned by Apple. But there are no limits to Chinese ingenuity: cables are counterfeited with varying degrees of precision and quality, and they don’t care about complying with the law.

Therefore, Apple provided protection for its accessories and developed its own certification standard MFI(Made for iPhone/iPad/iPod), and limit the connection of low-grade Lightning cables They decided to use another, fourth chip installed on the same miniature board of the original cord.

American Firewall against Chinese Lightning counterfeits

A chip with a number that is hated by third-party accessory manufacturers BQ2025. Without exaggeration, it can be called a “pass” to the depths of the Lightning socket in the iPhone.

If on non-original cable There is no such chip, the iOS device shows the following window:

At this point, the “under-cord” can actually be thrown away: it will not adequately (or at all) charge the device and will not allow data synchronization.

Important: Why does the message “This accessory or cable is not certified” appear?

The BQ2025 chip has a special dedicated digital block permanent memory , for the manufacture of which semiconductors are used. His name - EEPROM. A special feature of EEPROM is the ability to rewrite information multiple times (up to a million times).

The memory capacity of the EPROM block is about 64 - 128 bits, but this is quite enough to store the unique key of every accessory in the world for the iOS ecosystem.

This block contains a key that allows you to identify “originality” - compliance with Apple standards and confirmation of official MFI certification. When connected, the key on the accessory is compared to the value base on the iOS device. If one is not found, an error message appears about the impossibility of operation.

Manufacturers of counterfeit cables were partially able to bypass the protection. As an alternative to EEPROM, craft companies use emulator, which is based on microcontroller 8051. He goes around Apple protection, but is not durable, which is why the cable suddenly stops working with iOS.

One of 10 variants of Chinese creativity

Any other company would become a hostage to its own technology. Think for yourself. On the one hand, Apple can at any time begin producing smartphones that will only be compatible with original cables. On the other hand, there will be real chaos on the accessories market, and those already purchased by users original Lightning will become incompatible with the new generation of devices.

So it's good that Apple is doing everything in portions. The EEPROM memory area is easily overwritten during the next iOS updates through iTunes applications. And very often, precisely after flashing, Chinese Lightning refuses to work.

Add to this the DRM protection of multimedia files that the company so supports, and you can forget about the compatibility of non-certified accessories for displaying images and relaying music through the Lightning port.

Another problem that prevents anyone from starting the production of accessories is the inaccessibility and high cost of circuits. Remember the chip described above NXP NX20P3? The price of his scheme on the black market is $2,500!

And to start production, one circuit will clearly not be enough.

Why fake Lightning is dangerous

Apple designed the key system for a reason. In addition to income, we also thought about our reputation.

Have you often heard about exploding smartphones, bursting screens, leaking batteries and electric shocks when connecting to a charger on Android devices? There are a lot of such cases, they don’t even pay attention. There are only a few such situations in Apple technology, and each one causes a flurry of attention:

The main question is what accessory the victims used. In both cases - unoriginal. Do you understand now why this is so important?


Where and who, I believe, is clear without words

We need to look at the root of the problem. Before purchasing a low-quality lace from a Chinese website, think about the consequences. Using a non-original Lightning cable may cause:

  • It quickly becomes unusable. The braid cracks and the plug appears to play.
  • Complete loss of compatibility after the update, described above. The result is money down the drain.
  • It's good if the iPhone just won't turn on. In the worst case, it could catch fire or explode from overheating. And, God forbid, during a conversation while connected to the network.
  • The lifespan of the original cable is many times longer than the fake one. Saving? It only seems so, over time the cost of maintaining the “ecosystem” Chinese cables exceeds that of the original ones.

In short, the original is worth it. And even if for some reason you don’t want to buy a cable specifically from Apple, you can always find a certified, high-quality alternative. Sometimes even with an interesting “trick”.

Most modern mobile phones, smartphones, tablets and other wearable gadgets support charging through the socket USB mini-USB or micro-USB. True to uniform standard It’s still a long way off and each company is trying to do the pinout in its own way. Probably they should buy the charger from her. It’s good that the USB plug and socket itself were made standard, as well as the supply voltage of 5 volts. So, having any charger adapter, you can theoretically charge any smartphone. How? and read on.

Pinout of USB connectors for Nokia, Philips, LG, Samsung, HTC

Brands Nokia, Philips, LG, Samsung, HTC and many other phones will recognize the charger only if the Data+ and Data- pins (2nd and 3rd) are shorted. You can short them in the USB_AF socket of the charger and easily charge your phone via a standard data cable.

Pinout of USB connectors on the plug

If the charger already has an output cord (instead of an output jack), and you need to solder a mini-USB or micro-USB plug to it, then you do not need to connect pins 2 and 3 in the mini/micro USB itself. In this case, you solder the plus to 1 contact, and the minus to the 5th (last).

Pinout of USB connectors for iPhone

For iPhones, the Data+ (2) and Data- (3) contacts should be connected to the GND (4) contact through 50 kOhm resistors, and to the +5V contact through 75 kOhm resistors.

Samsung Galaxy charging connector pinout

To charge the Samsung Galaxy, a 200 kOhm resistor must be installed in the USB micro-BM plug between pins 4 and 5 and a jumper between pins 2 and 3.

Pinout of USB connectors for Garmin navigator

A special data cable is required to power or charge your Garmin navigator. Just to power the navigator via cable, you need to short-circuit pins 4 and 5 of the mini-USB plug. To recharge, you need to connect pins 4 and 5 through an 18 kOhm resistor.

Pinout diagrams for charging tablets

Almost anyone tablet computer charging requires a large current - 2 times more than a smartphone, and charging through the mini/micro-USB socket in many tablets is simply not provided by the manufacturer. After all, even USB 3.0 will not provide more than 0.9 amperes. Therefore, a separate nest (often round type) is placed. But it can also be adapted to a powerful USB power source if you solder an adapter like this.

Pinout of the charging socket of the Samsung Galaxy Tab tablet

For the correct charge Samsung tablet Galaxy Tab recommend a different scheme: two resistors: 33 kOhm between +5 and jumper D-D+; 10 kOhm between GND and jumper D-D+.

Pinout of charging port connectors

Here are some voltage diagrams for USB contacts indicating the values ​​of the resistors that allow these voltages to be obtained. Where a resistance of 200 Ohms is indicated, you need to install a jumper whose resistance should not exceed this value.

Charger port classification

  • SDP(Standard Downstream Ports) – data exchange and charging, allows current up to 0.5 A.
  • CDP(Charging Downstream Ports) – data exchange and charging, allows current up to 1.5 A; hardware identification of the port type (enumeration) is performed before the gadget connects the data lines (D- and D+) to its USB transceiver.
  • DCP(Dedicated Charging Ports) - charging only, allows current up to 1.5 A.
  • ACA(Accessory Charger Adapter) – PD-OTG operation is declared in Host mode(with connection to PD peripherals - USB-Hub, mouse, keyboard, HDD and with the ability additional food), for some devices – with the ability to charge PD during an OTG session.

How to remake a plug with your own hands

Now you have a pinout diagram for all popular smartphones and tablets, so if you have the skill to work with a soldering iron, there will be no problems converting any standard USB connector to the type your device needs. Any standard charge that is based on using USB, involves the use of only two wires - +5V and a common (negative) contact.

Just take any 220V/5V charging adapter and cut off the USB connector from it. The cut end is completely freed from the shield while the remaining four wires are stripped and tinned. Now take the cable with the connector USB of the desired type, after which we also cut off the excess from it and carry out the same procedure. Now all that remains is to simply solder the wires together according to the diagram, after which each connection is insulated separately. The resulting case is wrapped on top with electrical tape or tape. You can fill it with hot glue - also a normal option.

Bonus: all other connectors (sockets) for mobile phones and their pinouts are available in a single big table — .

In the iPhone 3GS, the battery charge control is controlled by the 338S0533-AE chip. Photo taken from ifixit.com.

Main fragment iPhone boards 4S. Orange The power controller is circled - a chip marked 338S0973. Photo taken from ifixit.com.

To all the above features you can also add strange behavior your device when using non-original charger. For example, your iPhone or iPad may take a long time to charge, or, for example, continue to discharge when performing some “heavy” tasks or programs while connected to the network.

And now, actually, the technical part. First in China, and then in Europe, they adopted a standard for chargers for portable equipment USB based. It should not be forgotten that according to the specifications USB port 2.0, it can provide current up to 0.5 A. At the same time, many smartphones and tablets consume more. For example, an iPad can be charged with a current of 2.1 A, how does this happen? In standard USB connector 2.0 type A has 4 contacts, namely a “zero” contact, a power contact and two information ones - D+ and D-. It is D+ and D- that are used in modern devices to identify the charger, after which the gadget’s power controller will switch to “fast” or “slow” charging mode. IN general case, there is a standard that describes how devices interact with the USB bus for charging purposes, including a standard for communicating with a computer's USB port, through which devices "negotiate" a maximum current. But let's return to inexpensive AC or car (DC) chargers. In the case of the simplest and most inexpensive (or simply old), only the power contacts are routed inside the power source. In this case, the charging device cannot determine the type of charger, and, for safety reasons, goes into mode slow charging. You may have observed that from car charging Does the phone you bought on the market charge more slowly? Sometimes, with high consumption (for example, when navigating using online maps), it happens that the battery of an Android smartphone is discharged, even when it is plugged into the charger :) The reason is that Android is ready to burn out the battery in 5 minutes. The reason is not that charging "can't give more current”, but that the gadget itself “doesn’t take anymore.” And in order for the phone to “take more”, it must be sure that it can do this. To do this, in branded chargers, the central contacts D- and D+ are short-circuited to each other. Essentially, a short circuit of contacts D- and D+ is a signal to the phone that it can be charged with a current of up to 850 mA. Almost everyone does this large manufacturers, and as a result, you can be sure that the HTC charger will charge samsung phone or LG. And if you have a charger or portable battery that charges the phone slowly, and you are absolutely sure that the device circuit can provide a current of up to 850 mA with stable voltage and without interference under load, you can carefully disassemble the case and close the central contacts.

Identification schemes for Apple and Sony chargers. Source DMAX14568EMAX/14568AE Datasheet.

But not everyone went this way. There were also those who decided invent and patent a bicycle make your own choice. Such manufacturers include Apple and Sony, which have stuck to their proprietary solutions. The scheme proposed by Apple is more complex for a phone (in fact, there should be two comparators at the input of the phone that compare the voltage at D+ and D- with certain reference levels), but it provides different variants values, and as a result - good compatibility between devices and chargers. So iPad (the mains charger of which is designed for charging current up to 2.1 A) can be charged from an iPhone charger, which is designed for a current of 1 A or even 0.5 A. There will be no overload of the power supply - the gadget will correctly identify the device to which it is connected and switch to one of the slow charge modes. It should be understood that due to the use of a proprietary design, Apple devices may not charge correctly from USB power supplies third party manufacturers(read: cheap Chinese trinkets that flood the underground passages and markets of the capital). Therefore, when purchasing chargers for iPhone, iPad or iPod, you need to pay attention to the packaging. Namely, to the corresponding

Troubleshooting popular iPhone smartphones May be not an easy task due to their built-in batteries. But they can often be the cause of the problem. To determine and correct this issue, a small device was created that can charge the iPhone battery, and there is also the ability to check the battery status, which can be read by a microcontroller or other means. The device consists of 6 battery connector boards (for iPhone 4, 4C, 5, 5C/s, 6, 6+) and the main charging board.

iPhone battery tester circuit

Sometimes batteries show no voltage when tested with a regular multimeter. It is possible that the LiPo cells are actually completely dead, although this usually means that the battery has gone into protection mode. This may be caused for various reasons, including damage to the controller or short circuit. This system can reactivate a battery that has entered protection mode by simply connecting it to the main charging board.

Battery connection boards


iPhone batteries can be connected to the main board via a 6-pin connector with a key to prevent incorrect connection. There is also the option to add additional fees battery connections different types in the future (6c, 6c+, Samsung, etc.).

Charging board


The memory board contains a charging circuit, a microUSB power port and connectors. The MCP73831 chip is lithium charged. . It is designed for 3.7V battery voltage, but can also be used to charge under more high values. Cut-off voltage 4.2 volts. Two LEDs provide charging status indication. There is a 2 A fuse to prevent overcurrent - this protects the microUSB port. The programming resistor (R2) determines the maximum charge current. A value of 2K sets the MCP73831 to a maximum of 500 mA charge current.

Connector pinout

  • VBAT: positive terminal connected directly to battery (and MCP73831 charging output)
  • GND: ground
  • 5V: microUSB connector input
  • GAS: protection contact
  • NTC: battery thermistor
  • STAT: Can be used to read charging status by microcontroller
  • PROG: Can be used to set the charging current or disable charging


Apple, as you know, does not sell spare parts, so the only option is to choose the ones you need yourself. All parts in the diagram are common and should be available in most major shopping internet platforms.