The Raspberry Pi Pico development board power consumption can be monitored by connecting to VBUS and GND.
The RP2040, conveniently, is the only currently supported chip that supports every kind of wakeup configuration across all sleep types. However, note that unlike most other chip families, it will actually lose a bit of deep sleep performance when using a TimeAlarm
. This is because the RP2040 dormant mode actually doesn’t support the RTC at all without an external clock source, so our deep sleep is actually a very extreme version of light sleep, rather than a separate mode.
When avoiding TimeAlarm
s, the Raspberry Pi Pico devboard can achieve under 2mA while in deep sleep:
When a Timealarm is added, the draw raises up to 7mA.
RP2040's Light sleep mode, while not near deep sleep levels of efficiency, is still a useful power reduction, dropping power consumption by over a third:
RP2040 Example
While it doesn’t have removable storage, the RP2040 can also be used for datalogging using the internal storage on the chip. The following sketch will gather the internal chip temperature and append it to a file in the internal storage, which can be accessed whenever the board is plugged in.
Since this sketch uses the storage
module to access the internal filesystem, you'll need to also include a boot.py file, and will not be able to access the CPy drive while the datalogger is running. You can read more about the storage
module in the Guide.
code.py:
import alarm import board import time import microcontroller import storage temperature = microcontroller.cpu.temperature print("Temperature:", temperature) try: with open("/log.txt", "a") as sdc: sdc.write("{}\n".format(temperature)) except OSError as e: print("Cannot write to fs, is GP4 grounded?") ## USB enumeration may take 4-5s per restart time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 10) alarm.exit_and_deep_sleep_until_alarms(time_alarm)
boot.py:
import board import digitalio import storage switch = digitalio.DigitalInOut(board.GP4) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP # If the switch pin is connected to ground CircuitPython can write to the drive storage.remount("/", switch.value)
Other Resources for RP2040
User bablokb on GitHub has done extensive measurements of RP2040 power consumption.
Page last edited March 08, 2024
Text editor powered by tinymce.