Skip to content

1. System Overview

▫️Design Goals

  • Achieve automatic switching between dual power inputs (Type-C/Battery), supporting 5V system power supply.
  • Integrate Ai-WB2-12F Wi-Fi/BLE module for wireless communication.
  • Use VB6824 offline voice chip for offline voice wake-up and interruption, supporting audio capture, playback, and ACE echo cancellation.

▫️Overall Architecture Block Diagram

text

2. Module Design Specifications

▫️Power Module

  • Dual power input: Type-C (5V) and lithium battery (3.7V) automatic switching, Type-C has priority;
  • Charging management: TP4054 provides constant current/constant voltage charging for lithium battery, max charging current 500mA;
  • Boost output: When powered by battery, boost chip (e.g. STI3508C) outputs 5V system voltage;
  • Buck output: 5V is stepped down to 3.3V to supply the module and voice chip.

🔹Function Description

  • TP4054 key parameters:
    • Charging current setting: IBAT=1000/RPROG (e.g. R=5KΩ → 200mA), see table below for configuration.
RPROG (KΩ)ICH (mA)
1.66600
2.0500
2.5400
3.3300
5.0200
10100
  • BAT pin should be connected to a ceramic capacitor of at least 10μF.

🔹Design Points

  • Boost circuit design:
    • Boost IC model: STI3508C;
    • Feedback resistor calculation: VOUT=VREF(1+R1/R2), where VREF=0.6V. (e.g. R1=110KΩ, R2=15KΩ → 5.00V);
    • Inductor selection: recommended 2.2μH.
Reference circuit:

alt text

  • Common voltage recommended selection table:
VOUT(V)R1(KΩ)R2(KΩ)C2(uF)L(uH)
5.011015222.2~6.8
91309.31224.7~10
121306.82210
242005.112210
  • Buck circuit:

Why use both boost and buck circuits?

A: The boost circuit ensures the power amplifier chip can maintain stable supply under battery power, thus keeping audio quality consistent. The buck circuit mainly supplies the WiFi module and audio chip.

  • DC/DC chip: RT8059;
  • Feedback resistor calculation: VOUT=VREF(1+R1/R2), where VREF=0.6V, e.g. (R1=68KΩ, R2=15KΩ → 3.32V);
Reference circuit:

alt text

  • Power switching logic:
    • When Type-C is plugged in, the battery supply path is cut off by a MOSFET (e.g. AO3401).

🔹Layout Recommendations

  • Battery charging circuit: Place close to the battery and away from other circuits to avoid interference;
  • Buck circuit: Place close to the buck chip and away from other circuits to avoid interference;
  • Power filtering: Place filter capacitors close to the power chip and load to avoid interference.

▫️Pin Definition

Pin/Net NameTypeDescription
USB_5VInputType-C 5V power input
BAT+Input/OutputLithium battery positive (3.7V)
VCC_5VOutputSystem main power (5V±5%)
VCC_3V3OutputPower supply for module and voice chip (3.3V ±5%)

▫️Layout Recommendations

  • Thermal management: TP4054 and boost chip should be placed away from sensitive analog circuits, with ground pad fully covered with copper for heat dissipation;
  • Decoupling capacitors: Parallel 10μF electrolytic capacitor + 0.1μF ceramic capacitor at VCC_5V and VCC_3V3 outputs.

▫️AiWB212F Module

🔹Function Description

  • Provides Wi-Fi/BLE dual-mode wireless connection, communicates with main controller via UART;
  • Operating voltage: 3.3V@500mA peak.

🔹Design Points

  • Power design:
    • Recommended DC/DC chip: RT8059, input ≥4V, output 3.3V;
    • Decoupling capacitors: 10μF+0.1μF close to module VCC pin.
  • UART interface:
    • LOG:
      • Interface: RXD\TXD;
      • Default baud rate: 2000000.
    • Offline voice communication port:
      • Interface: IO3 (RX)\IO4 (TX);
      • Default baud rate: 2000000.
  • Antenna layout:
    • No copper in PCB antenna area, ≥5mm clearance around.
Module pin definition:
Pin No.PinPin NameDescription
2IO11I2C_SDAReserved I2C data pin
3ENModule reset pinModule reset pin
4IO12I2C_SCLReserved I2C clock pin
6IO17Reserved status LED control pinReserved status LED control pin
7IO3UART RX for offline voice chipUART RX for offline voice chip
8VCC3.3V power3.3V power
15GNDGroundGround
16IO4UART TX for offline voice chipUART TX for offline voice chip
19IO5Reserved WS2812 data pinReserved WS2812 data pin
21RXDLOG UART RXLOG UART RX
22TXDLOG UART TXLOG UART TX
23BOOTProgramming control pin, high level enters programming modeProgramming control pin, high level enters programming mode

3. Offline Voice Module (VB6824+8002A)

▫️Function Description

  • VB6824 performs voice wake word recognition and audio codec, interacts with Ai-WB2-12F via UART
  • 8002A amplifier drives 8Ω/2W speaker, supports PWM input

▫️Design Points

  • Audio circuit:
    • 200nF DC blocking capacitor in series between VB6824 and 8002A
    • Speaker traces should be thickened (≥0.5mm), avoid running parallel to digital signal lines
  • Microphone design:
    • Recommend omnidirectional cylindrical microphone, sensitivity -29dB ±3dB
    • Microphone power should use RC filter (2.2KΩ+22pF)
  • AEC echo cancellation:
    • Speaker output pin (DACR) in series with 0.1uF capacitor and 5.1KΩ resistor to PA1 and PA0
Reference circuit:

alt text

  • Amplifier configuration:
    • 8002A gain setting: Avd= 2×(Rf/Ri) (default Rf=30K, Ri=10K, gain is 6x).

    • VB6824 main pin definition:

Pin No.Pin NameDescription
1USBDMProgramming and LOG pin
2USBDPProgramming and LOG pin
3PA1AEC echo cancellation input pin
4PA0AEC echo cancellation input pin
5PC7/MIC_BIASMicrophone bias pin
6MICMIC input interface
11DACRAudio signal output pin, outputs to audio amplifier chip
14PB10UART RX for communication
15PB9UART TX for communication
17PB5Amplifier control signal

4. Debugging and Testing

▫️Power Test Items

Test PointExpected ValueAllowed Error
TP4054 PROG0.5V±5%
VCC_5V5.0V±3%
DC/DC Output3.3V±2%

▫️Voice Module Verification

  • Wake-up test: At 30cm distance, wake-up rate >95% when SNR ≥15dB;
  • Audio distortion: 1KHz sine wave output THD <1%.

Released under the MIT License.