Tech Note 131 - ESP32/8266 Reducing Battery Load Hints & Tips

Поделиться
HTML-код
  • Опубликовано: 2 авг 2024
  • If your running your project on batteries then you need to employ as many techniques as you can to reduce power or reduce the processor run-time to a minimum, thereby spending as much time asleep as you can.
  • НаукаНаука

Комментарии • 69

  • @tonysicily2687
    @tonysicily2687 5 лет назад +5

    Another fantastic video, great pacing, great slides, and very clear VO. You have become my ‘Go to’ channel’ First time I have seen most of these tips, REALLY useful

  • @tycstahX
    @tycstahX 4 года назад +1

    I keep coming back. Explained so well!

  • @deangreenhough3479
    @deangreenhough3479 5 лет назад +3

    Once again, valid and well received advice. 🏴󠁧󠁢󠁥󠁮󠁧󠁿👍

  • @cad3175
    @cad3175 5 лет назад +1

    ..straight to the point, I love it, brilliant! :)

  • @mr.meticulous1241
    @mr.meticulous1241 3 года назад +1

    Excellent help! Succinct and easy to implement.

  • @modx5534
    @modx5534 3 года назад +1

    Very good video! You mentioned several things I did not know like switching GPIO only to output when needed. Thank you ☺️

  • @marcrives279
    @marcrives279 5 лет назад

    Really nice low power check list. Everything is there!

  • @marks_view1486
    @marks_view1486 5 лет назад

    Dave , many thanks for the tips - conserving power always a problem.

  • @rodrigosantos4160
    @rodrigosantos4160 3 года назад

    Extremely useful tips!!! Thank you so much!

  • @JosefZvolanek
    @JosefZvolanek 5 лет назад

    Much nice and helpful information!

  • @DocMicha
    @DocMicha 5 лет назад +3

    I never thought about serial, Thank YOU!

    • @G6EJD
      @G6EJD  5 лет назад

      Every little helps😊

  • @ChrisHalden007
    @ChrisHalden007 3 года назад

    Very useful indeed!

  • @sblantipodi
    @sblantipodi 4 года назад

    Love the Channel. Congrats

  • @wei48221
    @wei48221 4 года назад +1

    Thank you for the high quality tutorial video..

  • @davebeckham5429
    @davebeckham5429 5 лет назад

    Very nice tips. - many thanks for sharing.

  • @mareksukup9592
    @mareksukup9592 5 лет назад

    great - thank you for this advices

  • @alaskawoodman
    @alaskawoodman 5 лет назад

    Good ideas, nicely done

  • @prateekmahajan1929
    @prateekmahajan1929 4 года назад

    That's some good info 👍

  • @vtech8716
    @vtech8716 5 лет назад

    great Sir

  • @TOMTOM-nh3nl
    @TOMTOM-nh3nl 3 года назад

    Thank You

  • @plazmax
    @plazmax 5 лет назад

    Awesome

  • @eriklaken1025
    @eriklaken1025 5 лет назад

    Thank you, very usefull.:)

  • @rimbang_
    @rimbang_ 3 года назад

    Thanks

  • @EL90291
    @EL90291 5 лет назад

    Exactly what I was looking for my project, (automated chicken coop door)

  • @faridnubaili7917
    @faridnubaili7917 2 года назад

    Thank you sir

  • @hoereuh
    @hoereuh 4 года назад

    hi, ive googled, but didnt find, maybe u know, how fast can you go in and out of sleep to save power?
    lets say i do a bluetooth scan every 2 seconds, can i sleep for 1.5seconds? would that help save batterypower?

  • @GoatZilla
    @GoatZilla 2 года назад

    Delays in general are a bad idea but that's how Arduino is set up. However, if you use light sleep on at least the 8266, you actually need to have some delay in there for the power savings.

  • @tonysicily2687
    @tonysicily2687 3 года назад

    Oe of the best tutorials on this I have seen, not surprising, al, your vids are awesome.
    My I ask, is there a simple way to check the effects of these changes?
    Can I for instance, run the project for a day/week then measure something with a multimeter, make the changes, and re measure after the same time period?
    If so, do I measure the remaining battery voltage?
    Sorry for such a beginner question, but being such a newbie, is why I love your tutorials so much.

    • @G6EJD
      @G6EJD  3 года назад

      Yes that’s the best way of measuring the effect of changes, measure the voltage with a multimeter implement the change then wait the same time and measure again. The problem is to be really sure you need to start with the same battery voltage each time as the discharge characteristics of a battery are not linear. But you’ve got the idea on how to see the effect of changes.

    • @tonysicily2687
      @tonysicily2687 3 года назад

      @@G6EJD thank you very much sir, I really appreciate you taking the tine to get back to me personally. I understand-ish, the programming, but the electronics are a dark magic.

  • @johnpricejoseca1705
    @johnpricejoseca1705 3 года назад

    Thanks, David. Very useful tips. How much current is saved by changing a pin from an output to an input?
    Cheers!

    • @G6EJD
      @G6EJD  3 года назад

      It depends on the load attached and the pin state before the change is made. Say the pin was driving a load then it would be a function of the load impedance but could be in the mA range. Moving to an input places the pin into a high impedance state and so also prevents current flow (sink) into the device. It really does make a difference if your trying to get best possible power consumption from the device.

    • @johnpricejoseca1705
      @johnpricejoseca1705 3 года назад

      @@G6EJD thanks!

  • @markpieterse7785
    @markpieterse7785 5 лет назад

    nice tips. thanks. what about rater use RF instead of WiFi

    • @G6EJD
      @G6EJD  5 лет назад +1

      Mark, could use RF but the availability of robust protocols for RF modules (other than LoRa) is low thereby making their use questionable. They work just not as reliably as most people want.

  • @lalex65
    @lalex65 5 лет назад

    Clear as usual.
    I'm looking for a wakeup based on ADC value, it seems possible with ULP, did anybody use this ?

    • @G6EJD
      @G6EJD  5 лет назад

      laurent, ULP has to be programmed in machine code and what you propose is feasible so yes and there are some basic examples around. It may be possible to write the logic in C and assign the code to one of the cores (ULP) whole the other core sleeps, I have not tried that concept and don’t know if the constructs are available to do it.

    • @G6EJD
      @G6EJD  5 лет назад +1

      If you don’t need a programmed wake up voltage you could use a simple voltage divider that uses a gpio pin to wake up the main cpu or use a low power op-amp as a comparator and interrupt source for a gpio pin and with a variable resistor would allow a setting.

    • @lalex65
      @lalex65 5 лет назад

      @@G6EJD using only esp32 ADC is not mandatory but I feel this much more elegant

  • @zyghom
    @zyghom 2 года назад

    my experience: a sensor on ESP32 that measures temp, hum. lux and its battery:
    1- connecting to WiFi (static IP): anything between 2-5s, sometimes more than 10s
    2- getting time from NTP server: anything between 20ms-5s, sometimes not need for connecting so just ms, sometimes connection failed so timeout
    3- SHT31 sensor: max 50ms
    4- TSL lux sensor: 0.4s (max accuracy)
    5- ADC with 5000 iterations: 0.4s
    6- MQTT publish: < 0.5s
    now with regards to your advice:
    1- measuring voltage BEFORE wifi is connected shows different values as ESP without wifi connected is consuming much less current - so now the question is: more precise voltage measurement (when working) or less power consumption but "wrong" value - measure before wifi connected? I opt for measuring real voltage when wifi is ON
    2- 200kOhm is way too much for ADC on ESP32 - your multimeter will show good results but ADC on ESP will show much lower value - again: precision vs consumption
    3- my sensor takes from wake up to go to sleep anything between 3-10s, average is 5s, 90% of that time is wifi connect. Anyway, when wifi does not connect within 10s it is forced to go to sleep. Same for MQTT failures.
    4- reducing serial.print - I would go even another approach: for debugging turn on serial.print - for working turn off completely - recent video on another channel showed how to with 1 command
    anyway, thank you for your video and advice

    • @WistrelChianti
      @WistrelChianti 2 года назад +1

      for everything else,... there's mastercard

  • @quito96
    @quito96 5 лет назад

    Hello Dave, i´m very grateful for your tips. :-) I am a ESP newbie….is that possible that you give us a complete sketch example? In my current project I am desperate to get to the Wi - fi interface. Unfortunately I have no strategy for Wi - fi auto reconnect. Thanks for your input Guido

    • @G6EJD
      @G6EJD  5 лет назад

      quito96, the WiFi will already automatically reconnect for you if it looses a connection, the WiFi on /off functions are on screen and widely available but I’ll see what I can do, so you mean just WiFi on / off and connection improvements. If you look in my github at the epaper weather station v13 code you will see a function in there for WiFi off and a robust WiFi connection function, you just need to include copies of those in your sketch then call them.

    • @quito96
      @quito96 5 лет назад

      @@G6EJD I appreciate you for the tip and thank you for sharing your knowledge

    • @G6EJD
      @G6EJD  5 лет назад

      Do you have it running now?

    • @G6EJD
      @G6EJD  5 лет назад

      WiFi can be a little tricky but once you have some decent functions you’ll find its quite reliable.

    • @quito96
      @quito96 5 лет назад

      ​@@G6EJD not yet, i´am check your epaper ino file and later i must include it in my sketch…

  • @Dialbist
    @Dialbist 5 лет назад

    You can also specify the ip address immediately, and not receive dynamically.

    • @G6EJD
      @G6EJD  5 лет назад

      Yes, I did think of including that but in practice I’ve found it makes. Dry little difference over on instructables I did some tests and found it gained just a few mS, but it does depend on your wireless network and access point, mine are very fast and I can detect no difference.

  • @davidbrooks8621
    @davidbrooks8621 3 года назад

    Nice lecture. Only one remark about time saving in println(). The calculations for 115200 are wrong 😑. Only about 10 time faster. And not about 1000 times.

  • @tablatronix
    @tablatronix 5 лет назад

    Also do not Serial.begin() at all if on battery, if you dont need it

    • @G6EJD
      @G6EJD  5 лет назад

      tablatronix, yes sometimes we overlook the obvious! Thanks.

  • @JC-tr2kw
    @JC-tr2kw 4 года назад

    @G6EJD Great tips. I was a bit playing around with deep sleep and your tips regarding serial output crossed my mind when I saw the bootloader output. I thought it was quite wasteful to dump all that output every time it came out of deep sleep. So disabling might make sense: the behavior is described here: github.com/espressif/arduino-esp32/issues/642. thanks again for sharing your expertise

    • @G6EJD
      @G6EJD  4 года назад

      J C, yes it’s just wasted time printing to the serial monitor so disabling it by simply not initialising the serial (omit serial.begin() ) saves power!

  • @wandaniel4596
    @wandaniel4596 3 года назад

    it is very hard for me since im working with gps anti theft alarm system, pls david i really need help

    • @G6EJD
      @G6EJD  3 года назад

      Ok, what help do you need?

    • @wandaniel4596
      @wandaniel4596 3 года назад

      @@G6EJD i had develop motorcycle anti theft (vibration sensor) with neo 6m gps using esp32 embedded with sim800l (ttgo call) powered with 20000mah battery pack, the problem is i failed to use sleep mode and my system can only operate for 17hours(active mode all the way), i really dont understand how to use the sleep mode for my system, may i email you my coding? Pls sir i need guidance, im working alone and i had no one who can help me with this problem

    • @G6EJD
      @G6EJD  3 года назад

      @@wandaniel4596 Yes please do and I'll have a look for you. I'll add sleep too. contact me at g6ejd.dynu.com then contact. I should advise you that it's hard to make the GPS sleep not that you want it to so it knows where it is. A 20A/Hr battery should last at least 5-days or more, so something is drawing a lot of power, if your getting 17-hours from a fully charged pack then your circuit is drawing ~1.2A and that's the problem, not the sleeping.

    • @wandaniel4596
      @wandaniel4596 3 года назад

      @@G6EJD for the gps i add a relay, the gps is switch ON when needed only, ok sir i email you the coding, thank you sir

    • @wandaniel4596
      @wandaniel4596 3 года назад

      @@G6EJD sir i cannot find your email address through email, can you email me first? wandaniel94@gmail.com

  • @user-cr9fr2mk9i
    @user-cr9fr2mk9i 4 года назад

    Serial.begin(1500000); work on esp32

    • @G6EJD
      @G6EJD  4 года назад

      Слава Загайнов Maximum baud = 921600