WiFi Microcontroller Power Save While Uploading Sensor Data

by xidameng in Circuits > Arduino

9 Views, 0 Favorites, 0 Comments

WiFi Microcontroller Power Save While Uploading Sensor Data

arduino-ambd.png

Most microcontroller with WiFi connectivity tends to consume a lot more power than those without. Here let's discuss how to save power while still using microcontroller's WiFi capability.

This example use Ameba RTL8722 development board from Realtek for its dual-band WiFi and BLE5.0 capability.

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.

Supplies

  • Ameba x 1
  • DHT11/DHT22/DHT21 x 1

WiFi Uploading Sensor Data

1-2.png

We use the "Sokit" tool to set the IP & port of Ameba, and request for temperature and humidity values in turn. (see picture above)

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:

Power Consumption Comparison

1-3.png

Note with 2 double A batteries, we can manage to run the program for longer than a week, if supplemented with energy harvesting device like solar panel, the battery life would be theoretically infinite. (We use the Keysight 34465A multimeter in the experiment)

Of course, this is still not the best it can do, with deep sleep mode, we can extend the battery life even further, this will be discussed in the future article.