Вы находитесь на странице: 1из 15

Power Bank Application - Using the HT45F4M

Power Bank Application - Using the


HT45F4M

D/N:AN0312E

Introduction
With the rapid development of the global economy and the improvement of people’s living
standards, there has been a huge increased usage of portable electronic products such
as laptop computers, mobile phones, digital cameras, camcorders, portable DVDs, PDAs,
Music Players, GPS devices, health care devices, etc., all of which need a battery power
supply. But because of the battery’s limited capacity, the amount of usage time provided
is often far from ideal. Batteries can run out of energy at a critical moment when they are
required for business etc or when travelling, where they are used frequently. This problem
can apply to portable devices such as mobile phones, digital cameras, PSPs, PDAs etc. It
is just impractical to have a separate power bank supply for every portable device,
however a common backup supply based on the HT45F4M can resolve this problem

The HOLTEK HT45F4M is a MCU especially designed for power bank supply
applications, providing the convenience required by multiple portable devices.

Power Bank IC Main Features


Features
 Operating Voltage: 2.7V ~ 5.5V @fSYS=7.5MHz
 System Clock: HIRC 30MHz / 1~/64
 Flash Program Memory: 2K  16
 RAM Data Memory: 128  8
 EEPROM Memory: 64  8
 ADC 12-bit  8
 16-bit STM  1
 10-bit PTM  1 (provides complementary PWM outputs with dead time control)
 OCP function
 OVP function

1
Power Bank Application - Using the HT45F4M

Power Bank Main Features


 Uses a Lithium polymer battery. Each battery is specified with a capacity of 3.7V /
3000mAh. Therefore two batteries in parallel can supply a total capacity of 3.7V /
6000mAh
 Input/Output
 Input socket is a USB Mini-B type and the input voltage is 5V
 Output socket is a USB A type, the output voltage is 5V and the maximum output
current is 2.1A
 Operation temperature
 Charge operation temperature: 0 ~ +40°C (Battery Specification)
 Discharge operation temperature: -20 ~ +60°C (Battery Specification)
 Auto-detect external load connect function
 Auto-detect charger connect function
 Standby current: 7A
 Discharge conversion efficiency: 91.13% (Max.) at 5V / 700mA
 Protection mechanism
 Provides the battery with over discharge current protection during discharging.
 Provides the input pin with over voltage protection and battery with over current
protection during charging.
 Battery temperature protection
 Small constant current charging
 Battery voltage: <3.0V
 Constant current: 100mA
 Constant current charging
 Battery voltage: 3.0V~4.2V
 Constant current: 1500mA
 Constant voltage charging
 Constant voltage: 4.2V
 If the charging current is less than 50mA, stop charging.
 Constant voltage discharging
 Constant voltage: 5V
 If the battery voltage is less than 3.0V, stop discharging.
 The maximum output current of the output port is 2.1A.

2
Power Bank Application - Using the HT45F4M

Hardware Block Diagram


Hardware Block Diagram
5V 4.2V
+

USB I/P

5V

USB O/P

Flash ROM
OVP
2K x 16

RAM VDD
PTM OCP
128 x 8

EEPROM HIRC 2.5V


STM ADC
64 x 8 30MHz
TL431B
R.T.

Fig. 1

Hardware Block Diagram Function Description


 Main controller MCU: HT45F4M
 USB Charge port
This port can be connected to a computer USB port or external power adaptor, which
can supply the internal battery of the power bank with a charge function.
 P-MOS and N-MOS Circuit
These two MOS transistors are used to output a complementary PWM signal, thus
providing power bank with a boost control operation during charging or a bulk control
operation during discharging.
 Inductor
The inductor exists to increase the boost voltage during charging and provide a
freewheeling function during discharging.
 P-MOS
The P-MOS is used to terminate the battery discharge operation.
 Battery
Lithium polymer battery.
 USB discharge port
This port is connected to the portable device to discharge it.
 Precision Reference Voltage
Provides the internal ADC with a reference voltage.
 LED Indicator
