Jump to content
Electronics-Lab.com Community

Using WiFi In Sleep Mode -- MCU Power Saving --Ameba Arduino


MENG XI

Recommended Posts

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.

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.

 

We use the "Sokit" tool to set the IP & port of Ameba, and request for temperature and humidity values in turn.
1
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)
2

 

NOTE: In reality, due to the energy loss in the voltage conversion and operation, the actual usage time may be different.

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...