ESP32 测试(十):ESP32 Wi-Fi 和 蓝牙 并存时开始睡眠模式的电流功耗

测试目的:ESP32 Wi-F 和 蓝牙 并存时测量出 sleep 模式下 Wi-Fi 和 蓝牙并存时的电流功耗。

以下是测试环境与过程、测试结果:

1.测试环境与过程:

  • 硬件部分:ESP32-WROVER-B 模组,ESP-IDF: V4.0 (abdf12dc),与一台示波器。

  • 软件部分:在 esp-idf/examples/wifi/power_save 示例里结合了 /esp-idf/examples/bluetooth/bluedroid/ble/ble_ibeacon 示例(将 ble_ibeacon 中实现的功能复制添加到 power_save 即可)。 menuconfig 中可以按照 特殊配置 进行配置。如下:

    ESP-IDF menuconfig options:
    Enable Power Management:
    menuconfig ---> Component config ---> Power management --->
    [*] Support for power management
    
    Enable Tickless Idle:
    menuconfig ---> Component config ---> FreeRTOS --->
    [*] Tickless idle support
    (3) Minimum number of ticks to enter sleep mode for (NEW)
    
    Note: Tickless idle needs to be enabled to allow automatic light sleep. FreeRTOS will enter light sleep if no tasks need to run
    for 3(by default) ticks, that is 30ms if tick rate is 100Hz. Configure the FreeRTOS tick rate to be higher if you want to allow
    shorter duration light sleep, for example:
    menuconfig ---> Component config ---> FreeRTOS ->
    (1000) Tick rate (Hz)
    
    Configure external 32.768Hz crystal as RTC clock source:
    menuconfig ---> Component config ---> ESP32-specific --->
    RTC clock source (External 32kHz crystal)
    [*] Additional current for external 32kHz crystal
    Note that the "additional current" option is a workaround for a hardware issue on ESP32 that the crystal can fail in oscillating.
    Please enable this option when you use external 32kHz crystal. This hardware issue will be resolved in the next ECO chip.
    
    Enable Bluetooth modem sleep with external 32.768kHz crystal as low power clock:
    menuconfig ---> Component config ---> Bluetooth ---> Bluetooth controller ---> MODEM SLEEP Options --->
    [*] Bluetooth modem sleep
    Bluetooth Modem sleep mode (ORIG mode(sleep with low power clock))
    Bluetooth low power clock (External 32kHz crystal)
    

2.测试结果:

2.1 BLE 广播(不使用 Wi-Fi)
首先需要验证只用 /esp-idf/examples/bluetooth/bluedroid/ble/ble_ibeacon 示例测试 BLE 广播(不使用 Wi-Fi)的电流功耗,测得的平均功耗与 乐鑫官方数据基本吻合,表格如下:

CPU 频率 adv internal(ms) MODE 平均值 最大值 最小值
80 mHz 20 ms Light-sleep 33.1 mA 142 mA <1 mA
160 mHz 20 ms Light-sleep 34.3 mA 150 mA <1 mA

2.2 BLE 广播(使用 Wi-Fi)
然后将 /esp-idf/examples/bluetooth/bluedroid/ble/ble_ibeacon 示例与 esp-idf/examples/wifi/power_save 示例结合后, 在 menuconfig 按照要求配置与烧写固件后,结果如下:

CPU 频率 adv internal(ms) MODE 平均值 最大值 最小值
80 mHz 20 ms Light-sleep 34.7 mA 166 mA 0.72 mA
80 mHz 80 ms Light-sleep 17.2 mA 168 mA 0.73 mA
80 mHz 160 ms Light-sleep 11.1 mA 166 mA 0.75 mA
160 mHz 20 ms Light-sleep 35.2 mA 166 mA 0.8 mA
160 mHz 80 ms Light-sleep 20.3 mA 168 mA 0.77 mA
160 mHz 160 ms Light-sleep 12.5 mA 166 mA 0.75 mA
240 mHz 20 ms Light-sleep 35.9 mA 166 mA <1 mA
240 mHz 80 ms Light-sleep 15.9 mA 166 mA <1 mA
240 mHz 160 ms Light-sleep 13.0 mA 168 mA <1 mA
发布了53 篇原创文章 · 获赞 21 · 访问量 8368

猜你喜欢

转载自blog.csdn.net/zztiger123/article/details/103972836