The LED is used for battery power displaying and error alerting.
 Key
Used for battery power detecting or initiating a discharge.

3
Power Bank Application - Using the HT45F4M

Hardware Circuit Description


4.The inductor L1 is used to provide a
3.P-MOS+N-MOS freewheeling function during charging
1. External power connected circuit and boost voltage during discharging.
to wake-up MCU 2. Input/Output
Voltage Detect

14.PMOS switch

5.Battery Voltage Detect 6.Battery Current


Detect
7.High-white LED

8.Resistor network

12. Key and External


Peripherals detect
11.Main controller MCU
9.LED is used to indicate
power and error alert 13.Temperature Detect
Fig. 2 10.Precision
Reference Voltage

Circuit Description
External Power Connected to Wake-up the MCU
If the USB_IN interface is plugged into an external power supply, then the PA6 level will
change from low to high and generate an interrupt to wake-up the MCU for a charge
operation.

Input/Output Voltage Detection


 Charging mode
The detection circuitry can detect an external voltage. The hardware can force the
PWM to an off status then generate an interrupt if the external voltage is higher than
5.5V. In addition to this, as the input voltage source maybe come from a computer USB
port or a 5V wall transformer, these two sources will have different maximum supply
currents. The actual current supply limit can be found by detecting the input voltage
drop during charging, after which the charge current can be fixed.
 The detection circuitry can monitor the discharge voltage when the power bank
discharges to the external load, as shown in Figure 3. The OVP circuit is internally
connected to the ADC. By sampling the voltage value, users can control the PWM to
adjust the voltage. When the output port is reloaded, such as when the output is
5V/1.5A, the output voltage will suddenly rise if the load is removed. However by
adjusting the PWM using software, this can reduce the voltage rising rate. When this

4
Power Bank Application - Using the HT45F4M

happens, the OVP function will force the PWM into an off state using hardware and
generate an interrupt.
 Mobile phones will start charging when they have detected that the power bank output
voltage is greater than 5V. The output voltage can be fixed to 5.15V to avoid a start
charge failure due to line loss.

Fig. 3

P-MOS and N-MOS Circuits


The internal PTM can operate in the PWM mode. It inserts a dead time circuit, which
generates the complementary PWM outputs, OUTH and OUTL with a dead time. The
OUTH output controls the P-MOS transistor while the OUTL output controls the N-MOS
transistor. These two MOS transistors control the charge current and discharge voltage.

 When charging, the longer the NMOS transistor is on, the higher the charging power is.
 When discharging, the longer the PMOS transistor is on, the higher the discharging
power is.
 Figure 4 shows the complementary PWM block diagram with dead time.

Fig. 4

5
Power Bank Application - Using the HT45F4M

Inductor L1
L1 is used to provide a freewheeling function during charging and a boost voltage
function during discharging.

Battery Voltage Detection


 When charging, the battery voltage detect circuit is for detecting the battery voltage and
current.
 If the battery voltage is too low, stop discharging.

Battery Current Detection


As Figure 3 shows, the OCP pin current is supplied through an internal operational
amplifier and then outputs to the A/D converter input channel, AN8.
 In the charging mode, the OPAMC bit should be set to 1. The current detect circuit is for
controlling the charge current and for full charge detection.
 In the discharge mode, the OPAMC bit should be cleared to 0. The current detect
circuit is connected to the OCP input pin. When the current is greater than the 8-bit
DAC preset value, the PWM is turned off by the hardware to generate an interrupt to
protect the circuit.
 When discharging, the output current is calculated by the battery port current. With a
conversion efficiency of 85%, the calculation formula is as follows:
VOUT × IOUT = VBATTERY × IBATTERY × 0.85

High Brightness White LED


This can be used as a flashlight because it is a high-brightness type LED.

Resistor Network
The resistor net consists of R15, R16, R17 and R18, specially designed for different
mobile phones. Different manufacturers have different configurations. Holtek has the
following information:
 If the I-phone series require fast battery charging, D+ should be supplied with 2.2V, and
