Notifications
Clear all

ESP8266 Deep Sleep - The Darkness Returns

47 Posts
3 Users
4 Likes
1,915 Views
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

@inq I think maybe a math error?

0.019 mA (From experiment above for deep sleep at 3.3V, In the hibernation case, this is 0.003 mA)

Average Power Usage in One Hour

0.518937 mA/h = (12 * 150 + 3588 * 0.19) / 3600.  In the hibernation case:  0.50299 mA/h = (12 * 150 + 3588 * 0.003) / 3600

Shouldn't it be 

0.019 A (From experiment above for deep sleep at 3.3V, In the hibernation case, this is 0.003 A)

Average Power Usage in One Hour

 (12 * 150 + 3588 * 19) / 3600.  In the hibernation case:  (12 * 150 + 3588 * 3) / 3600

 

No, I have it right.  

19 micro-amps (or 3 micro-amps) is equal to 0.019 milli-amps.

I converted everything to milli-amps as most batteries seem to use milli-amp-hour like 2000 mAh instead of 2 Ah.  I guess for marketing reasons... 2000mAh sounds like your getting a lot more for you money than 2Ah.  🤣 

Marketers... don't you love them?!  The value add they have for a company!  OR that us, the dumb populace, need them?!

 

 

 

 

 

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@inq Um, ok, but what is this?

Screenshot 2023 11 09 at 09.01.46

vs this

Screenshot 2023 11 09 at 09.02.44

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

@inq Um, ok, but what is this?

-- attachment is not available --

vs this

-- attachment is not available --

That is a definite Inq FUBAR!  You may add it to your list.  But, in my defense, it is a typo error... the Math will bare out that I used 0.019 in the calculation.  😆 

image

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Ron reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@inq I see your answer is correct regardless of the typo in the formula. What I just discovered however is that even in the full power down scenario, the savings is only in the 2nd decimal position. the rounded answer for power off, hibernate and deep sleep is 0.5!!!

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@inq It's on the (very short) list.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@inq Now that I see the up time is by far the determination of battery life, two things come to mind.

1. Do everything possible to reduce up time power use including turning off unneeded parts of the board like BT and WiFi. Maybe wake every 15 to gather readings, but only transmit by WiFi once an hour. Or better still use LORA where possible.

2. Use a 'wake time stub' if possible to do some work so the module does not have to re-boot.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@inq What tools do you use to annotate with the yellow and red? I still can't find anything that is Ron friendly.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

@inq It's on the (very short) list.

You're very kind, but that's only because I don't air by hardware blunders as often.  As I've mention many times, I am only a cook-book, monkey-see, monkey-do hardware builder.  I also buy in bulk because I have an electronics-habit... I smoke 'em when I got 'em! 😎 

 

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Ron reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@inq You want to compare HABIT, a couple days ago I was in a convo re JST connectors. I decided to look at all my boxes of parts and discovered I have 3 boxes of them in addition to some bundles (4?) as well.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

@inq Now that I see the up time is by far the determination of battery life, two things come to mind.

1. Do everything possible to reduce up time power use including turning off unneeded parts of the board like BT and WiFi. Maybe wake every 15 to gather readings, but only transmit by WiFi once an hour. Or better still use LORA where possible.

2. Use a 'wake time stub' if possible to do some work so the module does not have to re-boot.

Yes, in those experiments above (and in the code) you'll see that I've got the WiFi off since I'll be using LoRa.  The ESP has like 270 mA WiFi spikes and average over 70 mA.  Turned off, as shown, was 15 mA. 

In the Swiss Guy video (I think) he did all the sensor reading and getting the packet data ready first, then turned on the radio.  He also used a static IP address for the WiFi connecting and that reduced the router connection time and DHCP/DNS interactions.

Since I'll be using LoRa, I won't have all that router hand-shaking going on.  My conservative thoughts now are that I'll send the data to the base station (RasPi w/ LoRa) and wait for a reply before going to sleep.  (There is no TCP ACK/NAK type confirmation with LoRa).  I'll also see how reliable it is.  If it is fairly reliable, I'll just go to sleep immediately after sending it.  I may be WAY under 3 seconds for an upload.

I wish I had an oscilloscope.  I've never been able to justify it for how little I'd use one.  Like here would be very nice to see the spikes and do tests with various experiments.  I know I'm missing all those spikes and transients with my little volt meter.  And little tests like the difference in power usage to say write some data to the flash memory or even running an intensive trigonometry function would be interesting.

But... I'd rather smoke parts than buy an oscilloscope.  😎 

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@inq I can't justify a real scope, but I can justify this https://amz.run/7IeG change to .com if needed.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@inq Thinking out loud here. Send LORA, sleep (light or deep) wake triggered by LORA board receiving the message else timeout and retry. I have no idea if the LORA board can do that but if it can that might save a bit.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

@inq I can't justify a real scope, but I can justify this https://amz.run/7IeG change to .com if needed.

You know... I think you're right.  For my needs, I don't need a physical interface / screen.  I'd prefer to have a Windows program interface anyway and save all that expense of electronics, case, displays and physical buttons.  Kind of like the Logic Analyzer I use.  Best $12 I've spent on this hobby!

image

But, I wouldn't know what specs I need to do the things I want.  I'm sure I'd buy one and the next day, need something faster or with more inputs.  

 

But, being of the older generation, my price sensitivity is getting out of whack with reality.  I remember as a kid, my Dad filling up the car on $0.25/gallon gas.  Now, my truck requires $150 to fill with diesel.  Would I get more satisfaction out of this gizmo than one tank filling?  Maybe, I just stay home more often.  🤣 

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

@inq Thinking out loud here. Send LORA, sleep (light or deep) wake triggered by LORA board receiving the message else timeout and retry. I have no idea if the LORA board can do that but if it can that might save a bit.

Unfortunately, as you pointed out, the UP time is far more significant to the battery life than the sleep time.  The ESP is only 15 mA... the LoRa up is over 120 mA.  I did download the full sheet on the LoRa and skimmed it and there does seem to be extra pins that might can do what you suggest.  I'll add that idea to the, curiosity check list.

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@inq There will always be a time, use case, whatever that a more expensive scope is needed wanted, but for a lot of stuff including what you just noticed with the wifi spike that windows scope is fine. I have a mini win box and a big screen just for the scope and logic analyzer, my Mac is not used for that.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Page 3 / 4