To observe power consumption on the STM32F405 Feather Express, connect your power probe to the VBAT and GND pins.
Observing the Feather with our generic deepsleep test shows how much the power drops when sleeping, even with both alarms enabled. Note that the period of relatively high power consumption right before sleeping is the chip waiting to see if there's a viable USB connection, before deciding to enter "fake" or "real" deep sleep.
In contrast, STM32 uses a simple WFI (wit for interrupt) operation for light sleep, so it doesn't save very much power compared to regular operation:
STM32 Example
One of the benefits of the STM32F405 Feather Express is the built in SD card reader! This could be beneficial to a datalogging project, where you want to collect and store data from a sensor onto easily removable external storage. As an example, the following sketch will wake up every ten seconds to store the internal chip temperature to the SD card:
import alarm import board import time import microcontroller import sdioio import storage import neopixel np = neopixel.NeoPixel(board.NEOPIXEL, 1) np[0] = (50, 0, 0) # SD Card sd = sdioio.SDCard( clock=board.SDIO_CLOCK, command=board.SDIO_COMMAND, data=board.SDIO_DATA, frequency=25000000) vfs = storage.VfsFat(sd) storage.mount(vfs, '/sd') with open("/sd/log.txt", "a") as sdc: temperature = microcontroller.cpu.temperature print("Temperature:", temperature) sdc.write("{}\n".format(temperature)) ## USB enumeration may take 4-5s per restart time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 10) np[0] = (0, 0, 0) alarm.exit_and_deep_sleep_until_alarms(time_alarm)
This sketch uses deep sleep, so it saves quite a bit of power when not logging data. However, just having the SD card plugged in costs a little bit of power, taking consumption up from under a milliamp to around 3.7mA:
Text editor powered by tinymce.