1
\$\begingroup\$

I am trying to power up my raspberry pi 3 with a Xiaomi 10000mAh fast charging power bank through the L298N motor controller. The motor controller can receive from 7 to 35V, and it has a 5v output, which I use to power my pi through the 5V pin. I also use a USB 2.0 to TTL UART Module 6Pin Serial Converter (https://www.aliexpress.com/item/CP2102-USB-2-0-to-TTL-UART-Module-6Pin-Serial-Converter-STC-Replace-FT232-Module/32534146426.html).

I read a bit about fast charging and how they control the voltage, and this is how the charger decides what voltage to output using the d+ and d- pin: http://4.bp.blogspot.com/-nMZFNxoTcA0/VHX8GRZCLFI/AAAAAAAAAXA/VCn0OxdThAM/s1600/USBVoltage.jpg

The first problem is that the usb converter doesn't have the D+ and D-, but I believe it should be the RXD and TXD pin. I want my power bank to output 9V to the motor controller so I tried plugging a 3.3V to the 0.6V to the RXD and TXD (tried both way) but it doesn't change the output voltage. The second problem is that if I just plug the power bank to the motor controller, which it will automatically output 5V, it doesn't turn on the Pi.

I am new to these kinds of stuff so any suggestion on how to do this will be really helpful. Thank you.

\$\endgroup\$
  • \$\begingroup\$ I looked at xiaomi's website. their 10000mAh power bank has two versions: regular version(5V only) and pro version (QC 2.0). If you are expecting 9V, you first make sure you bought the right thing. Also, why not use the 5V directly? 2A@5V not enough for a pi? Also motor drive is for driving motors, not digital logic, at least buy a proper DC/DC converter! \$\endgroup\$ – user3528438 May 21 '17 at 23:24
  • \$\begingroup\$ Fast charging is about providing more CURRENT - not voltage. Odds are if you try to provide much more than 5V in a USB voltage level; system you will destroy something. | The blogspot reference is either re a specific product or just made up. This would be an immensely unusual arrangement. A reference to the text accompanying that diagram MAY help, but probably not. | Most 5V output power banks may be able to be modified to allow a small range of Vout variation BUT usually only minimal variation wry 5V. \$\endgroup\$ – Russell McMahon May 22 '17 at 0:32
  • \$\begingroup\$ There are many products available which are designed to do what you want. IF anything you have IS intended to be used this way then a link to a competent datasheet would help greatly. \$\endgroup\$ – Russell McMahon May 22 '17 at 0:32
  • \$\begingroup\$ @RussellMcMahon Not always. Qualcomm Quick Charge as well as the non-proprietary USB Power Delivery both support increased voltage for faster charging without needing cables that can support high currents. I believe Qualcomm's QC goes up to 9V, and USB PD to 12 or maybe 20, but I don't remember exactly. \$\endgroup\$ – Hearth May 22 '17 at 3:07
  • \$\begingroup\$ @Felthry As above " ... There are many products available which are designed to do what you want. IF anything you have IS intended to be used this way then a link to a competent datasheet would help greatly. ..." -> What you say is essentially true, and/but what I say above is also essentially true. Win/win :-). Here is a reasonably good Qualcom quick charge overview. Essentially QC allows the device battery to be charged at the maximum rate allowed by the battery manufacturer. For (and ONLY for) devices designed to handle this system ... \$\endgroup\$ – Russell McMahon May 22 '17 at 7:35
2
\$\begingroup\$

Let me first to sort out your project architecture.

  1. You want to use a powerbank that has QC capability.
  2. You want to use a L298N motor controller board as a secondary power supply, to convert input (9V preferrable) into 5 V, to power your Raspberry Pi controller board.
  3. You are using USB-to-UART converter to get Rx/Tx interface (apparently to control the motor controller), from RPi USB port. Not sure why you are going through the extra bridge while Rpi has its own native UART.

So, you want to connect the Powerbank to L298N, and force PB to output 9 V, then the L298M will do whatever it is supposed to do, including 5 V power conversion to your RPi. In this configuration USB (nor Rx/TX) has nothing to do with the powerbank.

To get 9 V out of QC2.0 powerbank, you would need to make a special board between the PowerBank and L298N board emulating a Qualcomm QuickCharge capable device. This board must have a USB receptacle with D+ and D-, and it should provide QuickCharge handshake to the PowerBank. Keep in mind that the QC will not only sense certain combination of DC voltages on D+ and D- as your reference picture shows (it would be too easy to accidentally invoke higher voltages), but there should be some preliminary signaling on D+D- wires, with certain timing. The details of QC protocol are not publicly disclosed, but you can search for ICs that provide the QC functionality, they will have some practical details on what a QC needs.

EXAMPLE (from TPS61088 datasheet and CHY100 datasheet)

  1. A method to Enter QC2.0 According the description in the CHY100 datasheet, the processes to enter QC2.0 are:

− Apply a voltage between 0.325 V and 2 V to D+ for at least 1.25 seconds

− Discharge the D- voltage below 0.325 V for at least 1ms while keep the D+ voltage above 0.325 V

− Apply the voltage levels in Table 3 to set the output voltage. (must keep the D+ voltage above 0.325 V)

Good luck.

\$\endgroup\$
0
\$\begingroup\$

The Quick Charge system is controlled by voltages applied to D+ and D- in a timed manner.
Just applying the voltages alone will not (or shouldn't) trigger the higher voltage modes.

I have provided two reference links below.
The TI one provides all the information you need for QC 2.0 mode.
I do not have information of the later 3 & 4 versions but they are liable to be similaqr and information will be aqvailable on web.

The system can minimise current by increasing voltage either at 5V or at 9v or 12V for class A devices and also at 20V for class B. Downconversion of voltage where needed (as is usually the case with smartphones and tablets) is handled within the device.

A data sheet for a CHY100 Quick Charge 2.0 compatible charger IC provides the (dangerously crude IMO) protocol for voltage negotiation on the rhs of page3 and a typical charger circuit diagram on lhs of page 3.

Here is A useful 17 page TI charger app note wity voltage control described on pages 6 & 7.

OnSemi mode 3 charger control IC

Google "recommend" don't use QC - USE USB 3 PD.

\$\endgroup\$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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