Controllable USB bidirectional charge and discharge circuit

CN224697436UActive Publication Date: 2026-08-28CHONGQING MENGXUN ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202522051856.8
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2025-09-24
Publication Date
2026-08-28
Estimated Expiration
2035-09-24

AI Technical Summary

Technical Problem

[0002]当前发电机整机电气化程度持续提高,一键启动、手机APP控制及状态查看等便捷功能已成为主流配置,而这些功能的稳定运行完全依赖于发电机电池供电;但现有技术中,一方面,当电池出现馈电时,需将电池从发电机上拆卸下来才能进行充电,操作繁琐且影响使用效率,尤其对于无手拉启动功能的发电机,电池馈电直接导致其无法启动运行;另一方面,缺乏可根据发电机运行状态灵活控制的充放电机制,无法便捷地为外部设备供电,也不能利用外部电源直接为馈电电池补电,且无法在发电机启动后自动切断电池的外部充电通路、避免充电与发电机自身供电冲突

Benefits of technology

[0012] This invention, through the collaborative design of a control unit, a power management chip, a generator and battery power sampling circuit, a power on/off control circuit, a buck-boost conversion circuit, and dual USB interfaces, can achieve both protocol adaptation of the USB-C and USB-A interfaces via the power management chip and the buck-boost conversion circuit, enabling the battery to discharge to external devices when the generator is not running and the external power supply to the battery via the USB-C interface, thus solving the power supply problem without removing the battery. Furthermore, the generator power sampling circuit triggers the control unit to drive the power on/off control circuit, allowing the generator to directly charge the battery after starting, while simultaneously retaining the dual USB interface discharge function and disabling USB-C reverse charging to avoid conflicts. At the same time, the power conversion circuit provides stable power to the control unit and LED indicator circuit, and the battery power sampling circuit works with the control unit to monitor the battery status. Overall, this invention solves the problems of cumbersome battery power supply handling, limited USB interface functionality, and lack of intelligent linkage in traditional generator charging and discharging control, significantly improving ease of use, scenario adaptability, and operational reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN224697436U_ABST
    Figure CN224697436U_ABST
Patent Text Reader

Abstract

The utility model discloses a controllable USB bidirectional charge and discharge circuit relates to the technical field of generator battery charging and other technologies. Power management chip automatic detection USB A interface and USB C interface connect is charging equipment or power receiving equipment. Control unit real -time detection generator starting state and with power management chip communication, when generator has not started, battery passes through the boost and buck conversion circuit, can through USB A interface or USB C interface to power receiving equipment output power, also allow charging equipment to pass through USB C interface, again, the boost and buck conversion circuit is supplied with power to generator battery. When generator starts, the discharge function of two USB mouths is normal use, and the back charge function of USB C interface is closed, and the charging module in generator directly charges the battery. The effect of the utility model: whether generator starts or not, can discharge outward through USB mouth, when the generator battery electric quantity is low, can also utilize external power to charge the battery, avoid the function invalidation of one -key starting of generator, APP control etc. due to battery feeding, and need not to dismantle the battery and carry out the power supply.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This utility model belongs to the field of bidirectional charging and discharging technology, and in particular relates to a controllable USB bidirectional charging and discharging circuit. Background Technology

[0002] With the continuous improvement of the electrification level of generators, convenient functions such as one-button start, mobile APP control, and status monitoring have become mainstream features. The stable operation of these functions relies entirely on generator battery power. However, current technology has several drawbacks. First, when the battery is depleted, it must be removed from the generator for charging, which is cumbersome and inefficient, especially for generators without a manual start function, where a depleted battery directly prevents them from starting. Second, there is a lack of a charging and discharging mechanism that can be flexibly controlled according to the generator's operating status, making it difficult to conveniently power external devices or directly recharge a depleted battery using external power sources. Furthermore, it cannot automatically disconnect the external charging path of the battery after the generator starts, thus avoiding conflicts between charging and the generator's own power supply. These problems result in significant shortcomings in the management and application of generator battery power. Utility Model Content

[0003] To address the problems existing in the background technology, this utility model provides a controllable USB bidirectional charging and discharging circuit, including: a control unit, a power management chip, an LED indicator circuit, a power conversion circuit, a generator power sampling circuit, a battery power sampling circuit, a USB-C interface, a USB-A interface, a power on / off control circuit, and a buck-boost conversion circuit.

[0004] The generator power sampling circuit is connected to the control unit and is used to collect generator power signals;

[0005] The control unit and the power management chip communicate via the I2C protocol;

[0006] The input terminal of the power conversion circuit is connected to the generator power supply and the battery power supply, and is used to convert the input power supply into a stable output power supply to power the control unit and the LED indicator circuit.

[0007] The power supply on / off control circuit is connected between the generator power supply terminal and the battery power supply terminal. Its control terminal is connected to the control unit and is used to control the on / off connection between the generator power supply terminal and the battery power supply terminal according to the generator power supply signal.

[0008] The battery power sampling circuit is connected to the control unit and is used to collect battery power signals; the control unit controls the LEDs to display based on the battery power signals.

[0009] The USB-C and USB-A interfaces are connected to a power management chip. When the USB-C interface is charging or discharging with an external device, protocol adaptation is performed, and the charging voltage or discharging voltage is controlled according to the adaptation protocol. When the USB-A interface is discharging with an external device, protocol adaptation is performed, and the discharging voltage is controlled according to the adaptation protocol.

[0010] One end of the buck-boost converter circuit is connected to a USB-C interface and a USB-A interface, and the other end is connected to a battery power source. Its control terminal is connected to a power management chip; it is used to control the buck-boost converter circuit to perform voltage conversion according to the adapter protocol.

[0011] This utility model has at least the following beneficial effects.

[0012] This invention, through the collaborative design of a control unit, a power management chip, a generator and battery power sampling circuit, a power on / off control circuit, a buck-boost conversion circuit, and dual USB interfaces, can achieve both protocol adaptation of the USB-C and USB-A interfaces via the power management chip and the buck-boost conversion circuit, enabling the battery to discharge to external devices when the generator is not running and the external power supply to the battery via the USB-C interface, thus solving the power supply problem without removing the battery. Furthermore, the generator power sampling circuit triggers the control unit to drive the power on / off control circuit, allowing the generator to directly charge the battery after starting, while simultaneously retaining the dual USB interface discharge function and disabling USB-C reverse charging to avoid conflicts. At the same time, the power conversion circuit provides stable power to the control unit and LED indicator circuit, and the battery power sampling circuit works with the control unit to monitor the battery status. Overall, this invention solves the problems of cumbersome battery power supply handling, limited USB interface functionality, and lack of intelligent linkage in traditional generator charging and discharging control, significantly improving ease of use, scenario adaptability, and operational reliability. Attached Figure Description

[0013] Figure 1 This is a schematic diagram of the overall circuit structure of this utility model;

[0014] Figure 2 This is a schematic diagram of the connection circuit of the control unit in the embodiment;

[0015] Figure 3 This is a schematic diagram of the circuit structure of the LED indicator circuit in the embodiment;

[0016] Figure 4 This is a schematic diagram of the circuit structure of the generator power sampling circuit and the power conversion circuit in the embodiment;

[0017] Figure 5 This is a schematic diagram of the circuit structure of the power on / off control circuit in the embodiment;

[0018] Figure 6This is a schematic diagram of the circuit structure of the temperature sampling circuit in the embodiment;

[0019] Figure 7 This is a schematic diagram of the battery sampling circuit in the embodiment;

