The nRf examples here use the Circuit Playground Bluefruit board. If you don't have a JST connector handy, the Circuit Playground Bluefruit can also be equivalently monitored with the VCC and GND clip pads.
The Circuit Playground Bluefruit is a good example of a board that suffers a bit in sleep performance because of parasitic components - since the board has many sensor ICs, the power does not drop very dramatically during deep sleep:
Light sleep is similar, if a bit noisier:
However, other boards may get better power performance depending on their PCB design.
nRF Example
A core NRF feature that makes sense to pair with low power is BLE Advertising. By spacing out advertising with deep sleep in between, a device can periodically signal without draining its battery too quickly. The following sketch shows how this could be implemented in practice:
import time import adafruit_ble from adafruit_ble_eddystone import uid, url import alarm np = neopixel.NeoPixel(board.NEOPIXEL, 1) radio = adafruit_ble.BLERadio() # Reuse the BLE address as our Eddystone instance id. eddystone_uid = uid.EddystoneUID(radio.address_bytes) eddystone_url = url.EddystoneURL("https://adafru.it/discord") while True: np[0] = (50, 0, 0) # Alternate between advertising our ID and our URL. radio.start_advertising(eddystone_uid) time.sleep(0.5) radio.stop_advertising() radio.start_advertising(eddystone_url) time.sleep(0.5) radio.stop_advertising() ## 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)
You can learn more about BLE Advertising in the official Learn Guide.
Boot.py:
Page last edited March 08, 2024
Text editor powered by tinymce.