Power Management - Use WiFi in sleep mode
Preparation
- Ameba x 1
- DHT11/DHT22/DHT21 x 1
Example
In deepsleep mode, the WiFi feature of Ameba is disabled. If you want to save power and keep the WiFi connection at the same time, please use the sleep API.
Open “File” -> “Examples” -> “AmebaPowerSave” -> “SleepWithDHTUdpServ”
Remember to set the ssid & password in the sample code. In this example, Ameba act as an UDP server, it establishes a wifi connection then enter sleep mode. When Ameba receives UDP packets with content “H”, it replies the humidity value, and when it receives UDP packets with content “T”, it replies the temperature value.
When the sleep mode is enabled, Ameba goes to sleep or wakes up automatically.
Open “File” -> “Examples” -> “AmebaPowerSave” -> “SleepWithDHTUdpServ”
Remember to set the ssid & password in the sample code. In this example, Ameba act as an UDP server, it establishes a wifi connection then enter sleep mode. When Ameba receives UDP packets with content “H”, it replies the humidity value, and when it receives UDP packets with content “T”, it replies the temperature value.
When the sleep mode is enabled, Ameba goes to sleep or wakes up automatically.
We use the “Sokit” tool to set the IP & port of Ameba, and request for temperature and humidity values in turn.
Note that Ameba would check the status of pin D18, if it is connected to the GND, Ameba would not enter sleep mode. We compare the example with/without power-saving: (We use the Keysight 34465A multimeter in the experiment)
NOTE: In reality, due to the energy loss in the voltage conversion and operation, the actual usage time may be different.
Copyrights ©瑞晟微电子(苏州)有限公司 2021. All rights reserved. Terms of Use