[0020] Figure 8 This is a schematic diagram of the connection circuit between the USB-A interface and the USB-C interface in the embodiment;

[0021] Figure 9 This is a schematic diagram of the connection circuit of the power management chip in the embodiment. Detailed Implementation

[0022] The following specific examples illustrate the implementation of this utility model. Those skilled in the art can easily understand other advantages and effects of this utility model from the content disclosed in this specification. This utility model can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this utility model. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this utility model. Unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0023] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the present invention. To better illustrate the embodiments of the present invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0024] In the accompanying drawings of this utility model, the same or similar reference numerals correspond to the same or similar components. In the description of this utility model, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing this utility model and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting this utility model. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0025] Please see Figure 1This utility model provides a controllable USB bidirectional charging and discharging circuit, including: a control unit, a power management chip, an LED indicator circuit, a power conversion circuit, a generator power sampling circuit, a battery power sampling circuit, a USB-C interface, a USB-A interface, a power on / off control circuit, and a buck-boost conversion circuit;

[0026] The generator power sampling circuit is connected to the control unit and is used to collect generator power signals;

[0027] The control unit and the power management chip communicate via the I2C protocol;

[0028] The input terminal of the power conversion circuit is connected to the generator power supply and the battery power supply, and is used to convert the input power supply into a stable output power supply to power the control unit and the LED indicator circuit.

[0029] The power supply on / off control circuit is connected between the generator power supply terminal and the battery power supply terminal. Its control terminal is connected to the control unit and is used to control the on / off connection between the generator power supply terminal and the battery power supply terminal according to the generator power supply signal.

[0030] The battery power sampling circuit is connected to the control unit and is used to collect battery power signals; the control unit controls the LEDs to display based on the battery power signals.

[0031] The USB-C and USB-A interfaces are connected to a power management chip. When the USB-C interface is charging or discharging with an external device, protocol adaptation is performed, and the charging voltage or discharging voltage is controlled according to the adaptation protocol. When the USB-A interface is discharging with an external device, protocol adaptation is performed, and the discharging voltage is controlled according to the adaptation protocol.

[0032] One end of the buck-boost converter circuit is connected to a USB-C interface and a USB-A interface, and the other end is connected to a battery power source. Its control terminal is connected to a power management chip; it is used to control the buck-boost converter circuit to perform voltage conversion according to the adapter protocol.

[0033] Please see Figure 2 In this embodiment, the control unit uses a CW32L010F8U6 microcontroller and the power management chip uses an IP5385 as an example to describe this application in detail. The CW32L010F8U6 microcontroller has 21 pins, namely: PB07 / NRST, PA00-OSC_IN, PA01-OSC_OUT, VSS, VCORE, VDD, PA02, PB00-O32_O, PB01-O32_I, PA03, PA04, PA05, PA06, PA07 / SWDIO, PA08 / SWCLK, PB02, PB03, PB04, PB05, PB06 and EPD.

[0034] The IP5385 power management chip contains 49 pins, namely: VOUT2G, LT, CC3, DPB, DMB, CC4, VIN, VING, VBUS, VBUSG, VBUS_I, VIO, CSP1, CSN1, PCIN, HG1, BST1, LX1, LG1, LG2, LX2, BST2, HG2, PCON, CSN2, CSP2, BAT, VCC5V, AGND, KEY, VCCIO, GPIO5 (INT), GPIO4, HLED (SCL), LED2 (SDA), LED1 (FCAP), NTC, CC2, DPC, DMC, CC1, DMP1, DMA1, VOUT1, VOUT1G, DMP2, DMA2, VOUT2, and EPAD;

[0035] In this embodiment, the control unit (CW32L010F8U6) is responsible for acquiring voltage signals, controlling power supply switching, driving LEDs, and cooperating with the P5385; CW32L010F8U6 microcontroller pin descriptions:

[0036] EPD pin: Ground; PB05 pin: Connects to LED2 (SDA) pin. PB05 pin is also connected to one end of resistor R15. The other end of resistor R15 is connected to MCU_VCC for communication with IP5385 (transmitting charge / discharge commands). R15 ensures the bus is high when idle; PB06 pin: Connects to HLED (SCL) pin. PB06 pin is also connected to one end of resistor R20. The other end of resistor R20 is connected to MCU_VCC for communication with IP5385 (clock synchronization). R20 ensures stable clock edges; PB07 / NRST: Pin connects to one end of resistor R13 and one end of capacitor C33; the other end of resistor R13 is connected to MCU_VCC (MCU_VCC is the power supply terminal of the control unit); the other end of capacitor C33 is grounded. R13 strengthens the internal pull-up, and C33 filters noise to prevent accidental reset; VSS pin: Ground, digital / analog signal reference ground; VCORE pin: Connects to one end of capacitor C22; the other end of capacitor C22... The first pin is grounded, and C22 filters out ripple to ensure stable power supply to the core (CPU / memory); the VDD pin connects one end of capacitor C21, one end of capacitor C20, and MCU_VCC; the other ends of capacitors C21 and C20 are grounded, C20 filters high-frequency noise, and C21 filters low-frequency noise; the PA02 pin connects to the V12_IN_EN terminal (the other end of resistor R23), outputting high and low levels to control the on / off state of NMOS transistor Q11, thereby managing the power supply on / off of the generator and battery; the PA03 pin connects to VIN_INT (one end of capacitor C24), acquiring the voltage divider signal of the generator power supply; the PA04, PA05, and PA06 pins connect to one end of resistors R26, R22, and R19 respectively; the other ends of resistors R26, R22, and R19 are connected to the negative terminals of the three LEDs in the LED indicator circuit, lighting up the corresponding LED when the output is low; resistors R19, R22, and R26 act as current-limiting resistors to prevent the LEDs from burning out due to overcurrent;

[0037] PB02 pin: Connects to VBAT_ADC_CH (one end of resistor R34) to acquire the battery power supply voltage divider signal (divided by R33 / R34); PB03 pin: Connects to ADC_VIN (one end of capacitor C40) to acquire the generator power supply raw signal (directly divided by R38 / R39); PB04 pin: Connects one end of resistor R28 and one end of resistor R21; the other end of resistor R21 is grounded; the other end of resistor R28 is connected to pin LED1 (FCAP), and the LED1 / FCAP status of IP5385 is read through the current-limiting resistor R28; PA07 / SWD IO pins: Debug data lines: used for SWD debug interface data transmission; PA08 / SWCLK pins: Debug clock lines: used for SWD debug interface clock transmission; PB00-O32O pins: unused; PB01-O32_I pins: unused; PA00-OSC_IN pins: external high-speed clock input, unused; PA01-OSC_OUT pins: external high-speed clock output, unused; In this embodiment, the power management chip (IP5385) is responsible for USB protocol processing and power control, adapting to external device protocols, controlling boost / buck conversion, and protecting circuit safety.