D- should be supplied with 2.8V.
 If the HTC series mobile phones require fast battery charging, D+ and D- should be
shorted.
 Holtek has presently obtained information by experiment and has found that I-phone
3GS, I-phone 4 and I-phone 4S can take a charging operation when D+ and D- are
shorted.

6
Power Bank Application - Using the HT45F4M

LED for Power Display and Error Alert


Key operation and LED operation LED operation display description
Yellow LED on The power bank is undergoing an operation
Press the key, the blue LED 1 will light up for 2 seconds The battery power is less than 25%
Press the key, the blue LED 1~LED 2 will light up for 2 seconds The battery power is 25%~50%
Press the key, the blue LED 1~LED 3 are on for 2 seconds The battery power is 50%~75%
Press the key, the blue LED 1~LED 4 are on for 2 seconds The battery power is 75%~100%
The key is continuously pressed for more than about 3 seconds High-bright LED on/off
Yellow LED, red LED and blue LED simultaneously flash quickly
OVP/OCP/Temperature protection
at a 3Hz rate
When charging, the red LED is on and the blue LED 1 flashes at Charging the battery. The battery power is less
a 1Hz rate. than 25%
When charging, the red LED and blue LED 1 light up, the blue Charging the battery. The battery power is
Led 2 flashes by 1Hz 25%~50%
When charging, the red LED is on, the blue LED 1~LED 2 are on Charging the battery. The battery power is
and LED 3 flashes at a 1Hz rate. 50%~75%
When charging, the red LED and blue LED 1~LED 3 are on and Charging the battery. The battery power is
LED 4 flashes at a 1Hz rate. 75%~100%
When charging, the red LED and blue LED 1~LED 4 are on. Fully charged. The battery power is 100%
The battery voltage is less than the cut-off
The blue LED 1 flashes quickly at a 3Hz rate.
voltage, discharging stops

Precision Voltage
The precision reference voltage is to provide a reference voltage for the internal ADC and
DAC.

Main controller MCU


The main controller MCU is the HT45F4M which is provided with integrated PWM outputs
which have Dead Time, as well as OVP and OCP protection functions.

Key
This is to initiate discharging and displaying the battery power.
Set the PA7 port to be an input with a pull high resistor. When connected to an external
device, a small current will pull low the PA7 port and wakeup the MCU. Due to not being
able to guarantee that every external device will be detected, in addition to displaying the
power when the key is pressed, the power bank will also enter the discharge mode. If the
automatic detection fails, it also can be discharged by pressing the key.

Temperature Detection Circuit


This is for detecting the battery temperature during battery charging or discharging. The
battery temperature ranges are as follows:
Charge operating temperature range: 0~ +40°C (battery specification)
Discharge operating temperature: -20~ +60°C (battery specification)
When the battery is over-temperature, the circuit will be protected.

PMOS Switch
This PMOS switch can directly switch the battery off using the PMOS body diode which
outputs a voltage to the external device.

7
Power Bank Application - Using the HT45F4M

Software Flowcharts and Description


Main Program

Fig. 5

8
Power Bank Application - Using the HT45F4M

Battery Charging Procedure

Start

Clr f_halt_mode
SetF_LED_CHANGE
Set F_GET_TEMP
Get battery voltage
Get input voltage
Get battery current

Charging CHANGE[Initial]
N
initialization? SET F_CHANGE3V_MODE

Battery voltage Battery voltage


Y Y 100mA charging
< 3V mode ? < 3V ?

N
SET F_500mA_MODE
N

Battery voltage
1A charging mode ? Y Y 1A charging
< 4.2V

N
N
SET
F_CHANGE42V_MODE

4.2V charging mode ? N

4.2V charging

Charging
Y SET F_CHANGE_FULL
current < 80mA

CALL UP_DUTY
RET

Fig. 6

9
Power Bank Application - Using the HT45F4M

Battery Discharging Procedure

Start

Clr f_halt_mode
Set F_LED_CHANGE
Set F_GET_TEMP

