I love the recaps... it prevents my memory from forgetting things and at the same time it's nice entertainment! Enjoy the summer holidays.
@AndreasSpiess2 ай бұрын
Thank you. Currently, I am at Def Con in Las Vegas😁
@PhG19612 ай бұрын
@@AndreasSpiess Awesome! Have fun there!
@techiesms3 ай бұрын
Thanks for this video. A lot of new learnings for me in a single video
@ManasChachra2 ай бұрын
hey buddy , been seeing ur videos for a while. just wanted to ask whether ordering things from china is safe or not, and which site or place to order from
@AndreasSpiess2 ай бұрын
Glad to hear that!
@AndreasSpiess2 ай бұрын
Glad to hear that!
@nezbrun8722 ай бұрын
The Nordic Power Profiler II is an absolute game changer if you're into low power microcontroller applications, especially those with widely varying current draw. Its USP is its unique current measuring method, using a series of comparators to dynamically change current range, thus offering a huge dynamic range. Thus, burden voltage issues inherent to traditional static shunt resistor current measuring methods are no longer a problem.
@AndreasSpiess2 ай бұрын
I agree. However, you also get other such devices. But more expensive.
@austinhiggs72572 ай бұрын
@@nezbrun872 I agree. I bought one of these at Andrea’s’ recommendation and it does not disappoint. I use it any time I’m developing any kind of project where power is a concern. I have just started using the digital inputs and decoding features.
@nezbrun8722 ай бұрын
@@AndreasSpiess As well as the Power Profiler II, I have a couple of SMUs and an Otii power analyser. The Power Profiler II is used almost on a daily basis. The SMUs maybe once a month. The Otii: I used it once and it's sat in a drawer ever since, its current measurement in the single digit uA range and lower is so noisy it's useless. The Power Profiler II is 1/6th the cost and offers a far better real time low current (ie, under 5uA) analysis than the Otii. My point is that the Power Profiler II's auto ranging implementation to increase dynamic range is unique to it as far as I am aware, certainly at the price point.
@itaynave57702 ай бұрын
Link please
@dougbas39803 ай бұрын
Enjoy your summer 👍
@AndreasSpiess3 ай бұрын
Thanks, you too!
@innomkr2 ай бұрын
Thank you for the amazing video! I would love to see more videos on using low power modes with different MCUs!
@AndreasSpiess2 ай бұрын
I do not use many other chips...
@grimtagnbag2 ай бұрын
Yes sir thank you again. Once again you are in my head. I’m playing with solar and power consumption has been on my mind. I do need WiFi and was wondering but don’t have all the toys to know. Love it.
@AndreasSpiess2 ай бұрын
Rock on!
@mikejones-vd3fg2 ай бұрын
Another tip to save power - desolder the power LED. That thing takes 10x more power then the MCU does in deep sleep. thats what eating your battery, that tiney led!
@MrThinking4myself2 ай бұрын
Good tip! Thanks!
@martyb37832 ай бұрын
This is very good information. I am new to the ESP32 and am considering using it in a few projects as apposed to my current use of Raspberry PI, which I am familiar with and have been too lazy to learn another single board computer or microcontroller. Thanks for this and your other videos. You explain things very well.
@AndreasSpiess2 ай бұрын
You will like it! Raspberry Pis sometimes are too big...
@phasemargin16 күн бұрын
Very thorough treatment of power consumption topics on ESP32 - thank you! A companion topic of power source selection would compliment this topic: from battery and multi-battery strategies to achieve a target battery life for a given application, on up to solar or other recharge subsystems.
@AndreasSpiess15 күн бұрын
Indeed a wide area. I did videos on various aspects like solar already.
@phasemargin14 күн бұрын
@@AndreasSpiess wonderful, I will search some more through your extensive posts. Any favourites video numbers that you recommend to pair with this sleep topic? The coin cell video was very insightful, for example. Thank you for your videos - very inspiring.
@flyviawall40532 ай бұрын
There's also a ULP co-processor and RTC memory you can use, a very low speed CPU but full capability, consuming power in nA range. For real-world application you would want the ULP to listen to peripherals(with no interrupt capability) and wake the main CPU in certain criteria. But realistically if you are doing very tiny application and you can bit big everything in a slow clock, you can put your whole code into ULP.
@AndreasSpiess2 ай бұрын
You are right. I once made a video about it ;-)
@jamesmichener75262 ай бұрын
Another great video! THANKS!
@AndreasSpiess2 ай бұрын
My pleasure!
@PatricAeberhard2 ай бұрын
Thank you very much! Exaclty what I needed and KI didn't knew yet. From another guy with a swiss accent.
@AndreasSpiess2 ай бұрын
My pleasure!
@AJB2K33 ай бұрын
Always useful and interesting and just shared it to a group.
@AndreasSpiess2 ай бұрын
Thanks for sharing!
@fersunk2 ай бұрын
I worked in my last job with a battery operated ESP32 project that reads the information from a magnetic sensor and send it using LoraWAN, and my calculations to hit the needed battery life were sub 100uA on standby, but that budget were ESP32 + sensor + lora radio. I used the IDF to program it, Arduino is useless for any serious task that implies a micro that isn't Atmel. All the fun stuff to manipulate the hw of the ESP is behind IDF. And there's a lot of HW design to hit a good low sleep power consumption. Of course the ESP32 hides a lot of quirks that needs to be addressed in the final design.
@AndreasSpiess2 ай бұрын
Fir professional projects, the IDF is a good choice. However, it works only for Espressif chips.
@gepetotube3 ай бұрын
Great video. I was not aware you can do all these.
@AndreasSpiess2 ай бұрын
Thanks for watching!
@lollonelollino15492 ай бұрын
Amazing content!
@AndreasSpiess2 ай бұрын
Glad you think so!
@wjn7772 ай бұрын
The video was useful and interesting, thank you for sharing
@AndreasSpiess2 ай бұрын
Glad you enjoyed it!
@Ed196013 ай бұрын
great info. I was under the impresion that "WiFi.setSleep(true);" was enough for modem sleep, but i could be wrong. I do not use the ESP32 for sleep projects that often
@AndreasSpiess2 ай бұрын
Maybe things changed. This is a replay video.
@Chris-ut6eq2 ай бұрын
looking forward to your fall updates. Would love a recap of dev24 highlights as you see them. Also what chips you recommend for hobbyists. plus whatever else about esp32 in 2024.
@AndreasSpiessАй бұрын
I did not film at Devcon because they do not like it and had strict rules. Some people even were masked to protect their identity...
@DuroLabs853 ай бұрын
10:10 WiFi.mode works for me with ESP8266 even at 80Mhz. I had a project where the esp fetches time from a LAN NTP server and then updates it if the clock hits 11.30Pm the modem turns off and the internal timer starts and the wifi turns back on at 6.30Am in the morning. Never got a chance to try the command with an ESP32 though. It reduces the consumption from 130mA to just around 20mA and the esp8266 is still running everything else in the code. ADC measurements to. But I faced a issue with ESP8266 is that you cannot use the ADC too much when using WiFi so the ADC update rate is around 10S or so.
@AndreasSpiess2 ай бұрын
The ESP8266 has a standard clock speed of 80MHz. So, everything should work as designed.
@evilkittyofdoom1953 ай бұрын
Fantastic!
@AndreasSpiess2 ай бұрын
Glad you like it!
@4bSix86f612 ай бұрын
RIP C18 on the esp [5:38]
@AndreasSpiess2 ай бұрын
You are a good observer!
@pitacotavo59382 ай бұрын
I have a suggestion, measure the time that every microcontroller you have takes to register an input, like a button. I saw a video of you doing it for stm32 and esp32, but I can't find it anymore! New microcontrollers like rp2040 will be awesome. It's important for gamers to have the most low delay microcontroller. Thanks!
@AndreasSpiess2 ай бұрын
The reaction time of such microcontrollers is way below 1 millisecond. So this is hardly an issue for your application. However, what they do with this information usually takes much longer.
@ismylhakkituran2 ай бұрын
Thank you very much for the helpful video. I was wondering, what could be the reason why Wi-Fi doesn't operate at frequencies below 80 MHz? How can the Wi-Fi module inside transmit symbols at such high frequencies (like 2.4 or 5 GHz) during the transmission stage ? Is the frequency required for radio transmission supplied from another source ?
@AndreasSpiess2 ай бұрын
The 2.4 GHz signals are produced in a radio module. The MPU has a different clock. I do not know if they are interconnected.
@zyghom2 ай бұрын
there are commands you can use within the runtime - not in overall: setCpuFrequencyMhz(10); - 10 MHz etc but to make Serial working: // Serial has to start again after CPU frequency is changed Serial.flush(); Serial.end(); setCpuFrequencyMhz(10); Serial.begin(115200);
@AndreasSpiess2 ай бұрын
Thank you for the info! Valuable!
@Cyklonus2 ай бұрын
Nice, but for battery-powered projects I prefer to use nRF24L01. I make sensors with one AAA battery on them and it works for a few months.
@AndreasSpiess2 ай бұрын
Also, a good idea when you do not need an internet connection.
@johnwiltson31643 ай бұрын
thank you 👍
@AndreasSpiess2 ай бұрын
No problem!
@phlexy2 ай бұрын
Are you going to do Pico 2 review?
@AndreasSpiess2 ай бұрын
I am not sure. There are already many such reviews out.
@phlexy2 ай бұрын
@@AndreasSpiess But there are none that go into improvements of deep and lightsleep and it seems to me you are the expert for power saving.
@SA-oj3bo2 ай бұрын
I would like to see how the ESP can actually sleep at minuimum current of only a few micro-amps and wakes up by triggering an input, like a sensor contact. The datasheet mentions it can be woken up when just consuming a few microamps, bit I never saw someone doing and proving this.
@fersunk2 ай бұрын
In my last job I was working with a ESP32 on battery and the requirements were like 1yr of standby. I used the ULP to wake up the main processor when the ULP detected an interrupt from a magnetic sensor. Not only doing fw magic but also a lot of hw design is needed to hit micro amps and a good sleep
@SA-oj3bo2 ай бұрын
@@fersunk so in your opinion without ULP it is not possible, even when the datsheet mentions a few uA? Power consumption in Deep-sleep mode is 10 µA, here they mean the ESP32 not the ULP right? 10uA would be perfect for battery mode... but I never saw someone succeeding in reaching only 10uA. Strange... hopefully Andreas will figure it out in the next video's.
@AFSMG2 ай бұрын
Excelente
@AndreasSpiess2 ай бұрын
Thank you!
@Grrr20482 ай бұрын
Interesting as always, would the power consumption during deep sleep be lower if the clock frequency was set to 10mhz?
@AndreasSpiess2 ай бұрын
No
@Grrr20482 ай бұрын
@@AndreasSpiess 🙄
@ddlsmurf3 ай бұрын
I think there was confusion about modem sleep. It's supposed to keep the modem alive while letting the cpu sleep, this maintains connections etc. It requires an external 32khz square wave iirc, and obviously doesn't make any sense to use without wifi. It's meant to let the modem wake up and just do the wifi book-keeping stuff.
@AndreasSpiess2 ай бұрын
I don't know if this is a new definition used by the new WiFi 6 functionality of some chips.
@ddlsmurf2 ай бұрын
@@AndreasSpiess it seems youtube won't allow me to reply with links, but no, i'm very far from any risk of being too up to date, this was how it worked when esp32 was new, without need for ancs/ble (see watchy) it's not useful, the esp32 will never be a great device where power is at a premium, but still
@emmoemminghaus64552 ай бұрын
@Andreas The Wifi library... its compiling... amazingly it works on ESP... But only WIFI, so now you can add lowpower modes to the list of things not working with the Arduino Wifi class. (Just use the IDF functions for wifi and you might get a better result)
@AndreasSpiess2 ай бұрын
Thanks for the info!
@BerndRenzing2 ай бұрын
Thanks, Grüße aus dem Ruhrgebiet
@AndreasSpiess2 ай бұрын
😁
@MeisterQ2 ай бұрын
I have 2 questions in this: 1. I cant use wifi, but can i use ESP now with lower clockrates than 80MHz? 2. Is there a way to keep the pin state on HIGH during deepsleep? Thank you for this videos
@AndreasSpiess2 ай бұрын
1. Yes 2. I do not know. I never used it :-(
@MeisterQ2 ай бұрын
@@AndreasSpiess Thank you
@Vraj31102 ай бұрын
Hello please make video on waveshare RP2040-ETH board it will be helpful regards
@AndreasSpiess2 ай бұрын
This seems to be a rather standard MCU board with an Ethernet plug. So nothing for a particular video on this channel :-(
@fullpower83822 ай бұрын
Erst mal ein Like!! ...
@AndreasSpiess2 ай бұрын
Danke!
@belalmohammed22653 ай бұрын
The problem with the sleep function in esp32 is the cpu resets from the beginning again, which makes it very hard to save power, unlike arm processors.
@AndreasSpiess2 ай бұрын
I agree
@dunnyroll36463 ай бұрын
It's disappointing that the ESP32 doesn't support low power BLE operation like the NRF chips.
@mikejones-vd3fg2 ай бұрын
i thought the c3 did blue tooth low power
@AndreasSpiess2 ай бұрын
I did not check the newer chips for power consumption. The old ones were horrible for BLE
@hexidev3 ай бұрын
Is this a reupload?
@markusm.45563 ай бұрын
Yes, as Andreas mentioned in the video description. Re-upload of video 410.
@ericmintz83052 ай бұрын
Off topic but important: WiFi uses persistent memory. Your program will crash if you disable it. I learned this the hard way.
@AndreasSpiess2 ай бұрын
Interesting. I did not know that.
@DAASSIv22 ай бұрын
As I understood in the documentation ModemSleep is nict a sleep mode, it ist just the mode, when the modem ist not working active, so it is in general turned on (initialised WiFi or BT) but is nocht sending or receiving. I researched for this a while ago for very long, because its very confusing
@AndreasSpiess2 ай бұрын
Modem sleep sleeps the radio. So no receiving or transmission
@klassichd102 ай бұрын
Thank you for your effort to achieve low power AND Wifi. I gave up. Hoping for a Zigbee solution combining Zigbee data transfer with epaper display.
@AndreasSpiess2 ай бұрын
I switched to ZigBee wherever possible. But only with commercial devices. I fear the ESPs will consume too much. But so far, I did not try.
@klassichd102 ай бұрын
@@AndreasSpiess Yes, Zigbee uses e.g. CC2530 which seems to have limited programming support.
@TheAstronomyDude2 ай бұрын
So if my esp is in full beans mode (240mhz + wifi) then I should reboot it without initializing wifi and then enter deep sleep mode?
@AndreasSpiess2 ай бұрын
That depends on what you want to do with it...
@kbce2 ай бұрын
How about the esp32's which have dual cpu (like the standard esp32). Doesn't the wifi run on a dedicated cpu? Can you put the other processor in deep sleep and keep wifi connected? Or do all cpu have to be in the "sleep-state"?
@AndreasSpiess2 ай бұрын
Both cores sleep.
@thomashuyghebaert56222 ай бұрын
If the clock speed is reduced then the code takes way longer to run. Judging by the area below each section of the measurements at 8:30 it looks like the most milliwatthours have been consumed at the lowest frequency of 10MHz (the total area looks way larger than at 240MHz in my opinion) Would it be fair to say that the current is in fact lower but battery life would be worse? Or am i missing something
@AndreasSpiess2 ай бұрын
You are correct if the processor is fully loaded. However, microcontrollers often wait for a very long time and then react to a signal. Then, a lower clock makes sense.
@michaeleitel71863 ай бұрын
Are you sure that you use hardware based i2c? I think with your implementation you use bitbang. I think I had interferences with f.x. wifi when using any kind of bitbang. Similar with one wire for less. m5c
@AndreasSpiess2 ай бұрын
I am pretty sure.
@AndreasSpiess2 ай бұрын
I am pretty sure.
@retokaderli90103 ай бұрын
Could You get Serial (USB) with Light sleep working? No problem with Serial1, but USB ... seems not working after Light sleep
@AndreasSpiess2 ай бұрын
I never tried.
@Чумак-щ8и3 ай бұрын
Nice
@AndreasSpiess2 ай бұрын
Thanks!
@underwoodblog3 ай бұрын
does the ESP8266 behave the same with WiFi.mode( WIFI_OFF );?
@DuroLabs853 ай бұрын
Yes. ESP8266 Works with the WiFi.mode command
@sulcusulnaris3 ай бұрын
I need Deepsleep myself... only have modern sleep waking up every x hour.
@AndreasSpiess2 ай бұрын
Not good! Deepsleep definitely is better
@richonguzman2 ай бұрын
great timing :P CA2RXU, 73!
@AndreasSpiess2 ай бұрын
73 from Vegas!
@KC-nd7nt3 ай бұрын
Oh cool
@AndreasSpiess2 ай бұрын
👍
@leocurious99192 ай бұрын
You keep mentioning "no WiFi" power consumption down to 10 MHz. But WiFi does not work there, as you say at the beginning? So one should really avoid this and instead turn it off? to reduce the current draw to 1/7 of the WiFi-On-value.
@AndreasSpiess2 ай бұрын
I made this video a few years ago (this is a replay during my summer break). I do not remember all the details anymore, but as you write, WiFi does not work on low clock frequencies. Maybe the radio still consumed power but was useless...
@RommudohDev2 ай бұрын
5:39 C18 is not happy?
@AndreasSpiess2 ай бұрын
You are a good observer!
@wolpumba40992 ай бұрын
*Summary* ## ESP32 Energy Saving Modes Summary Here's a summary of the video's key points about optimizing your ESP32's energy consumption: *General Tips:* * *(**00:00:00**) Use optimized hardware:* Standard ESP32 Dev boards are power hungry. Use optimized boards, your own PCB designs, or a barebone ESP32 module. * *(**00:10:05**) Disable unused features:* If your project doesn't need Wi-Fi or Bluetooth, avoid enabling them. *Clock Rate Optimization:* * *(**00:02:23**) Reduce CPU frequency:* You can significantly decrease power consumption by lowering the ESP32's clock rate from the default 240MHz. * Reducing to 160MHz or 80MHz offers substantial savings without impacting most sensors and with full Wi-Fi/Bluetooth functionality. * Going below 80MHz requires adjusting serial console speed and impacts Wi-Fi/Bluetooth. * Remember that lowering clock rate reduces processing speed. * *(**00:13:39**) Adjust clock rate dynamically:* You can change clock frequency within your sketch depending on the task. * *(**00:10:01**) Note about Modem Sleep:* The presenter couldn't verify clear benefits of this mode and suggests avoiding it for now. *Sleep Modes:* * *(**00:14:19**) Light Sleep:* * Acts like a delay with lower power consumption (around 1.5mA). * Suitable for replacing delays when Wi-Fi/Bluetooth are not in use. * *(**00:15:15**) Deep Sleep:* * Most effective power saving mode, consuming only microamps. * Requires careful management of peripherals and memory as the ESP32 reboots upon waking. * *(00:15:32) * Disabling the ULP (Ultra Low Power) and RTC memory can further reduce power consumption during deep sleep, but eliminates persistent data storage. *Overall:* * *(**00:15:54**) Testing is key:* Verify functionality after implementing power saving techniques. * *(**00:15:54**) Choose strategies that fit your needs:* Balance energy efficiency with functionality and project requirements. I used Google Gemini 1.5 Pro to summarize the transcript. Cost (if I didn't use the free tier): $0.1242 Time: 90.62 seconds I added a 60 second delay to prevent a rate limit of the free tier. Input tokens: 32723 Output tokens: 923
@muctop173 ай бұрын
9:07 nearly 600mA !
@AndreasSpiess2 ай бұрын
You are right!
@holgerschurig44302 ай бұрын
I'm a programmer ... since almost ever. And I always hate when people talk about "sketches" instead of "programs". Maybe it was a marketing stunt from Arduino, to make µC programming accessible to non-programmers by coloring the bike-shed in a different color. But do we need this to non-Arduino programs?
@technoman90002 ай бұрын
I still cringe when people call them "apps" instead of programs... But I think that battle has been lost
@hagopboghossian68412 ай бұрын
If you are using arduino ide for mcu programming, maybe it takes 1 hour but in embedded c or others will take you maybe whole day or longer. You have to read the datasheet, and every mcu has its own datasheet. 😫 and sometimes you need someone to help you. can't do it by yourself "Arduino ide help you a lot if we lost arduino. We regret I telling you.
@DVSProductions2 ай бұрын
Maybe they made the distinction because the sketch is not a full program. It's a part of it but all your functions are being called by the actual main program running on the controller
@y2ksw12 ай бұрын
As far as I recall, there was a discussion about how to call the code. I personally find the choice horrible.
@tin20012 ай бұрын
@@technoman9000 "App" to me means a small program for a touch screen phone or tablet. My brain grinds gears trying to process when someone calls desktop Microsoft Excel an "app", as I try to work out if they mean on a phone or their computer.