[0038] IP5385 Power Management Chip Pin Descriptions: VOUT2G Pin: Floating, not connected; LT Pin: Not used; CC3 Pin: Floating, not connected; DPB Pin: Floating, not connected; DMB Pin: Floating, not connected; CC4 Pin: Connected to one end of pull-down resistor R17, the other end of R17 is grounded; R17 is used for pull-down of CC4 pin and auxiliary protocol detection; VIN Pin: Floating, not connected; VING Pin: Floating, not connected; VBUS Pin: Connects to pins A4, A9, B4, and B9 of the USB_C interface, supporting bidirectional charging and discharging; BVBUSG Pin: Connects to the gate of PMOS transistor Q1. The VBUS_I pin controls Q1 (USB-C switch); the other end of resistor R11 is connected to the drain of PMOS transistor Q1, the drain of PMOS transistor Q2, one end of resistor R10, one end of capacitor C16, one end of capacitor C13, one end of capacitor C14, one end of capacitor C15, and the VIO pin; the other ends of capacitors C16, C13, C14, and C15 are grounded; the CSP1 pin is connected to one end of resistor R10; the NTC pin is connected to the other end of resistor R18; the CSN1 pin is connected to the other end of capacitor C2. The other end; the PCIN pin is connected to the other end of resistor R10; the HG1 pin is connected to the other end of resistor R6; the BST1 pin is connected to the other end of capacitor C4; the LX1 pin is connected to one end of inductor L1; the LG1 pin is connected to the other end of resistor R5; the LG2 pin is connected to the other end of resistor R1; the LX2 pin is connected to the other end of inductor L1; the BST2 pin is connected to the other end of capacitor C3; the HG2 pin is connected to the other end of resistor R2; the PCON pin is connected to the drain of NMOS transistor Q6; the CSN2 pin is connected to the other end of resistor R7; the CSP2 pin is connected to the other end of capacitor C1; the BAT pin... The VCC5V pin is connected to the other end of resistor R9 and the battery power supply terminal; the VCC5V pin is connected to the other end of capacitor C17; the AGND pin is grounded; the KEY pin is left floating and not connected; the VCCIO pin is connected to one end of resistor R12 and VCC_3V3; the other end of resistor R12 is connected to the VOUT2 pin; one end of the GPIO4 pin is connected to one end of resistor R16; the other end of resistor R16 is grounded; the CC2 pin is connected to the B5 pin of USB_C; the DPC pin is connected to the B6 and A6 pins of USB_C; the DMC pin is connected to the B7 and A7 pins of USB_C; the GPIO5 (INT) pin is left floating and not connected; the CC1 pin is connected to the A5 pin of USB_C; the DMP1 pin is connected to the DP (D+) pin of the USB_A interface; the DMA1 pin is connected to the DM (D-) pin of the USB_A interface; the VOUT1 pin is connected to the VBUS pin of the USB_A interface and the source of PMOS transistor Q2; the VOUT1G pin is connected to the gate of PMOS transistor Q2; the EPAD pin is grounded.

