esp-idf/examples/system/ulp_adc
Angus Gratton 02f2e63662 Merge branch 'feature/use_cmake_function_call_for_embedding_ulp' into 'master'
Use function call for embedding ULP binaries

See merge request idf/esp-idf!4242
2019-05-27 13:14:09 +08:00
..
main example: update ulp example to use cmake function 2019-05-21 20:00:06 +08:00
CMakeLists.txt cmake: add ulp components build support 2018-09-13 14:54:59 +08:00
Makefile examples: add ULP ADC example 2017-05-16 13:15:02 +08:00
README.md examples/ulp: disable pullup on GPIO15 to reduce current 2017-11-03 18:56:31 +08:00
sdkconfig.defaults Rename Kconfig options (components/bootloader) 2019-05-21 09:32:55 +02:00

ULP ADC Example

This example demonstrates how to use the ULP coprocessor to poll ADC in deep sleep.

ULP program periodically measures the input voltage on GPIO34. The voltage is compared to two thresholds. If the voltage is less than the low threshold, or higher than the high threshold, ULP wakes up the system.

By default, thresholds are set to 1.35V and 1.75V, approximately.

GPIO15 is connected to ground to supress output from ROM bootloader.

Average current drawn by the ESP32 in this example (with the default 4x averaging) depending on the measurement frequency is as follows:

Measurement frequency, Hz Average current, uA
10 8.5
50 20
100 37

Example output

Below is the output from this example.

Not ULP wakeup
Entering deep sleep

Deep sleep wakeup
ULP did 1531 measurements
Thresholds:  low=1500  high=2000
Value=973 was below threshold
Entering deep sleep

Deep sleep wakeup
ULP did 2 measurements
Thresholds:  low=1500  high=2000
Value=0 was below threshold
Entering deep sleep

Deep sleep wakeup
ULP did 2 measurements
Thresholds:  low=1500  high=2000
Value=0 was below threshold
Entering deep sleep