One of the challenges of using IoT enabled MCU is the power consumption. However, on Ameba, you can keep the WiFi on while in sleep mode thus enabling power saving and connectivity.
Here is a demo of how to achieve WiFi in sleep mode.
Ameba x 1
DHT11/DHT22/DHT21 x 1
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.
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.
For more information, please visit Ameba official website at Ameba Arduino: [RTL8195AM] Power Management – Use WiFi in sleep mode – Realtek IoT/Wi-Fi MCU Solutions
and Facebook group at Ameba IoT Forum[RTL8722/RTL8195/RTL8710/...]