Audio Design Guidelines: Espressif Systems
Audio Design Guidelines: Espressif Systems
Version 1.0
Espressif Systems
Copyright © 2019
www.espressif.com
About This Guide
The guidelines outline recommended design practices when developing Audio products
based on the ESP32.
Release Notes
Certification
Download certificates for Espressif products from https://www.espressif.com/en/
certificates.
Table of Contents
1. Schematic Design .................................................................................................................. 1
1.1. Power Supply and GND Plane ...................................................................................................1
1. Schematic Design
The circuit design of an audio product, based on the ESP module provided by Espressif,
can be broken down into three major sections:
• Power supply and GND plane.
• Design rules of audio chips.
• Pin configuration of the ESP32 module.
When the module works in Wi-Fi mode, peak current in the circuit is very high. The
suggested output current for the module's power supply is no less than 500 mA. As audio
boards generally require an external battery, your design may need a charging management
chip, for example AP5056, to charge the battery. You can choose a chip according to your
actual needs.
If the battery is used to power the whole system, please make sure that it is connected to
the circuit and that the VBAT pin of the charging management chip, serving as the input of
the system power supply, is connected to the positive terminal of the battery. As soon as
the charging management chip detects the battery, it starts supplying current of the
nominal value identified in its specification, but if the battery is not detected, the output
current is very small, and power supply for the circuit may be insufficient.
You can avoid this problem by adding a USB/Battery power supply switch circuit into the
design (as shown in Figure 1-1). For example, if a USB cable is plugged in, VBAT pin is cut
off from the system and the power is supplied over USB; otherwise, the power will be
supplied over VBAT.
USB:
VBUS
J5
6 1 D3 1N5819HW-7-F
7 GND VBUS 2 D- USB_DN
8
9
GND
GND
D-
D+
3
4
D+ USB_DP USB/Battery Switch:
GND NC 5
GND D5 D6 D7
USB_CON8 LESD5D5.0CT1G
LESD5D5.0CT1G
LESD5D5.0CT1G
VBUS DCIN
GND GND GND GND
D14 SS24
VBAT
Charge Circuit:
Q5
VBUS AO3401
VBUS
R174 100K(1%) C129 C130
R132 1K(1%)
R133 1K(1%) 10uF/16V(20%) 0.1uF/16V(10%)
U11
R134 0R(5%) TEMP 1 8 R135 0R(5%) R175
R136 1K(1%) 2 TEMP CE 7 D4 RED LED 100K(1%)
3 PROG CHRG 6 R137 0R(5%) D8 GREEN LED
4 GND STDBY 5
VCC BAT 9
PGND
GND GND GND
AP5056
C115
GND
VBAT
10uF/16V(20%)
1.When USB is plugged in,
J6 DCIN will be only powered by USB.
2.Otherwise, DCIN is powered by VBAT.
2 C116 C117
1 100uF/6.3V(20%) 10uF/16V(20%)
GND GND
CON2
BATTERY GND
!
Figure 1-1. USB/Battery Power Supply Circuit
Espressif ! /19
1 2019.01
1. Schematic Design
!
Peripherals that require power supply on an audio board include Wi-Fi module, Codec
module, DSP module, PA power amplifier module, Micro SD card module, LED module,
etc. While PA power amplifier is directly powered by USB/Battery, the other modules are
powered through the power management chip, which converts the USB/Battery voltage to
the voltage they require.
For increased reliability, you can reserve a separate power management chip and optional
resistors for each module in case an independent (backup) power supply is needed. During
debugging, you can determine whether some chips can be removed, based on the actual
test results. The power management chip of your choice should meet the circuit
requirements for input and output of current and voltage, low noise, efficiency and other
aspects of the circuit. For example:
VCC VDD33
U4 AP7361C-33-ER-7/13
4
C11 Tab C205 C12
C10
1
!
Figure 1-2. Power Supply Management Circuit for Peripherals
For the above-listed modules (Wi-Fi module, Codec module, DSP module, PA power
amplifier module, Micro SD card module, LED module, etc.), their reference ground planes
should be separated according to the actual situation. For example, the reference ground
plane of Wi-Fi module and Micro SD card is DGND; the reference ground plane for PA
power amplifier and external loudspeaker is AGND; Codec module, DSP module, LED light
and other chips also have their own reference ground planes. It is also recommended to
provide a separate ground plane for the input power module. These planes should be
connected by a short circuit with a 0R resistor (Packaging should be above 0603), such as
at the following figure:
Espressif ! /19
2 2019.01
1. Schematic Design
!
!
Figure 1-3. Circuit for Splitting Ground Planes
📖 Note:
In your design, you need to refer to the datasheet or reference design of the chips provided by the original
manufacturer.
For example:
The specific design rules for a DSP:
!
Figure 1-4. Reference Circuit Design for a DSP Ground Plane
Espressif ! /19
3 2019.01
1. Schematic Design
!
!
Figure 1-5. Reference Circuit Design for a Codec Ground Plane
At the 3.3 V power supply input pin, it is recommended to add a 100 uF large capacitor
with an extra filter capacitor of 0.1 uF close to the module power supply pin.
Some pins of ESP32 can be used for input only, such as CHIP_EN, SENSOR_VP,
SENSOR_CAPP, SENSOR_CAPN, SENSOR_VN, IO34, IO35, etc.
📖 Note:
• SENSOR_VP, SENSOR_CAPP, SENSOR_CAPN and SENSOR_VN are recommended for use as ADC
detection. The recommended voltage detection range is 0 V~ 2.5 V. Also, adding a 0.1 uF capacitor to
the pin close to ESP32 is suggested.
• In ESP32 series modules, SENSOR_CAPP and SENSOR_CAPN pins are not led out, so only
SENSOR_VP and SENSOR_VN can be used.
For example:
Espressif ! /19
4 2019.01
1. Schematic Design
!
ESP32 Module:
U9 ESP32-WROOM-32D
ESP_VDD33
39
DGND 1 P_GND 38 DGND
3.3V 2 GND1 GND3 37 IO23
Button_Array_ADC R162 0R(5%) SENSOR_VP EN 3 3V3 IO23 36 IO22
SENSOR_VP 4 EN IO22 35 TXD0
C111 C112 SENSOR_VN 5 SENSOR_VP TXD0 34 RXD0
C8 IO34 6 SENSOR_VN RXD0 33 IO21
0.1uF/16V(10%) 100uF/6.3V(20%) 0.1uF/16V(10%) IO35 7 IO34 IO21 32 NC
IO32 8 IO35 NC 31 IO19
Close to Module IO32 IO19
IO33 9 30 IO18
IO25 10 IO33 IO18 29 IO5
DGND IO26 11 IO25 IO5 28 IO17
DGND IO27 12 IO26 IO17 27 IO16
IO14 13 IO27 IO16 26 IO4
IO12 14 IO14 IO4 25 IO0
ESP_VDD33 IO12 IO0
GND2
CMD
IO13
IO15
SD2
SD3
CLK
SD0
SD1
IO2
SW1
R124
1 2
15
16
17
18
19
20
21
22
23
24
1 2 10K(5%)
3 4 EN EN
SCS/CMD
SWP/SD3
SDO/SD0
SHD/SD2
SCK/CLK
3 4
SDI/SD1
DGND
IO13
IO15
IO2
C113
C7 0.1uF/16V(10%)
1uF/16V(10%)
DGND
DGND
!
Figure 1-6. Reference Circuit for Part of ESP32 Pin Configuration
📖 Note:
ESP32 cannot identify USB directly, so a USB to UART chip is needed in your design, such as CP2102-
GM. The UART pin of the chip is connected with the UART0 pin of ESP32, which can be used to flash
programs to ESP32 and serves as an interactive interface with the PC. In your design, it is recommended
to reserve test points for TXD0 and RXD0.
For example:
Espressif ! /19
5 2019.01
1. Schematic Design
!
!
Figure 1-7. Reference Circuit for USB-UART Chip
📖 Note:
In your design, it is recommended to reserve test points for GPIO0 and GPIO2, or to connect a button for
downloading.
For example:
Espressif ! /19
6 2019.01
1. Schematic Design
!
!
Figure 1-8. Reference Circuit for Download Button
• GPIO12 is yet another strapping pin, and its level state in the power-on reset process is
related to the output voltage of the LDO inside the chip:
- “0”: output 3.3 V, and the chip defaults to “0”;
- “1”: output 1.8 V.
📖 Note:
The above-mentioned voltages are related to the power supply voltage of integrated flash and PSRAM in
the module.
Meanwhile, GPIO12 can also serve as the pin to connect SDIO/MMC, such as an SD card,
as well as the pin to connect JTAG. Therefore, it is not recommended to use GPIO12 for
other purposes. Please pay particular attention to the fact that the level state in the power-
on reset process of GPIO12 cannot conflict with the output voltage of LDO.
• Pins used as ADC, DAC, TouchPad, SD card, JTAG, RTC domain pins required in low-
power sleep mode, etc. are all special pins. Please refer to ESP32 Datasheet while
configuring these pins.
Espressif ! /19
7 2019.01
2. PCB Layout Design
!
• Third layer: POWER layer to route power traces and part of signal traces
• Fourth layer: BOTTOM layer, on which some components are placed, and also
power traces and signal traces are routed.
📖 Note:
Components can be placed either on the TOP layer or BOTTOM layer according to the actual situation,
but it is recommended to set the adjacent layer of ESP32 module as GND layer. Even if ESP32 module is
placed on the BOTTOM layer, it is recommended to set the third layer as a GND layer and the second
layer as a POWER layer.
Espressif ! /19
8 2019.01
2. PCB Layout Design
!
!
Figure 2-1. Non-recommended Trace Routing
!
Figure 2-2. Non-recommended Trace Routing
Espressif ! /19
9 2019.01
2. PCB Layout Design
!
!
Figure 2-3. ESP32 Module Antenna Position on Baseboard
📖 Note:
As shown in Figure 2-3, the recommended position for an ESP32 module on the baseboard is:
Position 4: Recommended.
If the recommended positioning requirements cannot be met, please at least make sure
that the module is not covered by any metal shell, and the module's antenna area plus 15
mm outwards is kept clear (no copper, routing, components) as shown in Figure 2-4.
!
Figure 2-4. Clearance Zone for ESP32 Module’s Antenna on the Baseboard
The module’s antenna area should be as far away from other parts as possible, especially
from the audio output. The antenna area is recommended to be in the opposite direction of
the audio output, or at least at 90 degrees if the former cannot be satisfied. For example:
Espressif ! /19
10 2019.01
2. PCB Layout Design
!
!
Figure 2-5. Reference Design for Module Placement
For the USB interface, battery socket holder, power switch, SD card, headphone socket,
external speaker socket, debugging pin header, mounting hole, etc., the positioning of their
components should adhere to the following principles:
• Taking component structures into account, trying to make mounting/connecting easy.
📖 Note:
In particular, you need to pay special attention to plug-in direction, pin sequence, positive and negative
polarity of these components. It is recommended to label these points at the Top Overlayer.
For example:
Espressif ! /19
11 2019.01
2. PCB Layout Design
!
!
Figure 2-6. Positioning Plug-in Components
!
Figure 2-7. Positioning Plug-in Components
Espressif ! /19
12 2019.01
2. PCB Layout Design
!
It is recommended to place the chip components and their peripherals together, especially
the filter capacitor for the power supply. These capacitors must be placed as close to the
power pins as possible and distributed evenly. Please make sure you have a filter capacitor
near each power pin, but do not stack all the capacitors in one place.
For the sake of routing and ground splitting, modules sharing the same ground plane
should be placed near, as well as the functionally related modules (Codec, PA power
amplifier and speaker of Audio chip, as well as USB interface, charging module and battery
interface). See the picture below.
!
Figure 2-8. Reference Placement for Chip Components
Espressif ! /19
13 2019.01
2. PCB Layout Design
!
!
Figure 2-9. Reference Placement for Chip Components
The width of power traces and vias (holes) through layers should meet the requirements of
current flowing:
• Traces of 1 mm wide should be able to carry the current of up to 1 A.
• A 0.25 mm via on a 0.5 mm pad should be able to carry the current of up to 500 mA.
• If copper foil is laid, please make sure that the width of each power trace is constant
along their length, with no bottlenecks due to other traces or vias.
Espressif ! /19
14 2019.01
2. PCB Layout Design
!
!
Figure 2-10. Recommended Power Routing
Different reference ground planes should be separated. Please keep the cutting lines
consistent on all layers and drill more ground holes around the 0R resistors that connect
the reference grounds. It is also recommended to drill as many ground holes as possible
close to the devices’ GND pins, especially in the area of the power supply’s filter capacitor.
If there is a thermal pad in the middle of the chip, it is suggested to drill no less than 9
evenly-distributed ground holes.
Espressif ! /19
15 2019.01
2. PCB Layout Design
!
!
Figure 2-11. Reference Design for Ground Trace Routing
!
Figure 2-11. Reference Design for Ground Trace Routing
Espressif ! /19
16 2019.01
2. PCB Layout Design
!
!
Figure 2-11. Reference Design for Ground Trace Routing
• For the I2C, I2S, and UART groups, each respective group's traces should run parallel
with as wide spacing as possible and be isolated from other groups with GND copper
foil. If isolation is not possible due to limited space, please at least increase the interval
between traces belonging to different groups.
• The signal traces for “Reset” should be as short as possible and isolated from other
traces by ground traces or by extending the distance to reduce interference.
• The signal traces for audio input and output need to be enclosed with ground traces
and surrounded by more ground holes for shielding.
• TouchPad trace routing must be done in accordance with the relevant guidelines to
achieve the best performance.
The figures below show some relevant examples (the blue color represents ground copper).
!
Figure 2-14. Reference Design UART Trace Routing
Espressif ! /19
17 2019.01
2. PCB Layout Design
!
!
Figure 2-15. Reference Design for Audio Signal Trace Routing
!
Figure 2-16. Reference Design for TouchPad Traces Routing
Espressif ! /19
18 2019.01