Raspberry Pi Pico Deep Sleep Low Power Tutorial | Rising Signal Wake-Up on the RP2040

  Рет қаралды 34,916

Low Level

Low Level

Күн бұрын

Пікірлер: 76
@LowLevel-TV
@LowLevel-TV 3 жыл бұрын
The power consumption in the tight_loop_contents(...) test is 95.7mW, for some reason my video editor decided to cut it out and I missed it D:
@trya2l
@trya2l Жыл бұрын
Thanks! After a few months, going back through this video, I'm starting to understand its value. Good low-level job 👍
@niewazneniewazne1890
@niewazneniewazne1890 5 ай бұрын
Baseline: 95.7mW Sleep: 85.8mW RTC sleep: 33mW -> 85.8mW -> 33mW -> ... Rising edge sleep: 6.6mW, 13.2mW
@WisseSpring
@WisseSpring 3 жыл бұрын
Thanks for doing this tests! Would like to add, for those that are not very familiar with this topic, that 6 mW draw in sleep is not low by modern standards. Low power was definitely not a priority with RP2040, but there are many ARM microcontrollers out there that can go down to a few uW during (useful) sleep. Just something to keep in mind if one ever considers a project powered by a small battery that shouldn't go dead in a few days.
@LowLevel-TV
@LowLevel-TV 3 жыл бұрын
Good to know, thank you!
@tonysofla
@tonysofla 3 жыл бұрын
But where is the power draw from? I assume you can turn off core sysclk? and only run a timer on 32KHz that when its ISR wakes up, the core starts running on hfrc first until PLL is ready? as I assume you can turn off the two PLL's? as those are a power hog. Can you turn off ram banks to save power?
@MrGamelover23
@MrGamelover23 2 жыл бұрын
Can you give me some examples? i'm interested in creating a modern version of the alphasmart word processors. there's nothing wrong with them, they were just discontinued like over a decade ago. i'm thinking an e-ink display and fonts for every single language in the world. Something that I can have 700 hours of use if you're a slow typist by going into sleep mode between each case stroke. My idea is to basically make it stand alone without a keyboard so it can sell for a lot cheaper and you can use whatever typing experience you prefer, we had a cheap membrane keyboard or a $300 split ergonomic mechanical keyboard.
@WisseSpring
@WisseSpring 2 жыл бұрын
@@MrGamelover23 Looking at what e-readers use would be a good starting point. Your product seems ambitious enough to benefit from one of the "application processors" (e.g. Cortex-A family), which are more powerful and can run OS like Linux, as opposed to microcontrollers (e.g. Cortex-M family), which are not really meant to handle complex, modern user interfaces. This is very important design choice that requires thorough investigation! I sadly don't have any experience with Cortex-A parts. Microcontrollers that I brought down or under single digit uW in sleep were from NXP (Kinetis family) and Nordic (nRF52 family). I know for a fact that there's a whole plethora of parts from different manufacturers that could do the same.
@MrGamelover23
@MrGamelover23 2 жыл бұрын
@@WisseSpring the original alphasmart neo could go for $700 off of 3 AA batteries. That's why I think it might be better to be a single software instead of a software running within an os. it doesn't exactly need a complex user interface, but you're right that is something that requires thorough investigation. Thank you. The neo used a 33MHz DragonballVZ, which is a 68000-based processor made by Freescale/Motorola. Any idea what the modern equivalent would be? (The VZ saves every keystroke to RAM, which is unnoticeable in operation but makes it quite important to keep a fresh coin cell on board.) Edit: apparently this is the family of processors that replaced it en.m.wikipedia.org/wiki/I.MX
@hclchgm
@hclchgm 2 жыл бұрын
Finally something useful from someone who isn't trying to sell me a device.
@test40323
@test40323 2 жыл бұрын
A very useful tip for a data collector in the field.
@pro-nav
@pro-nav 3 жыл бұрын
Nice, Do USB host next, maybe PIO, or RTC? There are so many things to do with this little guy. Great Video as always.
@LowLevel-TV
@LowLevel-TV 3 жыл бұрын
Great suggestion!
@niewazneniewazne1890
@niewazneniewazne1890 5 ай бұрын
Baseline: 95.7mW Sleep: 85.8mW RTC sleep: 33mW -> 85.8mW -> 33mW -> ... Rising edge sleep: 6.6mW -> 13.2mW
@DrJonD
@DrJonD Жыл бұрын
Nice video. Should be noted that pico extra is experimental code. Clocks are not returned to normal state after return from sleep. My tests and others online are unable to get returning from sleep/dormant repeatable which is annoying.
@JavaMike71
@JavaMike71 3 жыл бұрын
This was quite helpful, thanks for the detail in the video. Have you tested anything like a simple sensor and running on battery power? I have an infrared sensor that I want to use on battery with the Pico, but I would need it to last 1-2 weeks on low usage. Any thoughts on that or trials you have done?
@LowLevel-TV
@LowLevel-TV 3 жыл бұрын
Unfortunately not yet, but I plan on doing some longer form project videos with the Pico where I might experiment with battery capacity.
@GrandFathersCrutch1
@GrandFathersCrutch1 Ай бұрын
Great vid man, thx ❤
@ashleycawley5816
@ashleycawley5816 Жыл бұрын
Really enjoyed that, thank you for sharing and presenting it all so nicely. Out of curiosity what make/model is the bench power supply you're using there? I've never owned one but I'm thinking of getting one, I don't want one which is too big or bulky but that looked a nice size.
@pup4301
@pup4301 3 жыл бұрын
Thank you. Can be used when using a low power battery.
@LowLevel-TV
@LowLevel-TV 3 жыл бұрын
Exactly!
@tonysofla
@tonysofla 3 жыл бұрын
A Coincell battery like CR2450 (600mAh), say you sleep 95% at 0.18mA and a awake 5% at 10mA (not including bright LED etc) = 36days. not good but you would not use something this powerful as a Pico with a coin cell product, on the other hand using a 5000mAh USB power bank = 306 days.
@pavelperina7629
@pavelperina7629 7 ай бұрын
@@tonysofla Maybe I missed something, but it's 2mA@3.3V which is not great. Spec says something like 0.8mA@5V, With 3x NiMH or alkaline battery that has 2500mA capacity, it's very roughly about 1000 hours or a month. But it's hard to say how it's measured, from scheme there's 10+5.6K voltage divider on VBUS which is the first problem - this is 0.3mA at 5V. EDIT: ops there are specs for RPI Pico (stating what I wrote) vs RP2040 core (stating yours 0.18mA@1.1V) which makes 0.2mW vs 4mW difference.
@tonysofla
@tonysofla 7 ай бұрын
@@pavelperina7629 specs of the RP or the development board as a whole? If 5V battery powered connect that at VSYS, or if 4.2V tolerant connect a lithium at 3V3. RP is not really made for ultra-low power as it does not have 32K crystal support.
@pavelperina7629
@pavelperina7629 7 ай бұрын
@@tonysofla Yep. I was considering replacing old arduino micro pro with rpi for data logger project if possible. First to learn something new and second it's cheaper and more capable. And use of Arduino is also hit and miss, it depends on voltage regulators it uses.
@hardware4200
@hardware4200 2 жыл бұрын
This content is amazing.
@daedalus5483
@daedalus5483 Жыл бұрын
Total newbie here; would you recommend using a Pico (W) for a battery powered project in combination with an e-paper display in a lora (mesh) configuration? Hard to tell what the wake / sleep ration is because I'm not sure how (often) lora nodes can / should relay messages. In a normal use case, the board receives instructions, displays some stuff and waits for some sort of acknowledgement, sleeps for ~ 5 - 10 minutes, sends input from the node and then goes back to sleep. While it wakes up, it should remember its "state" (or know to request the last state from the "server").
@MattFixesStuff
@MattFixesStuff 7 ай бұрын
Thanks for the video. I keep coming back to it :D is there any updates on this (using Arduino IDE) ? I still have picos lying around I wonder if the implementation changed or was improved in the meantime. I switched to the esp32 that comes with 150 µA deep sleep mode that doesnt require any extra libraries. But I still also like the pico but avoided it so far for battery projects.
@Vikassy
@Vikassy 4 ай бұрын
Thanks for sharing. But I can't seem to find any way to add the pico extras library to Arduino.
@yahmk3978
@yahmk3978 2 жыл бұрын
Thank you very much!
@LowLevel-TV
@LowLevel-TV 2 жыл бұрын
You're welcome!
@thesidneychan
@thesidneychan 2 жыл бұрын
From the title my first thought was there's a lo fi Pi ASMR beats thing to sleep to.
@SobhitPanda
@SobhitPanda 3 жыл бұрын
Can you share some nice resources on Low Power IoT and RTOS, like the books or courses you took to learn them.
@murmanmurman
@murmanmurman 2 жыл бұрын
I don't see the full picture here. For me I see that on resume (from sleep_goto_dormant_until_edge_high()) some clocks are degraded by a factor 10 and the performance is also lost by this factor. It possibly could be seen in the tight loop if some "clock_get_hz(.. enumed clock.. ) was present. For me I also have core1 going and I don't know if that is messing things up.
@Lugeix
@Lugeix Жыл бұрын
Still too high for some function. The ESP can achieve 3uA at 3.3V = about 20uW. I was hoping to get the Pico W to that level to conserve battery.
@localixdots9698
@localixdots9698 4 ай бұрын
RP2040 Minimal achievable power consumption is 0.18mA in “Dormant” and 0.39mA in “Sleep” modes. See RP2040 datasheet, section 5.7 Power Consumption. Your consumption is 3 mA, why?
@tonysofla
@tonysofla 3 жыл бұрын
I prefer using mA and uA and not mW. So dormant mode is 180uA per data sheet, a little high as smaller MCU Cortex sleeps around 2uA-5uA. I guess the 264KB of RAM is the reason, they should had implemented the option to just have one bank on during dormant sleep. A 2000 mAh lipo and doing 98% sleep is still a year worth, as 2000*1000uA/180uA/24hrs = 416days of just sleeping and not taking it to account battery self-discharge.
@slimhazard
@slimhazard 3 жыл бұрын
The RP2040 chip on the pico does have the means to turn off SRAM and the USB DPRAM, see section 2.11.4 of the RP2040 datasheet. But there is no support for it in the SDK, other than the fact they provide structs that wrap the hardware registers, which you can use to set the necessary bits. Manipulating the registers isn‘t actually that hard, if you read the docs carefully to get it right; but it would be nice to have SDK code that gets it right for you. They mention in that chapter of the datasheet that you can also turn off the flash cache, but that it probably won‘t save you much power when it‘s fetching code from flash anyway. The sleep source code in pico-extras mentioned in the video has this comment: // TODO: Optionally, memories can also be powered down. So it looks like they released the pico and the SDK with some of the power-saving support on the SDK to-do list. More may be coming up in future versions.
@tonysofla
@tonysofla 3 жыл бұрын
@@slimhazard I see that dormant options is ram-static-mode, not power down mode , that if some ram banks complete loss of data was OK, could save more power if it was implemented.
@erdem--
@erdem-- 6 ай бұрын
​@@tonysofla MEMPOWERDOWN register actually disables all ram. But it is not possible to go dormant because all ram was power down a few cycles ago. If there was a way to set irq bits and mempowerdown at the same time, we can make a very low power rp2040. And i guess it is not possible to use external low voltage source for ram power.
@javiers.8274
@javiers.8274 24 күн бұрын
Share the code bro,…you should know programers are lazy (where they can). Nice video, thanks!
@bergflyer6499
@bergflyer6499 3 жыл бұрын
Nice video! Wish these sleep modes would be supported in the Pico Python SDK. Both, machine.lightsleep and machine.deepsleep don't seem to help much in reducing power consumption. My only effective way of reducing power consumption under Python was to reduce the MCU clock frequency. Going down to 10MHz, my Pi Pico board consumed 4.5mA, vs. 21.4mA at standard f(clk). But you need to make sure you crank it back up to 125MHz before your Python code finishes, to make the USB i/f work properly.
@conorstewart2214
@conorstewart2214 2 жыл бұрын
That’s probably a limitation of micro Python itself, does sleep work correctly on the esp32 using micro Python? The reason it doesn’t work at least with the pico is probably because it always needs to run the interpreter at all times, to decide what to do and it might be difficult but not impossible to sleep the interpreter too. They may have decided that anyone programming in Python doesn’t care as much about performance or power consumption which to be fair if you are serious about either then you’d use a compiled language like c or rust anyway.
@bergflyer6499
@bergflyer6499 2 жыл бұрын
@@conorstewart2214 Agreed, Low Power Apps might not have been high on the list when creating the MicroPython build for RP2040. However, the interpreter is an 'overhead' part of the Python script code that runs on the RP2040, not running as a separate thread. To resume a script after a sleep, the RP2040 needs an interrupt from either its Timer module or an external (e.g. GPIO) source. That's part of the current MicroPython implementation, so I can't think of a showstopper to make lightsleep() a real power saver function in MicroPython, including the clock switch to XOSC and back, like it's possible in C.
@DuyPham-eg2cc
@DuyPham-eg2cc Жыл бұрын
Thanks for doing this tests! Can you tell me what CMakeList file you write in it?
@sotw1610
@sotw1610 Жыл бұрын
I have the same question
@dragonofmissingno170
@dragonofmissingno170 3 жыл бұрын
I'm still wanting to get a few Pi Picos. They are starting to be more in stock at the nearest Micro Center which is about an hour away. (Depending on traffic) Just don't have the money to spend atm. Besides, I still have some ATmega based arduinos to mess with for lower processing projects. I do think it would be fun to turn a Pico into a fantasy handheld console instead of yet another emulation box. A decently fast SPI screen, some buttons, and a DAC should be more than enough. Maybe even an SD card port to load the "ROMs" from. Do you think the Pico would be powerful enough to have one core be the main loading and processing for games and the other create GBA like graphics and sounds?
@pro-nav
@pro-nav 3 жыл бұрын
If you have cheap PCB manufacturing and shipping available then you should definitely make a custom handheld gaming console like the ones sold by Adafruit. It would be a great project.
@LowLevel-TV
@LowLevel-TV 3 жыл бұрын
Yeah they became hard to get very fast
@Cptnbond
@Cptnbond 3 жыл бұрын
Quick question, which IDE are you using?
@LowLevel-TV
@LowLevel-TV 3 жыл бұрын
No IDE, just Sublime Text and a command line
@aratroniccnc
@aratroniccnc 3 жыл бұрын
Hi, what IDE you use for programming pico?
@LowLevel-TV
@LowLevel-TV 3 жыл бұрын
Just VIM and a command line :)
@ozanh
@ozanh Жыл бұрын
There is one thing. I'm trying to use this library but the problem is when the pico wakes up it starts running the code so slow, idk maybe processor slows down but definitely something happens. Does any one experienced this issue with a real world project? (Updated question, read below) Yes guys, keep in mind when the pico wakes up, clocks are not functioning well, here is the before after output Clock speeds before after Before sleep: PERI: 125000000 GP0: 0 GP1: 0 GP2: 0 GP3: 0 REF: 12000000 SYS: 125000000 USB: 48000000 ADC: 48000000 RTC: 46875 After wake up: PERI: 12000000 GP0: 0 GP1: 0 GP2: 0 GP3: 0 REF: 12000000 SYS: 12000000 USB: 0 ADC: 0 RTC: 46875
@_mwalker
@_mwalker 3 жыл бұрын
Perhaps this isn't as easy as I'd think (hope) it is, but how do you go about porting across libraries to run on Pico? E.g. I2Cdevlib or RF24.
@LowLevel-TV
@LowLevel-TV 3 жыл бұрын
It really depends what the library does. If its something simple like crypto or maybe an I2C parser then you can trick CMake into building it into your project. Anything that relies on hardware directly wont work. The pico-sdk links in parts of glibc, so if your library sits on top of that, youre good
@_mwalker
@_mwalker 3 жыл бұрын
@@LowLevel-TV take the I2Cdevlib for example. It's written predominantly for Arduino. There is libraries for specific chips with a I2C file that deals with read/write separately. Hence would it just be a case of altering this to use Pico I2C and including in CMakeLists, or is there something more that I'm missing? Apologies if this is an obvious question.
@wayland7150
@wayland7150 2 жыл бұрын
Yeah, don't port libraries, look for similar libraries on the pico. You will have to alter your program to use the pico libraries.
@kimrnhof107
@kimrnhof107 8 ай бұрын
WOW
@FirstLast-ih6ec
@FirstLast-ih6ec 3 жыл бұрын
What IDE do you use for the PIco examples?
@LowLevel-TV
@LowLevel-TV 3 жыл бұрын
No IDE, just Sublime Text and a command line.
@ObligedTester
@ObligedTester Жыл бұрын
Very interesting demonstration of the different sleep modes. However I think it is very difficult for the power supply to accurately measure and show real life current draw in this situation. The pico uses a onboard buck-boost SMPS which is probably operating at a frequency which can not be sampled by the psu current display. This might pose a risk to either over or under estimating the current draw
@gammaray4850
@gammaray4850 3 жыл бұрын
you can use "no-button-boot" in pico, that pulling pressing plugging process is very annoying.
@juanmontes8905
@juanmontes8905 3 жыл бұрын
someone can test if RTC is still working this Deep Sleep method? Thanks!
@anthonypeters1797
@anthonypeters1797 2 жыл бұрын
is this only in C?
@anthonypeters1797
@anthonypeters1797 2 жыл бұрын
how do i get this is python
@BrianG61UK
@BrianG61UK 2 жыл бұрын
Don't use a toy language. Switch to C.
@duckyblenderold
@duckyblenderold 2 жыл бұрын
@@BrianG61UK based
@amazingpower2761
@amazingpower2761 Жыл бұрын
you have had way too much coffee! duh, the sleep function is just a loop!
rust runs on EVERYTHING (no operating system, just Rust)
14:29
Low Level
Рет қаралды 214 М.
Turning a Raspberry Pi Pico into a GPU!
16:42
element14 presents
Рет қаралды 125 М.
Kluster Duo #настольныеигры #boardgames #игры #games #настолки #настольные_игры
00:47
VAMPIRE DESTROYED GIRL???? 😱
00:56
INO
Рет қаралды 7 МЛН
DID A VAMPIRE BECOME A DOG FOR A HUMAN? 😳😳😳
00:56
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 24 МЛН
Raspberry Pi Pico - PIO explained
50:01
Slador
Рет қаралды 31 М.
The Pi Pico has problems, so I made my own, the ProPico
7:17
Dmytro Engineering
Рет қаралды 38 М.
Raspberry Pi Pico W: Wireless Weather Station
17:13
ExplainingComputers
Рет қаралды 291 М.
Beginners Guide to I2C on the Raspberry Pi Pico (BNO055 IMU Example)
16:57
Learn Embedded Systems
Рет қаралды 76 М.
The Raspberry Pi Pico WAS Overrated! But that changed!
10:18
GreatScott!
Рет қаралды 613 М.
#370 Raspberry Pi Pico vs ESP32 (-S2) and STM32 Blackpill
15:53
Andreas Spiess
Рет қаралды 389 М.
Kluster Duo #настольныеигры #boardgames #игры #games #настолки #настольные_игры
00:47