Ameba Arduino: [RTL8195AM] Power Management - Use the power-saving mode


  • Ameba x 1

Power-saving mode of Ameba

Ameba provides a number of power-saving modes, the most commonly used among them are “deepsleep” mode and “sleep” mode.

  • Deepsleep

Deepsleep mode is the mode in which Ameba consumes minimal power. In deepsleep mode, most components of Ameba are disabled, only few components are in operation. For example, the low resolution timer operates in deepsleep mode to wake Ameba up when necessary.
Deepsleep mode is suitable for scenarios in which Ameba needs to wake up at regular time, e.g., wakes up every 3 hours to read the humidity and temperature data, sends data to cloud storage, and then switch back to deepsleep mode.

  • Sleep

Sleep mode is the power-saving mode in which the WiFi feature of Ameba is enabled. The actual power cosumption depends on many factors such as transfer data amount, but on average the power consumption is drastically reduced in sleep mode. Sleep mode is suitable for scenarios in which we need to remote control Ameba.

Power supply of Ameba

On the Ameba board, we supply power to Ameba through the USB port (as shown in the top-left in the figure below). The power is supplied to a DAP control component, LED light, the capacitance and resistors on the board, and the power is converted to supply 3.3V working voltage to Ameba.

However, Ameba can operate normally if we only supply the 3.3V working voltage to Ameba.

How to supply power only to Ameba?

In this section, we will teach you how to manipulate the R43 resistor in order to supply power only to Ameba. If you prefer not to manipulate the hardware part of Ameba, you can skip this section.

The component marked as R43 is a resistor, left side of this resistor is 3.3V power supply which is supplied to the Ameba Module on the right side of R43 resistor.

We need to desoldering the R43 resistor, heat both the left and right side of R43 resistor and detach it from Ameba board. After the resistor is detached, weld each of the left and right point to a dupont line.


The dupont lines are connected as shown in the figure. When we want to supply power only to Ameba, separate the red line from the black line, the power is then supplied by the black line.

How to measure the power consumption?

  • Instruments

There are numerous options for the instruments you use to measure the power consumption. We list a few common options below:
– USB ammeter: Normally one side of USB ammeter is the male port, and the other side is the female port. USB ammeters usually provides low-precision result and needs manually correction. Without correction, the error of the result may reach 1~2mA or more.

– Handheld voltmeter/ammeter: Handheld voltmeters/ammeters can be used to measure the voltage and current of DC/AC and the resistance. Usually, the handheld voltmeters/ammeters have been well-corrected in the factory, thus they can provide results with acceptable accracy.

– Desktop multimeter: Provides more complicated functions and higher precision. Suitable for measurement in a fixed location since it needs to be connect to a wall socket.

  • Units

In general, the power consumption of a device can be represented by power(Watt). However, most 3C devices use DC power with fixed voltage. Therefore, we only have to measure the electric current to get the power consumption.
For example, for a 10000mAh mobile power pack. If it is used to charge a device which consumes 20mA, then the power pack can last 10000 mAh / 20 mA = 500 hours.

  • Wiring

If you use the USB ammeter, connect it to the USB port on Ameba directly.

If you would like to use handheld voltmeter/ammeters or multimeters to measure the power consumption, you have to conduct some special treatment to the MicroUSB wire. First, cut open the MicroUSB wire, you can see 4 thin wires including a red one and a black one:

The red one is connected to 5V, and the black one is conneted to GND. Cut open the red and black wires and connect them to MicroUSB through dupont lines as the figure below:

To measure the power consumtion of the sole Ameba Module, connect to R43:

If you would like to supply power only to Ameba Module, connect the wires as the figure:

Example: Power consumption of Ameba with power-saving mode disabled.

We use the DHT temperature/humidity sensor example. Open “File” -> “Examples” -> “DHTTester”
We measure the power consumption every minute.
void loop() {
  // Wait a few seconds between measurements.

The result of the measurement:
– Power consumption of Ameba and all the components: 61 mA on average
– Power consumption of Ameba Module only: 29 mA on average
So the power consumtion of the board without Ameba Module is 61mA – 29 mA = 32 mA。

Example: Power consumption of Ameba with power-saving mode enabled.

Using the deepsleep mode, we can reduce the power consumed by Ameba.
Open “File” -> “Examples” -> “AmebaPowerSave” -> “DeepSleepWithDHT”
In the sample code, we replace the delay(60000) in loop() with PowerManagement.deepsleep(60000).
When the program execute to PowerManagement.deeplseep(), Ameba goes into deepsleep for 60s. After 60s, Ameba wakes up and starts the program again as if Ameba has been reboot. Therefore, the line PowerManagement.deepsleep(60000) should be put after all tasks.

The result of the measurement:
– Power consumption of Ameba and all the components: 32 mA on average
– Power consumption of Ameba Module only: 0.27mA on average


Power-saving enabled usage time

Comparing the power consumption of Ameba and all the components under normal mode (61mA) with the power consumption of Ameba Module only under power-saving mode (0.27mA).
Assume we use 2 AA 2850 mAh batteries with voltage 1.5V. First convert to 5V voltage: 2 * 2850 mAh * (1.5 / 5) = 1710 mAh.
Then in the first case, the batteries can supply power for 1710 mAh / 61 mA = 28 hours.
Next we conert to 3.3V voltage: 2 * 2850 mAh * (1.5 / 3.3) = 2590 mAh.
Then in the second case, the batteries can supply power for 2590 mAh / 0.27 mAh = 9592 h = 1.09 years.
Comparision: (We use the Keysight 34465A multimeter in the experiment)
In reality, due to the energy loss in the voltage conversion and operation, the actual usage time may be different. However, it is obvious that the power consumption can be drastically reduced in power-saving mode.

How to upload programs to Ameba in deepsleep mode?

We can not upload programs to Ameba when it is in deepsleep mode. For this situation, we use pin D18 as the pin to stop Ameba from going into deepsleep. Simply connect D18 to GND, and reboot Ameba.
However, in normal use connecting D18 to GND would prevent Ameba from entering deepsleep mode.
Please confirm that QQ communication software is installed