We only have DS18B20âs here and I donât think they have any âsleepâ options.
I have read about some BMEâs having âsleepâ features but not sure which models and how it is done but big G will have the details.
If you havenât done any BME tweaks then the figure I quoted of 1.75 hours per battery ârunning timeâ over 3 weeks is likely to be considerably understated i.e. connected sensors will be drawing power during the ESP deepSleep.
See the difference between â2600â and the â4000â batteries?
A single 4000 lasts approx. 10 days based on the 3 weeks you quoted for 2 batteries. So if it actually had power of 4000mAh it could in theory run for around 40 days.
When I did the 1.75 hrs calc I used 5 sec duration to allow for time before and after your sketch runs the millis() calc.
On reflection this could be more like 10s and that is what I have used for the super â2600â.
So 10s/(10s +720s) means ON for 1.4% of the time and OFF for 98.6%. 1.4% of 1 hour is 0.014 hours.
During short power up cycles ESPâs can draw 300mA (70mA on longer run cycles). So using 300mA and 0.014 running hours per hour it might draw 4.2mA per hour.
All batteries are different and for example the 18650âs generally fail to run an ESP much below 3V from their initial 4.2V (3.7V nominal).
2600mAh / 4.2mA is a theoretical 619 clock hours or around 26 days.
Notes.
Calcs exclude the power used during deepsleep which should be very small but does have some effect over the longer term.
Assumes no power used by sensors during deepsleep and they can draw quite a bit if they are not themselves in sleep / low power mode.
I was bottom of my class in Physics at college, but top in numeracy, so this might all be wrong
There are some articles on GitHub where a MCU is used as a power switch to an ESP and this way you can be pretty sure that the power used including connected sensors is virtually zero when the MCU is sleeping.
You should consider using HTTP API for sending data to Blynk cloud, when you only need send data from hardware.
In this case you can sleep as much as you need, collect data, and than even âbulk data uploadâ API is available, if you donât want to connect to network EVERY time!
It you want to control the thing, there are multiple options:
Best of all, use Bluetooth LE for direct connection.
Youâll have to carefully pick hardware and controller, so it can sleep correctly.
If you still want to use cloud, then use normal Blynk library or HTTP API, but in this scenario:
Connect
Use sync API to get values update
Disconnect and sleep for some time
Restart from beginning (or restart controller)
In most cases, low power modes are very tricky to get right, and should be considered implementing mostly for commercial applications, or by very experienced hobbyists
Guys, just a small advice⌠Very careful when you buy batteries from Ebay or AliExpress, I strongly recommend you not to do it. Please, go to your electronics store at your neighborhood and buy with confidence.
Im in the process of creating a 3.6v battery bank. I need an ESP to run every 2minutes during day hours for just a few seconds, run from multiple 18650âs and charge using a 5v 250mA solar panel.
Im running in to issues with battery capacity.
I also bought cheapo chinese cells which were marked at 4000mAh (but prob more like 900-1100mAh im guessing).
My current solar setup is as follows:
Solar panel array (2x 5v 250mA in parallel = 5v 500mA)
â>
1v-5v booster (to ensure always 5v going to charger even in low light or shade)
â>
TP4056 Lithium charger module (batteries attached here)
â>
1v-5v booster (to boost 3.7v to 5v going to ESP)
â>
ESP8266 NodeMCU Clone
I have run this for 8 hours on 1 battery during daylight hours, but as soon as the sun starts setting, the batteries stop charging and thus runs the battery flat within about 30min.
This is WITHOUT using deep sleep and updating the server every 30 seconds.
If this fails, I might just invest in a larger solar array and lead acid 12v battery system but like the idea of micro solar builds.
I assumed running the wifi/blynk connection was draining the battery.
OR my battery capacities are FAR lower then expected.
The battery is constantly at 3.9v when the solar panel active even in shade.
It drops slowly over time once the panel is removed. Roughly 30-40 min and it will be down to 2.9v and then the ESP shuts down.
Yup, 5-6v during peak sunlight on the panels. Even the current was running at around 550mA.
Once it goes in to the booster, it comes out regulated at 5v @ 500mA.
The âchargeâ led on the TP4056 is constantly fully lit (i take that as its charging well).
You should run the esp on just the battery, not connected to all your boosters and chargers and stuff, to establish baseline energy consumption of the nodemcuâŚ
(or reconsider using those batteries!)
Opps, i forgot the nodemcu uses 5V? Maybe the âboosterâ is eating power?
Funnily enough⌠just watching a few youtube videos testing the same Ultrafire chinese 4000mAh batteries I ahve and theyâre coming out between 500-800mAh⌠so pretty sure I will need to stack these batteries in parallel to get the capacity up!
very good advice! Thank you!
Can you tell me some other details on BT LE system? I send the data, but how can manage the âgatewayâ that have to receive the BT from a lot of things? There is any example?
My project is to have simple IoT sensor on battery, using deep sleep functions of sensors plus esp/arduino
After a lot of searching on the web, I add some usefull workaround for ESP on battery:
using an RTC that wake up the ESP (RTC draws ~ 1.2 uA)
attiny
both method doesnât resolve the real problem of ESP on battery that is the time to go on and send data then come back to standby (80ma about for 5-10seconds)
This is exactly what I want to do - batch update a Blynk server.
I want to just wake the ESP to read the sensors, store the data, go back to sleep then maybe every hour update the sever with all the readings taken.
I search for the Blynk HTTP API and if Iâm honest I donât understand how to use it, I am a self taught cut and paste developer that can achieve most of what I need but generally need a snipet of example code to start with.
How do I âpushâ if thatâs the right term the data to the server (my own local server on a Raspbery Pi)
Actually if you use solar panel without proper charger device, solar panels cant correclty charge battery with TP4056. panel voltages dropping to 0.2v when sun is not enough to charge and its not re-charging battery when sun is high again.
Where do you find the bulk API upload? Iâm not seeing it in the Blynk HTTP RESTful documentation or anywhere in the simulator. I also tried to add a new parameter to the API GET and it doesnât work. Please help.