Set f_halt_mode
Battery power
Y Clr F_LED_CHANGE
< 3V ?
Clr F_GET_TEMP

DIS_DIS_BATTERY
Initialization ? Y
[Initial]

Output voltage
Dec DUTYL_BUFF Y
> 5.1V

Output voltage
Inc DUTYL_BUFF Y
< 5V

CLR f_DIS_BATTER
Output current SET f_halt_mode
Y
< 50mA Clr
F_LED_DISCHANGE

CALL UP_DUTY
RET

Fig. 7

10
Power Bank Application - Using the HT45F4M

Software Flowcharts Description


The software flowchart consists of a main flowchart, charge flowchart and discharge
flowchart.

Main Program
When an external power supply is plugged in, it implements charging. When an external
load is plugged in, it implements discharging. When the key is pressed, it displays the
power. If the key is continuously pressed for 3 seconds, the flashlight function is enabled.
It starts processing when the power bank is in an abnormal condition. The temperature
detect and LED scanning output are always executed during the complete charge
operation. If no events are to be executed then the program will enter the halt mode.

Charging Procedure
When a battery voltage of less than 3V is detected, a 100mA small constant charging
current will be supplied. If the battery voltage is charged between 3V and 4.2V, then the
battery will be charged with a constant current. If the battery voltage is charged to 4.2V,
then the battery will be charged with a constant voltage and charging is completed when
the charging current is less than 80mA. Here the full charge flag will be set.

Discharging Procedure
Discharging includes two functions, one is for discharge voltage control, another is for
discharge current control.

PCB Layout Considerations


1. The A/D input traces should not be located close to the PWM and inductor traces.
2. The closer the battery port current detect resistor is located to the OCP input pin, the
better. The current sense resistor ground pin should be a single-point connected to the
power ground.
3. The digital ground should be kept separate from the analog ground.
4. As there is a higher current on the battery port, special attention must be made to the
trace width.

11
Power Bank Application - Using the HT45F4M

Top Layer

Fig. 8

Bottom Layer

Fig. 9

12
Power Bank Application - Using the HT45F4M

HT45F4M Power Bank Demo Board – BOM


Package type
Part No. Note
or No.
MCU HT45F4M 1 20SSOP
Coil Inductor 5.6H/6A 1 SMD
PN-MOSFET AO4606 1 SOP8
P-MOSFET AO3401 1 SOT23
Precision
TL431B 1 SOT23
reference Voltage
Key BUTTON 1 SMD
High-white LED LED 1
SMD LED LED 6 SMD 0603 4 green, 1 red, 1 blue
USB Mini-B socket 1 SMD
Connector
USB A socket 1 Dip type
0.1F 5 0603
Capacitor 22F/10V 4 1206
1F 2 0603
200k 1 0603
39k 1 0603
51k 1 0603
47k 1 0603
22k 1 0603
33k 2 0603
SMD Resistor 10k 2 0603
680 3 0603
1k 1 0603
10 3 0603
100k/1% 1 0603
200k/1% 2 0603
0.035/1%/0.5W 1 2010 Current sense resistor
Temperature
50k/25C 1 Dip type
sense component
Schottky diode 1N5819 1 SMA
Schottky diode 1N5817 3 SMA
Total 52

13
Power Bank Application - Using the HT45F4M

Demo Board Pictures

Single lithium battery

Two batteries in parallel

Fig. 10

14
Power Bank Application - Using the HT45F4M

Discharge Conversion Efficiency Curve

Note: The 0.1A conversion efficiency is lower because the MCU and LED both consume power.

Conclusion
A power bank product using the HT45F4M has the advantages of high efficiency
synchronous rectification function, low standby current, high noise immunity, competitive
pricing and so on. Compared with other power bank supplies using charge ICs with
general MCUs, this kind of power bank can change its charge and discharge parameters
using software. This not only offers the advantages of lower cost but also supports
products with different requirements, thus offering a better solution over traditional
methods.

15

Вам также может понравиться