-
1Introduction
Ameba-D supports low power modes which are deepsleep modes. Deepsleep mode turns off most of the system power domain. The power consumptions of the core module in DeepSleep Mode are around 7uA to 8uA compared to the normal state of around 22mA. This example gives demo of system switch between “working” and “sleep”(power save). Using DHT sensor to read data and display on Eink screen when system is awake. After 5 seconds system auto enter DeepSleep Mode for power save. The system will wake up by the wakeup source.( Aon timer, Aon Pins or RTC timer).
-
2Procedure
Download the Eink zip library, AmebaEink.zip, at https://github.com/ambiot/ambd_arduino/tree/master/Arduino_zip_libraries. Then install the AmebaEink.zip. Open “File” -> “Examples” -> “AmebaPowerSave” -> “DeepSleep_DHT_Eink_Example”
Set condition values as picture below. “DS_WAKEUP_SOURCE” is used to set the wake-up source, user can choose 3 wake up sources now,
- AON Timer (SET_DS_AON_TIMER_WAKEUP);
- AON GPIO pins (SET_AON_WAKEPIN_WAKEUP);
- RTC Timer(SET_DS_RTC_WAKEUP);
-
3Using AON Timer as a wake-up source
AON timer can be set from 0 to 32760000 range (unit ms) by AON_TIMER_SLEEP_DURATION.
-
4Using AON GPIO pins as a wake-up​ source
For RTL8722DM, there are 5 pins that can be set as AON pins and active high for wakeup, GPIOA25(D16), GPIOA26(D17), GPIOA21(D26), GPIOA20(D27), GPIOA(D28).
For RTL8722DM_MINI, there are 8 pins that can be set as AON pins and active high for wakeup, GPIOA12(D9), GPIOA13(D10), GPIOA14(D11), GPIOA15(D12), GPIOA16(D13), GPIOA18(D15), GPIOA19(D16), GPIOA21(D18).
These AON pins can be set by using SET_AON_GPIO_WAKEUP_GPIOA25 or the pin that you want to use as shown in the picture below.
-
5Using RTC Timer as wakeup source
RTC Timer wakeup system is by setting alarm. The alarm has 4 values to be set, day, hour, min and sec. All 4 values can be set by DS_RTC_ALARM_DAY, DS_RTC_ALARM_HOUR, DS_RTC_ALARM_MIN, and DS_RTC_ALARM_SEC. DHTPIN is used to set DHT sensor data pin. User can choose any GPIO pins. DHTTYPE is used to set DHT sensor type. (DHT11, DHT22 and DHT33)
When finished the condition values setting, system will run and switch between normal working mode and deepsleep mode controlled by wakeup source. Eink screen will display the temperature and humidity data measured from DHT sensor when the system is awake.
-
6Code Reference
Please refer to the API Documents PowerSave section for a detailed description of all APIs.
-
7More References
Please visit the following websites for more details about the board & other examples:
- AmebaIoT Official Website: https://www.amebaiot.com/en/
- AmebaIoT Official FB Page: https://www.facebook.com/groups/AmebaIoT
- AmebaIoT Forum: https://forum.amebaiot.com/
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.