[0039] The power management chip (IP5385) is responsible for USB protocol processing and power control, adapting to external device protocols, controlling boost / buck conversion, and protecting circuit safety. VBUS / VBUSG: connects to the USB-C interface and controls Q1 (USB-C switch); VOUT1 / VOUT1G: connects to the USB-A interface and controls Q2 (USB-A switch); HG1 / LG1 / HG2 / LG2: connect to the buck-boost conversion circuit and control the MOSFET switching to achieve voltage conversion; NTC: connects to the temperature sampling circuit to monitor circuit temperature and prevent overheating. Over-temperature protection; SDA / SCL: Communicates with CW32L010, receives commands and provides status feedback; VBUS is the power supply terminal for the USB-C interface, connected to pins A4, A9, B4, and B9 of the USB-C interface; parallel filter capacitors C9 (10μF) and C10 (0.1μF); BVBUSG is the USB-C switch control terminal, connected to the gate of PMOS transistor Q1; VOUT1 is the power supply terminal for the USB-A interface, connected to the VBUS pin of the USB-A interface; parallel filter capacitors C11 (10μF) and C12 (0.1μF) are connected.1μF); VOUT1G serves as the USB-A switch control terminal, connected to the gate of PMOS transistor Q2; CC1 / CC2 are USB-C protocol detection terminals, CC1 is connected to the A5 pin of USB-C; CC2 is connected to the B5 pin of USB-C; CC4 is connected to the pull-down resistor R17 (10kΩ) and grounded. CC1 / CC2: USB-C protocol core pins, detecting the type of external device (charger / load / data line), and determining the current capability by pulling down the resistor; R17: pull-down of the CC4 pin, assisting in protocol detection; DPC / DMC serve as USB-C data communication terminals, DPC is connected to the B6 and A6 pins of USB-C; DMC is connected to the B7 and A7 pins of USB-C. DMP1 / DMA1 serve as the USB-A data communication terminals. DMP1 is connected to the DP (D+) pin of the USB-A connector; DMA1 is connected to the DM (D-) pin of the USB-A connector. HG1 / LG1 serve as the primary control terminals for the boost converter. HG1 is connected to resistor R6 → the gate of NMOS transistor Q4; LG1 is connected to resistor R5 → the gate of NMOS transistor Q5. R5 / R6 are current-limiting resistors, limiting the drive current of the IP5385 output to protect the gate of the NMOS transistor. Q4 / Q5 are the primary switching transistors for the boost converter, alternately turning on / off to control the energy storage and discharge of inductor L1. HG2 / LG2 serve as the secondary control terminals for the boost converter. HG2 is connected to resistor R2 → the gate of NMOS transistor Q6; LG2 is connected to resistor R1 → the gate of NMOS transistor Q6. The gate of MOSFET Q7; R1 / R2: Same as R5 / R6, current limiting protection for the gate of Q6 / Q7; Q6 / Q7: Boost secondary switching transistors, working in conjunction with Q4 / Q5 to further stabilize the output voltage; LX1 / LX2 serve as inductor connection terminals, LX1 is connected to one end of inductor L1; LX2 is connected to the other end of inductor L1; L1: Energy storage inductor, storing battery energy during boost and releasing energy during discharge; similarly during buck, it realizes voltage conversion, and monitors the inductor current through LX1 / LX2 to avoid overcurrent; BST1 / BST2 serve as bootstrap voltage terminals, BST1 is connected to capacitor C4 → bidirectional trigger diode D15 → ground; BST2 is connected to capacitor C3 → bidirectional trigger diode D1 → ground; C3 / C4: Bootstrap capacitor, stores voltage during charging and provides sufficient gate drive voltage for HG1 / HG2 during discharging; D1 / D15: Bidirectional trigger diodes, voltage regulation protection, preventing bootstrap voltage spikes from damaging the IP5385 pins; The NTC pin serves as the temperature sampling terminal, thermistor R18 → capacitor C29 → ground; The other end of R18 is connected to the battery power supply terminal (VBAT+), R18: NTC negative temperature coefficient thermistor (resistance decreases as temperature increases), collecting circuit / battery temperature; C29: Filter capacitor, filters out temperature sampling fluctuations (such as instantaneous heating), preventing IP5385 from misjudging overtemperature; BAT serves as the battery voltage sampling terminal, connected to resistor R9 (10kΩ) → capacitor C1 (0kΩ).1μF) → Battery terminal; the other end of R9 is connected to resistor R7 (20kΩ) → Ground; R7 / R9 are voltage divider resistors; C1 is used for filtering to reduce the impact of battery voltage fluctuations; CSP1 / CSN1 are the primary current sampling terminals, CSP1 is connected to resistor R10 (0.01Ω) → capacitor C2 (0.1μF) → CSN1; the other end of R10 is connected to the drain of Q4; CSN1 is connected to capacitor C2 (one end connected to CSN1, the other end connected to R8), R10: precision sampling resistor, providing feedback on the current signal of the boost primary; C2: filter capacitor, stabilizing the sampling signal and preventing current fluctuations from causing misadjustment of IP5385; PCIN is used as the power control input, connected to resistor R8 (one end connected to PCIN, the other end connected to one end of capacitor C2). The other end of C2 is connected to CSN1; the other end of R8 is also connected to one end of resistor R10, and the other end of R10 is connected to the drain of Q4; R8 / C2: a filter combination, stabilizing the current sampling signal of the PCIN input to avoid noise causing IP5385 misjudgment; R10: a current sampling resistor, providing feedback on the input current of the boost primary, providing a basis for power control; PCON, as the power control output, is connected to the drain of Q6, and also connected to resistor R7 (one end connected to PCON, the other end connected to CSN2); the other end of R7 is connected to capacitor C1 (one end connected to R7, the other end grounded); R7 / C1: a filter combination, stabilizing the control signal output of PCON to ensure accurate switching timing of Q6; Functional positioning: outputting power control signal, adjusting the conduction time of Q6. In addition, it compensates for output voltage fluctuations; LED2 (SDA) serves as the I2C data terminal, connected to the PB05 pin of CW32L010, with a parallel pull-up resistor R15 (one end connected to SDA, the other end connected to the MCU's 3.3V power supply MCU_VCC); SCL (GPIO5 / INT) serves as the I2C clock / interrupt terminal, connected to the PB06 pin of CW32L010; with a parallel pull-up resistor R20 (one end connected to SCL, the other end connected to MCU_VCC); LED1 (FCAP) is the current status indicator terminal, connected to the PB04 pin of CW32L010, with a series resistor R20 (one end connected to LED1, the other end connected to PB04), and a parallel resistor R21 (one end connected to PB04, the other end grounded); LED2 (SDA) serves as the communication status indicator, multiplexed with the SDA pin and the I2C data pin. The communication status is indirectly reflected by fluctuations in the SDA signal. AGND is directly grounded. EPAD is the power ground (exposed pad), with a large grounding area. VCC5V is the internal LDO output, connected in parallel with a filter capacitor C17 (one end connected to VCC5V, the other to ground). C17 stabilizes the output voltage of the IP5385's built-in LDO. VCCIO is the I / O level adapter, connected in series with a resistor R12 (one end connected to VCCIO, the other to the VOUT2 pin); a filter capacitor C19 is also connected in parallel (one end connected to VCCIO, the other to ground). The VOUT2 pin is connected to resistor R12 for auxiliary voltage regulation.

[0040] Preferably, the generator power sampling circuit includes: resistor R25, resistor R27, diode D9, capacitor C24, resistor R38, resistor R39, and capacitor C40; one end of resistor R27, one end of capacitor C24, the cathode of diode D9, and one end of resistor R25 are connected to the first sampling input terminal (PA03 pin) of the control unit; the other end of resistor R25 is connected to the generator power terminal (V12_IN); the other end of resistor R27, the other end of capacitor C24, and the anode of diode D9 are grounded; one end of resistor R38 is connected to the generator power terminal (V12_IN); the other end of resistor R38, one end of resistor R39, and one end of capacitor C40 are connected to the second sampling input terminal (PB03 pin) of the control unit; the other end of resistor R39 and the other end of capacitor C40 are grounded.

[0041] In this embodiment, the generator power sampling circuit includes: resistor R25, resistor R27, diode D9, capacitor C24, resistor R38, resistor R39, and capacitor C40. Resistors R25 and R27 act as voltage divider resistors to reduce the generator voltage (e.g., 12V) to the ADC input range (0~33V) of the CW32L010, preventing damage to the MCU. In this embodiment, the generator power signal is collected separately through dual voltage divider branches. With the filtering effect of capacitors C24 and C40, noise interference in the power signal can be filtered out, ensuring the stability of the sampling signal. Diode D9 can prevent reverse voltage from damaging the control unit. Voltage divider resistors R25 and R27, and R38 and R39 reduce the generator power voltage to a sampling range suitable for the control unit, providing a reliable basis for the control unit to accurately determine whether the generator has started. This ensures the accurate execution of core functions such as the on / off logic of the subsequent power on / off control circuit and the switching of USB interface charging / discharging modes, improving the control reliability of the entire circuit system.

[0042] Preferably, the power conversion circuit includes: diode D6, diode D4, capacitor C30, LDO circuit, capacitor C39, and diode D5; the positive terminal of diode D6 is connected to the battery power terminal (VBAT+); the positive terminal of diode D4 is connected to the generator power terminal (V12_IN); the negative terminals of diode D6 and D4, and one end of capacitor C30 are connected to the input terminal (VIN) of the LDO circuit; the ground terminal (GND) of the LDO circuit, the other end of capacitor C30, and one end of capacitor C39 are grounded; the output terminal (VOUT) of the LDO circuit, the other end of capacitor C39, and the positive terminal of diode D5 are connected to the power terminal (VCC_LED) of the LED indicator circuit; the negative terminal of diode D5 is connected to the power terminal (MCU_VCC, pin VDD) of the control unit.

[0043] In this embodiment, the power conversion circuit uses diodes D4 and D6 to achieve reverse power isolation between the generator power supply and the battery power supply, and can automatically draw power from the generator or battery and serve as backups for each other; capacitors C30 and C39 filter the input and output power supplies respectively, and work with the LDO circuit to convert the unstable input voltage into a stable voltage, providing a continuous and reliable power supply for the control unit and LED indicator circuit; diode D5 further prevents current from flowing back into the control unit, effectively protecting the core control components and ensuring that the entire circuit system can operate stably whether the generator is running or not, providing a solid power guarantee for the realization of functions such as charge and discharge control and status monitoring; in this embodiment, the LDO circuit adopts LDO-SOT-23.

[0044] Preferably, the LED indicator circuit includes: a common anode tri-color LED (D2), which integrates three light-emitting diodes: red (R), green (G), and blue (B), and has a common anode structure; the anodes (COM+) of the three light-emitting diodes are connected to the power supply terminal (VCC_LED) of the LED indicator circuit; the cathodes of the three light-emitting diodes are connected in series with a current-limiting resistor (resistor R19 for red (R), resistor R22 for green (G), and resistor R26 for blue (B)) and then connected to the corresponding control terminals of the control unit (pin PA04 for red (R), pin PA06 for green (G), and pin PA05 for blue (B)).

[0045] In this embodiment, the LED indicator circuit adopts a common anode structure, which simplifies circuit wiring and reduces wiring complexity. The series current-limiting resistor can effectively limit the current flowing through the light-emitting diode, preventing the LED from being damaged by overcurrent and extending its service life. The control unit can drive different colored LEDs to light up (such as green indicating discharge, blue indicating reverse charging, red indicating fault, etc.) by controlling the output level of the corresponding pins based on the battery voltage signal, generator start-up status, and charging and discharging conditions collected by the battery power sampling circuit. This provides intuitive and visual feedback on the circuit's operating status, allowing users to quickly judge the device's working condition and improving ease of use and the monitorability of circuit operation.

[0046] Preferably, the power supply on / off control circuit includes: PMOS transistor Q12, PMOS transistor Q3, NMOS transistor Q11, resistor R14, capacitor C23, diode D8, resistor R23, and resistor R24; wherein, a body diode is connected between the source and drain of PMOS transistors Q12, Q3, and Q11; the positive terminal of the body diode of PMOS transistors Q12 and Q3 is connected to the drain, and the negative terminal is connected to the source; the positive terminal of the body diode of NMOS transistor Q11 is connected to the source, and the negative terminal is connected to the drain; the drain of PMOS transistor Q12 is connected to the generator power supply terminal (V12_IN); the source and drain of PMOS transistor Q12 are connected to the generator power supply terminal (V12_IN); the positive terminal of the body diode of PMOS transistor Q12 is connected to the drain, and the negative terminal is connected to the source. One end of resistor R14, one end of capacitor C23, and the source of PMOS transistor Q3 are connected; the drain of PMOS transistor Q3 is connected to the battery power supply terminal (VBAT+); the gate of PMOS transistor Q3, the other end of resistor R14, the other end of capacitor C23, the gate of PMOS transistor Q12, and the anode of diode D8 are connected; the cathode of diode D8 is connected to the drain of NMOS transistor Q11; the gate of NMOS transistor Q11, one end of resistor R23, and one end of resistor R24 ​​are connected; the other end of resistor R24 ​​and the source of NMOS transistor Q11 are grounded; the other end of resistor R23 is connected to the corresponding control terminal of the control unit (V12_IN_EN, pin PA02).

[0047] In this embodiment, the control unit can control the on / off state of Q11 through R23 based on the generator power sampling signal, thereby driving Q12 and Q3 to turn on or off, achieving precise on / off control between the generator power supply and the battery power supply; R14 and C23 form a buffer circuit, which can suppress voltage spikes during switching operations and prevent component damage; the internal diodes of each MOSFET can prevent reverse current surges, playing a reverse protection role; ultimately ensuring that Q12 and Q3 are turned on when the generator starts, so that the generator can directly charge the battery, and that the two are disconnected when the generator is not started to avoid additional power consumption by the battery, while ensuring the stability of the on / off switching, providing key support for the reliable execution of the charging and discharging logic of the entire circuit system.

[0048] Preferably, the buck-boost conversion circuit includes: capacitor C2, resistor R8, resistor R10, NMOS transistors Q4~Q7, resistor R6, resistor R5, bidirectional trigger diode D15, resistor R3, capacitor C4, capacitor C6, inductor L1, resistor R4, capacitor C3, capacitor C7, bidirectional trigger diode D1, resistor R1, resistor R2, resistor R7, resistor R9, capacitor C1, and capacitor C26;

[0049] One end of capacitor C2, one end of resistor R10, and the input terminal of the buck-boost converter circuit are connected to the corresponding port (CSP1 pin) of the power management chip; the other end of capacitor C2 and one end of resistor R8 are connected to the corresponding port (CSN1 pin) of the power management chip; the other end of resistor R8, the other end of resistor R10, and the drain of NMOS transistor Q4 are connected to the corresponding port (PCIN pin) of the power management chip; the gate of NMOS transistor Q4 is connected to one end of resistor R6; the other end of resistor R6 is connected to the corresponding port (HG1 pin) of the power management chip; the source of NMOS transistor Q4 and the NMOS transistor... The drain of Q5, one end of capacitor C4, one end of resistor R3, and one end of inductor L1 are connected to the corresponding port (LX1 pin) of the power management chip; the source of NMOS transistor Q5 and one end of bidirectional trigger diode D15 are grounded; the gate of NMOS transistor Q5 is connected to one end of resistor R5; the other end of resistor R5 is connected to the corresponding port (LG1 pin) of the power management chip; the other end of bidirectional trigger diode D15 and the other end of capacitor C4 are connected to the corresponding port (BST1 pin) of the power management chip; the other end of resistor R3 is connected to one end of capacitor C6; the other end of capacitor C6 is grounded; the other end of inductor L1... One end of capacitor C3, one end of resistor R4, the drain of NMOS transistor Q7, and the source of NMOS transistor Q6 are connected to the corresponding port (LX2 pin) of the power management chip; the other end of capacitor C3 and one end of bidirectional trigger diode D1 are connected to the corresponding port (BST2 pin) of the power management chip; the other end of resistor R4 is connected to one end of capacitor C7; the other end of capacitor C7 is grounded; the other end of bidirectional trigger diode D1 and the source of NMOS transistor Q7 are grounded; the gate of NMOS transistor Q7 is connected to one end of resistor R1; the other end of resistor R1 is connected to the corresponding port (LG2 pin) of the power management chip; the NMOS transistor... The gate of Q6 is connected to one end of resistor R2; one end of resistor R2 is connected to the corresponding port of the power management chip (HG2 pin); the drain of NMOS transistor Q6, one end of resistor R7 and one end of resistor R9 are connected to the corresponding port of the power management chip (PCON pin); the other end of resistor R7 and one end of capacitor C1 are connected to the corresponding port of the power management chip (CSN2 pin); the other end of resistor R9, the other end of capacitor C1 and the battery power terminal are connected to the corresponding port of the power management chip (CSP2 pin); one end of capacitor C26 is grounded, and the other end is connected to the battery power terminal and the corresponding port of the power management chip (BAT pin).

[0050] In this embodiment, the buck-boost converter circuit consists of capacitor C2, resistors R8 / R10, NMOS transistors Q4~Q7, resistors R6 / R5 / R3 / R4 / R1 / R2 / R7 / R9, bidirectional trigger diodes D15 / D1, capacitors C4 / C6 / C3 / C7 / C1 / C26, and inductor L1. Its input terminal is connected to the corresponding port of the power management chip. The gates of NMOS transistors Q4~Q7 are connected to the HG1 / LG1 / HG2 / LG2 pins of the power management chip, respectively, and are controlled by the chip to turn on and off. Inductor L1 is connected between Q4 / Q5 and Q6 / Q7 to store and release energy. Bidirectional trigger diodes D15 / D1 and capacitors C4 / C3 work together to provide voltage regulation and protection. Resistors and capacitors respectively perform current limiting and filtering functions. This circuit can drive the power management chip... This circuit achieves precise bidirectional voltage conversion. When the battery discharges to an external device, it converts the battery voltage (e.g., 12V) to a compatible voltage such as 5V / 9V / 19V according to the device's protocol. Conversely, when an external power source charges the battery, it converts the external voltage (e.g., 5V / 12V) to a compatible charging voltage (e.g., 13.5V). Bidirectional trigger diodes D1 / D15 suppress voltage spikes, capacitors C3 / C4 / C6 / C7 stabilize the conversion voltage, resistors R1 / R2 / R5 / R6 current-limiting protect the NMOS transistor gate, and inductor L1 efficiently converts energy. Overall, it provides core voltage adaptation support for bidirectional charging and discharging via the USB interface, ensuring that devices with different voltage requirements can stably obtain or output power, significantly improving the circuit's voltage compatibility and conversion reliability.

[0051] Preferably, the USB_C interface is connected to the buck-boost converter circuit via a first switching circuit; the USB_A interface is connected to the buck-boost converter circuit via a second switching circuit; the first switching circuit includes: a PMOS transistor Q1; the source of the PMOS transistor Q1 is connected to the output terminal (VBUS pin) of the USB_C interface; the drain of the PMOS transistor Q1 is connected to the input terminal of the buck-boost converter circuit; the gate of the PMOS transistor Q1 is connected to the corresponding port (VBUSG pin) of the power management chip; a body diode is connected between the source and drain of the PMOS transistor Q1, wherein the source of the PMOS transistor Q1 is connected to the positive terminal of the body diode. The second switching circuit includes: a PMOS transistor Q2; the source of the PMOS transistor Q2 is connected to the output terminal (VBUS pin) of the USB_A interface; the drain of the PMOS transistor Q2 is connected to the input terminal of the buck-boost converter circuit (one end of resistor R10); the gate of the PMOS transistor Q2 is connected to the corresponding port (VOUT1G pin) of the power management chip; a body diode is connected between the source and drain of the PMOS transistor Q2, wherein the source of the PMOS transistor Q2 is connected to the positive terminal of the body diode; the drain of the PMOS transistor Q2 is connected to the negative terminal of the body diode.

[0052] In this embodiment, the power management chip can precisely control the conduction and cutoff of Q1 and Q2 according to the device access status and protocol adaptation results of the USB interface, so as to selectively connect the charging and discharging paths between the corresponding interface and the buck-boost conversion circuit, avoiding power loss or path conflict caused by misconnection of interfaces and circuits that do not need to work; the internal diode of the PMOS transistor can play a role in preventing reverse current surges and providing temporary freewheeling when the switch is not turned on, protecting the interface and buck-boost circuit components; at the same time, the two independent switching circuits allow the USB-C and USB-A interfaces to independently control their working state (such as turning on USB-A to discharge or USB-C to charge separately), improving the flexibility and control accuracy of the interface use, and providing reliable path control support for parallel or independent charging and discharging operations of the two interfaces.

[0053] Preferably, the power management chip is further connected to a temperature sampling circuit, a power supply circuit, and a battery sampling circuit; the temperature sampling circuit includes: capacitor C29 and resistor R18; one end of capacitor C29 and one end of resistor R18 are grounded; the other end of capacitor C29 and the other end of resistor R18 are connected to the corresponding port (NTC pin) of the power management chip; the power supply circuit includes: capacitor C17, capacitor C19, and diode D3; one end of capacitor C17 and one end of capacitor C19 are grounded; the other end of capacitor C17 is connected to the corresponding port (VCC5V pin) of the power management chip; the other end of capacitor C19 is connected to the positive terminal of diode D3; the negative terminal of diode D3 is connected to the power supply terminal of the control unit; the battery sampling circuit includes: resistor R33, resistor R34, and capacitor C25; one end of resistor R33 and one end of capacitor C25 are grounded; the other end of resistor R33, the other end of capacitor C25, and one end of resistor R34 are connected to the corresponding port (PB02 pin) of the control unit; the other end of resistor R34 is connected to the battery power supply terminal (VBAT+).

[0054] In this embodiment, the temperature sampling circuit collects the circuit temperature in real time through resistor R18 (NTC thermistor), and capacitor C29 filters out sampling noise to prevent the power management chip from erroneously triggering over-temperature protection due to temperature misjudgment, thus ensuring circuit safety. The power supply circuit filters the output voltage of the power management chip through capacitors C17 and C19, and provides stable auxiliary power to the control unit after being protected against reverse current through diode D3, enhancing power supply reliability. The battery sampling circuit adapts the sampling range of the control unit through voltage division by resistors R33 and R34, and filters the battery voltage with capacitor C25 to ensure accurate battery voltage acquisition. This provides reliable data support for the control unit to determine the battery status, control LED indicators, and adjust charging and discharging logic, thereby improving the overall monitoring accuracy and operational stability of the circuit system.

[0055] Preferably, both the output terminals of the USB_C interface and the USB_A interface are connected in parallel with a filter circuit.

[0056] In this embodiment, the filter circuit connected in parallel to the output terminal of the USB_C interface includes: one end of capacitor C9 and capacitor C10 is grounded, and the other end is connected in parallel to the output terminal of the USB_C interface.

[0057] In this embodiment, the filter circuit connected in parallel to the output terminal of the USB_A interface includes: one end of capacitor C11 and capacitor C12 is grounded, and the other end is connected in parallel to the output terminal of the USB_C interface.

[0058] In this embodiment, by combining capacitors of different capacitance values, high-frequency and low-frequency noise interference in the USB interface output voltage can be effectively filtered out, making the output voltage more stable and avoiding voltage fluctuations from impacting or interfering with the charging circuits of external devices such as mobile phones and laptops. At the same time, it improves the quality and stability of the interface output power supply, ensures the purity of the voltage signal during charging and discharging, and further enhances the reliability of the entire charging and discharging circuit and its compatibility with external devices.

[0059] Preferably, both the input and output terminals of the buck-boost converter circuit are connected in parallel with a voltage regulator circuit.

[0060] In this embodiment, the voltage regulator circuit connected in parallel to the input terminal of the buck-boost converter circuit includes: capacitor C16, capacitor C13, capacitor C14 and capacitor C15; one end of capacitor C16, capacitor C13, capacitor C14 and capacitor C15 is connected in parallel to the input terminal of the buck-boost converter circuit, and the other end is grounded.

[0061] In this embodiment, the voltage regulator circuit connected in parallel to the output terminal of the buck-boost converter circuit includes: capacitor C18, capacitor C5 and capacitor C8; one end of capacitor C18, capacitor C5 and capacitor C8 are connected in parallel to the output terminal of the buck-boost converter circuit, and the other end is grounded.

[0062] In this embodiment, the multi-capacitor voltage regulator circuit effectively filters out power supply noise at the input of the buck-boost converter circuit and conversion ripple at the output, making the voltage input to the conversion circuit more stable and reducing voltage surges to core conversion components such as NMOS transistors Q4~Q7 and inductor L1, thus ensuring the accuracy of the conversion process. At the same time, it makes the converted output voltage smoother, avoiding voltage fluctuations from affecting the subsequent charging and discharging compatibility of the USB interface with external devices or the stability of battery charging, further improving the operational reliability of the buck-boost converter circuit and the voltage output quality of the entire charging and discharging system.

[0063] Application scenarios of this application:

[0064] Scenario 1: Discharging power from the USB interface to an external powered device (can be achieved whether the generator is running or not):

[0065] The power management chip (such as IP5385) detects the connection status of external powered devices (such as mobile phones, laptops, camping lights, etc.) through the CC1 / CC2 pins of the USB-C interface and the DMP1 / DMA1 pins of the USB-A interface, and adapts to charging protocols such as QC and PD; the control unit (such as CW32L010F8U6) determines whether the generator is running in real time through the generator power sampling circuit (R25, R27, R38, etc.), and collects the battery voltage through the battery power sampling circuit (R33, R34); the power management chip drives the buck-boost conversion circuit (Q4-Q7, L1, etc. MOSFETs and inductors) to convert the battery voltage (usually 12V) to a voltage suitable for the powered device (such as 5V / 9V / 19V) according to the protocol instructions, and controls the first switching circuit (PMOS transistor Q1) of the USB-C interface or the second switching circuit (PMOS transistor Q2) of the USB-A interface to conduct, so as to realize power supply; the control unit synchronously drives the green LED of the LED indicator circuit to stay on, indicating the discharge status. After the generator starts, the control unit collects the generator's 14V power signal through the PA03 and PB03 pins, drives the NMOS transistor Q11 of the power supply on / off control circuit to conduct, and then turns on the PMOS transistors Q12 and Q3, so that the generator directly replenishes the battery, realizing "replenishing power + discharging" in parallel.

[0066] Scenario 2: When the generator is not running, an external power source provides reverse power to the battery via the USB-C interface:

[0067] When the generator is not running, the control unit does not detect a generator power signal through the generator power sampling circuit, and the power on / off control circuit remains disconnected. When an external charging device is connected via a USB-C interface, the power management chip identifies the charging protocol (such as PD3.0, QC5.0) through the CC1 / CC2 pins and controls the Q1 of the first switching circuit to conduct. Simultaneously, the power management chip drives the buck-boost converter circuit to convert the external charging voltage (such as 5V / 9V / 12V) to a charging voltage suitable for the battery (typically 13.5V), and monitors the battery voltage in real time through the battery sampling circuit (R33, R34). The control unit drives the blue LED of the LED indicator circuit according to the voltage change (flashing indicates charging, solid light indicates fully charged). When the battery voltage reaches 12.6V (fully charged), the power management chip automatically cuts off the charging path. If the generator battery is depleted due to prolonged disuse, the one-button start function may fail. At this point, the user connects a power bank with PD protocol to the circuit interface via a USB-C data cable. After the power management chip detects the PD protocol through the CC1 pin, it controls Q1 to conduct, and the 12V external voltage is boosted to 13.5V / 1.5A through the buck-boost circuit to charge the battery. The control unit collects the battery voltage in real time through the PB02 pin. When the voltage rises to 11V, the blue LED starts to flash; when it rises to 12.6V, the blue LED stays on. The power management chip notifies the control unit via I2C communication to turn off the Q1 switch and stop the buck-boost circuit. The entire process does not require removing the battery. At the same time, the temperature sampling circuit (R18, C29) monitors the circuit temperature. If the temperature rises to 65℃ due to excessive charging current, the resistance of the NTC resistor R18 decreases. After detecting this, the power management chip sends an interrupt signal to the control unit through the GPIO5 pin. The control unit drives the red LED to light up and pauses charging. It automatically resumes charging when the temperature drops to 50℃.

[0068] Scenario 3: After the generator starts, it directly charges the battery, and the USB port only retains the discharge function.

[0069] After the generator starts, the generator power sampling circuit (R38, R39, C40) collects the generator's 14V power signal and transmits it to the PB03 pin of the control unit. Upon determining that the generator has started, the control unit outputs a high level through the PA02 pin, turning on the NMOS transistor Q11 of the power on / off control circuit. This, in turn, turns on the PMOS transistors Q12 (connected to the generator power supply terminal) and Q3 (connected to the battery terminal), allowing the generator's 14V power to directly charge the battery. Simultaneously, the control unit communicates via I2C (PB05, PB06 pins) to notify the power management chip to disable the reverse charging function of the USB-C interface (locking the Q1 switch), retaining only the discharge function of the USB-C and USB-A interfaces. The power conversion circuit (D4, D6, LDO) converts the generator power to a stable 3.3V voltage to power the control unit and the LED circuit. At this time, the green LED remains constantly lit (discharge is available), and the red LED is off (no fault).

[0070] Scenario 4: When the generator is not running, USB-C charging and USB-A low-power discharging occur in parallel:

[0071] When the generator is not running, external charging devices are connected via the USB-C interface for power replenishment, while low-power devices (such as smartwatch chargers) are connected via the USB-A interface. The power management chip prioritizes the battery's power replenishment needs based on protocol priorities, allocating the main power of the buck-boost circuit to the power replenishment path, and distributing the remaining power to the USB-A discharge path through time-sharing control. The control unit monitors the battery voltage through the battery sampling circuit. When the battery voltage is below 11V, USB-A discharge is paused, and power replenishment is fully activated. When the voltage is above 11.5V, USB-A discharge is initiated, indicated by the alternating flashing of blue and green LEDs in the LED indicator circuit, signifying "power replenishment + discharge in parallel." The power management chip monitors the circuit load in real time through the temperature sampling circuit. If the total power exceeds the threshold, USB-A discharge is automatically cut off to prioritize power replenishment safety.

[0072] In summary, this utility model, through the collaborative design of a control unit, a power management chip, a generator and battery power sampling circuit, a power on / off control circuit, a buck-boost conversion circuit, and dual USB interfaces, can achieve both protocol adaptation of the USB-C and USB-A interfaces via the power management chip and the buck-boost conversion circuit, enabling the battery to discharge to external devices when the generator is not running and the external power supply to the battery via the USB-C interface, thus solving the power supply problem without removing the battery. Furthermore, the generator power sampling circuit triggers the control unit to drive the power on / off control circuit, allowing the generator to directly charge the battery after starting, while simultaneously retaining the dual USB interface discharge function and disabling USB-C reverse charging to avoid conflicts. At the same time, the power conversion circuit provides stable power to the control unit and LED indicator circuit, and the battery power sampling circuit works with the control unit to achieve status monitoring. Overall, this invention solves the problems of cumbersome battery power supply handling, limited USB interface functionality, and lack of intelligent linkage in traditional generator charging and discharging control, significantly improving ease of use, scenario adaptability, and operational reliability.

[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of this utility model and are not intended to limit it. Although this utility model has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solution of this utility model without departing from the spirit and scope of this technical solution, and all such modifications or substitutions should be covered within the scope of the claims of this utility model.

Claims

1. A controllable USB bidirectional charging and discharging circuit, characterized in that, include: Control unit, power management chip, LED indicator circuit, power conversion circuit, generator power sampling circuit, battery power sampling circuit, USB-C interface, USB-A interface, power on / off control circuit and buck-boost conversion circuit; The generator power sampling circuit is connected to the control unit and is used to collect generator power signals; The control unit and the power management chip communicate via the I2C protocol; The input terminal of the power conversion circuit is connected to the generator power supply and the battery power supply, and is used to convert the input power supply into a stable output power supply to power the control unit and the LED indicator circuit. The power supply on / off control circuit is connected between the generator power supply terminal and the battery power supply terminal. Its control terminal is connected to the control unit and is used to control the on / off connection between the generator power supply terminal and the battery power supply terminal according to the generator power supply signal. The battery power sampling circuit is connected to the control unit and is used to collect battery power signals; the control unit controls the LEDs to display based on the battery power signals. The USB-C and USB-A interfaces are connected to a power management chip. When the USB-C interface is charging or discharging with an external device, protocol adaptation is performed, and the charging voltage or discharging voltage is controlled according to the adaptation protocol. When the USB-A interface is discharging with an external device, protocol adaptation is performed, and the discharging voltage is controlled according to the adaptation protocol. One end of the buck-boost converter circuit is connected to a USB-C interface and a USB-A interface, and the other end is connected to a battery power source. Its control terminal is connected to a power management chip; it is used to control the buck-boost converter circuit to perform voltage conversion according to the adapter protocol.

2. The controllable USB bidirectional charging and discharging circuit according to claim 1, characterized in that, The generator power sampling circuit includes: resistor R25, resistor R27, diode D9, capacitor C24, resistor R38, resistor R39, and capacitor C40; one end of resistor R27, one end of capacitor C24, the cathode of diode D9, and one end of resistor R25 are connected to the first sampling input terminal of the control unit; the other end of resistor R25 is connected to the generator power terminal; the other end of resistor R27, the other end of capacitor C24, and the anode of diode D9 are grounded; one end of resistor R38 is connected to the generator power terminal; the other end of resistor R38, one end of resistor R39, and one end of capacitor C40 are connected to the second sampling input terminal of the control unit; the other end of resistor R39 and the other end of capacitor C40 are grounded.

3. The controllable USB bidirectional charging and discharging circuit according to claim 1, characterized in that, The power conversion circuit includes: diode D6, diode D4, capacitor C30, LDO circuit, capacitor C39, and diode D5; the positive terminal of diode D6 is connected to the battery power supply terminal; the positive terminal of diode D4 is connected to the generator power supply terminal; the negative terminals of diode D6 and D4, and one end of capacitor C30 are connected to the input terminal of the LDO circuit; the ground terminal of the LDO circuit, the other end of capacitor C30, and one end of capacitor C39 are grounded; the output terminal of the LDO circuit, the other end of capacitor C39, and the positive terminal of diode D5 are connected to the power supply terminal of the LED indicator circuit; the negative terminal of diode D5 is connected to the power supply terminal of the control unit.

4. The controllable USB bidirectional charging and discharging circuit according to claim 1, characterized in that, The LED indicator circuit includes: a common anode tri-color LED, which integrates three light-emitting diodes (LEDs) of red, green and blue, and has a common anode structure; the anodes of the three LEDs are connected to the power supply terminal of the LED indicator circuit; the cathodes of the three LEDs are each connected in series with a current-limiting resistor and then connected to the corresponding control terminal of the control unit.

5. A controllable USB bidirectional charging and discharging circuit according to claim 1, characterized in that, The power supply on / off control circuit includes: PMOS transistor Q12, PMOS transistor Q3, NMOS transistor Q11, resistor R14, capacitor C23, diode D8, resistor R23, and resistor R24; wherein, a body diode is connected between the source and drain of PMOS transistors Q12, Q3, and Q11; the positive terminal of the body diode of PMOS transistors Q12 and Q3 is connected to the drain, and the negative terminal is connected to the source; the positive terminal of the body diode of NMOS transistor Q11 is connected to the source, and the negative terminal is connected to the drain; the drain of PMOS transistor Q12 is connected to the generator power supply terminal; the PMOS transistor Q11... The source of transistor Q2, one end of resistor R14, one end of capacitor C23, and the source of PMOS transistor Q3 are connected; the drain of PMOS transistor Q3 is connected to the battery power supply terminal; the gate of PMOS transistor Q3, the other end of resistor R14, the other end of capacitor C23, the gate of PMOS transistor Q12, and the anode of diode D8 are connected; the cathode of diode D8 is connected to the drain of NMOS transistor Q11; the gate of NMOS transistor Q11, one end of resistor R23, and one end of resistor R24 ​​are connected; the other end of resistor R24 ​​and the source of NMOS transistor Q11 are grounded; the other end of resistor R23 is connected to the corresponding control terminal of the control unit.

6. The controllable USB bidirectional charging and discharging circuit according to claim 1, characterized in that, The buck-boost converter circuit includes: capacitor C2, resistor R8, resistor R10, NMOS transistors Q4~Q7, resistor R6, resistor R5, bidirectional trigger diode D15, resistor R3, capacitor C4, capacitor C6, inductor L1, resistor R4, capacitor C3, capacitor C7, bidirectional trigger diode D1, resistor R1, resistor R2, resistor R7, resistor R9, capacitor C1, and capacitor C26; One end of capacitor C2, one end of resistor R10, and the input terminal of the buck-boost converter circuit are connected to the corresponding port of the power management chip; the other end of capacitor C2 and one end of resistor R8 are connected to the corresponding port of the power management chip; the other end of resistor R8, the other end of resistor R10, and the drain of NMOS transistor Q4 are connected to the corresponding port of the power management chip; the gate of NMOS transistor Q4 is connected to one end of resistor R6; the other end of resistor R6 is connected to the corresponding port of the power management chip; the source of NMOS transistor Q4, the drain of NMOS transistor Q5, one end of capacitor C4, one end of resistor R3, and one end of inductor L1 are connected to the corresponding port of the power management chip; the source of NMOS transistor Q5 and one end of bidirectional trigger diode D15 are grounded; the gate of NMOS transistor Q5 is connected to one end of resistor R5; the other end of resistor R5 is connected to the corresponding port of the power management chip; the other end of bidirectional trigger diode D15 and the other end of capacitor C4 are connected to the corresponding port of the power management chip; the other end of resistor R3 is connected to one end of capacitor C6; the other end of capacitor C6 is grounded; the inductor L1... The other end of capacitor C3, one end of resistor R4, the drain of NMOS transistor Q7, and the source of NMOS transistor Q6 are connected to the corresponding port of the power management chip; the other end of capacitor C3 and one end of bidirectional trigger diode D1 are connected to the corresponding port of the power management chip; the other end of resistor R4 is connected to one end of capacitor C7; the other end of capacitor C7 is grounded; the other end of bidirectional trigger diode D1 and the source of NMOS transistor Q7 are grounded; the gate of NMOS transistor Q7 is connected to one end of resistor R1; the other end of resistor R1 is connected to the corresponding port of the power management chip; the gate of NMOS transistor Q6 is connected to one end of resistor R2; one end of resistor R2 is connected to the corresponding port of the power management chip; the drain of NMOS transistor Q6, one end of resistor R7, and one end of resistor R9 are connected to the corresponding port of the power management chip; the other end of resistor R7 and one end of capacitor C1 are connected to the corresponding port of the power management chip; the other end of resistor R9, the other end of capacitor C1, and the battery power terminal are connected to the corresponding port of the power management chip; one end of capacitor C26 is grounded, and the other end is connected to the battery power terminal and the corresponding port of the power management chip.

7. A controllable USB bidirectional charging and discharging circuit according to claim 1, characterized in that, The USB_C interface is connected to the buck-boost converter circuit via a first switching circuit; the USB_A interface is connected to the buck-boost converter circuit via a second switching circuit; the first switching circuit includes: a PMOS transistor Q1; the source of the PMOS transistor Q1 is connected to the output terminal of the USB_C interface; the drain of the PMOS transistor Q1 is connected to the input terminal of the buck-boost converter circuit; the gate of the PMOS transistor Q1 is connected to the corresponding port of the power management chip; a body diode is connected between the source and drain of the PMOS transistor Q1, wherein the source of the PMOS transistor Q1 is connected to the body diode. The positive terminal of the transistor; the drain of the PMOS transistor Q1 is connected to the negative terminal of the body diode; the second switching circuit includes: a PMOS transistor Q2; the source of the PMOS transistor Q2 is connected to the output terminal of the USB_A interface; the drain of the PMOS transistor Q2 is connected to the input terminal of the buck-boost converter circuit; the gate of the PMOS transistor Q2 is connected to the corresponding port of the power management chip; a body diode is connected between the source and drain of the PMOS transistor Q2, wherein the source of the PMOS transistor Q2 is connected to the positive terminal of the body diode; the drain of the PMOS transistor Q2 is connected to the negative terminal of the body diode.

8. A controllable USB bidirectional charging and discharging circuit according to claim 1, characterized in that, The power management chip is also connected to a temperature sampling circuit, a power supply circuit, and a battery sampling circuit. The temperature sampling circuit includes a capacitor C29 and a resistor R18. One end of capacitor C29 and one end of resistor R18 are grounded. The other end of capacitor C29 and the other end of resistor R18 are connected to the corresponding port of the power management chip. The power supply circuit includes a capacitor C17, a capacitor C19, and a diode D3. One end of capacitor C17 and one end of capacitor C19 are grounded. The other end of capacitor C17 is connected to the corresponding port of the power management chip. The other end of capacitor C19 is connected to the positive terminal of diode D3. The negative terminal of diode D3 is connected to the power supply terminal of the control unit. The battery sampling circuit includes a resistor R33, a resistor R34, and a capacitor C25. One end of resistor R33 and one end of capacitor C25 are grounded. The other end of resistor R33, the other end of capacitor C25, and one end of resistor R34 are connected to the corresponding port of the control unit. The other end of resistor R34 is connected to the battery power supply terminal.

9. A controllable USB bidirectional charging and discharging circuit according to claim 1, characterized in that, Both the output terminals of the USB_C interface and the USB_A interface are connected in parallel with a filter circuit.

10. A controllable USB bidirectional charging and discharging circuit according to claim 1, characterized in that, The input and output terminals of the buck-boost converter circuit are both connected to a voltage regulator circuit.