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

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024

ความคิดเห็น • 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. 🏴󠁧󠁢󠁥󠁮󠁧󠁿👍

  • @mr.meticulous1241
    @mr.meticulous1241 3 ปีที่แล้ว +1

    Excellent help! Succinct and easy to implement.

  • @marcrives279
    @marcrives279 5 ปีที่แล้ว

    Really nice low power check list. Everything is there!

  • @cad3175
    @cad3175 5 ปีที่แล้ว +1

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

  • @GoatZilla
    @GoatZilla 3 ปีที่แล้ว

    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.

  • @ChrisHalden007
    @ChrisHalden007 3 ปีที่แล้ว

    Very useful indeed!

  • @zyghom
    @zyghom 3 ปีที่แล้ว

    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

  • @EL90291
    @EL90291 5 ปีที่แล้ว

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

  • @JosefZvolanek
    @JosefZvolanek 5 ปีที่แล้ว

    Much nice and helpful information!

  • @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.

  • @sblantipodi
    @sblantipodi 4 ปีที่แล้ว

    Love the Channel. Congrats

  • @faridnubaili7917
    @faridnubaili7917 2 ปีที่แล้ว

    Thank you sir

  • @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!

  • @mareksukup9592
    @mareksukup9592 5 ปีที่แล้ว

    great - thank you for this advices

  • @DocMicha
    @DocMicha 5 ปีที่แล้ว +3

    I never thought about serial, Thank YOU!

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว

      Every little helps😊

  • @TOMTOM-nh3nl
    @TOMTOM-nh3nl 4 ปีที่แล้ว

    Thank You

  • @prateekmahajan1929
    @prateekmahajan1929 4 ปีที่แล้ว

    That's some good info 👍

  • @vtech8716
    @vtech8716 5 ปีที่แล้ว

    great Sir

  • @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.

  • @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.

  • @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.

  • @eriklaken1025
    @eriklaken1025 5 ปีที่แล้ว

    Thank you, very usefull.:)

  • @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…

  • @plazmax
    @plazmax 5 ปีที่แล้ว

    Awesome

  • @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

  • @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!

  • @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 ☺️

  • @wei48221
    @wei48221 4 ปีที่แล้ว +1

    Thank you for the high quality tutorial video..

  • @rimbang_
    @rimbang_ 3 ปีที่แล้ว

    Thanks

  • @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?

  • @rodrigosantos4160
    @rodrigosantos4160 3 ปีที่แล้ว

    Extremely useful tips!!! Thank you so much!

  • @marks_view1486
    @marks_view1486 5 ปีที่แล้ว

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

  • @davebeckham5429
    @davebeckham5429 5 ปีที่แล้ว

    Very nice tips. - many thanks for sharing.

  • @alaskawoodman
    @alaskawoodman 5 ปีที่แล้ว

    Good ideas, nicely done

  • @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.

  • @СлаваЗагайнов-ъ4о
    @СлаваЗагайнов-ъ4о 4 ปีที่แล้ว

    Serial.begin(1500000); work on esp32

    • @G6EJD
      @G6EJD  4 ปีที่แล้ว

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

  • @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