nodemcu on battery

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
countcobolt
Normal user
Posts: 32
Joined: 12 Jun 2017, 11:12

nodemcu on battery

#1 Post by countcobolt » 24 Jun 2018, 17:48

Hi all

I am trying to run an outside sensors. I am using a nodemcu with a home-brew shield with a DHT22. I have put 2 3.7V Lipo batteries in series (averaging to 6.XV) and connect this to VIN and Ground. Unfortunately, I noticed that the sensors is eating out the batteries very fast. I can only run the sensor for approx 6 hours and then it dies (started with 5.8V , ended with 2.7 on 1 battery, 0 on another.)

My question: how do you connect the battery? To VIN or to a 3.3V input/output? If you connect to a 3.3V, how do you make sure that you have 3.3V continuously? Are you using a board in between or something else?

Kind regards

Steve

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: nodemcu on battery

#2 Post by TD-er » 24 Jun 2018, 19:56

Do you use deep sleep on the ESP?
If not, then it is no wonder it depletes the batteries so fast.
Running idle (with WiFi on) the ESP may take about 80 - 90 mA at 3.3V
Since the standard voltage regulator on the NodeMCU boards is only a linear one, the board will take 80 - 90 mA @ Vin.
So that's 480 - 540 mAh in 6 hours.
Is that about the capacity of the used cell?

Also discharging a Lipo cell below a certain threshold will damage the cells.

countcobolt
Normal user
Posts: 32
Joined: 12 Jun 2017, 11:12

Re: nodemcu on battery

#3 Post by countcobolt » 25 Jun 2018, 08:26

hi TD-er

I am running it in deep sleep.Was testing with 10 minutes sleep. When I measured it , when connecting to VIN (and not 3.3V) it uses about 180mA... I think the capacity of the batteries are 4400mAh. So roughly calculating, I am coming to about 22 cycles on 1 battery (or about 5 hours). In series, I would assume I have 8800 mAh. Still that only gives me about 7 hours.

I also think I already damaged 2 batteries as they literally have 0V and charging no longer works. I ordered the Polulu step up/down convertor to 3.3V. Hopefully this will help running on a single battery.

Any ideas on how to reduce the Amp usage?

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: nodemcu on battery

#4 Post by wim16 » 25 Jun 2018, 10:39

I think the best way to reduce power consumption is to use a ESP directly instead of NodeMCU.
The NodeMCU has some components (voltage regulator, UART) that consume power even when the ESP is in deep sleep.
If you don't want to use the regulator you should use 3.3V input and not Vin.

See also: https://tinker.yeoman.com.au/2016/05/29 ... revisited/

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: nodemcu on battery

#5 Post by Wiki » 26 Jun 2018, 14:05

Hi,

I am running outdoors a wemos D1 mini with the ultrasonic distance sensor HC-SR04 and an ina219 monitoring the battery state. Deep sleep 30 mins, one 3000mAh 3,7v battery, this one: https://www.ebay.de/itm/162761356714 as protection and charging circuit, this one: https://www.aliexpress.com/item/Freeshi ... 4c4dH28pB4 as step-up converter connected to the 5v-pin of the wemos. The SR04 draw a huge quiescent current, so I switch its vcc with a transistor over GPIO, the ina219 is connected directly to its own GPIO as power supply. Going to sleep, the sensors are both switched off.

The protection/charging circuit prevents my battery from deepcharge, domoticz gives me an alarm if the voltage of the battery gets lower than 3.2v and therewith a chance to change the battery on time. With this combination the wemos runs at least for 20-30 days.

I have currently ordered another stepup: https://www.aliexpress.com/item/mini-60 ... 4c4dPcPyE7 which might extend the battery life to asumed 90 days.

[edit]
The battery is soldered directly to the protection circuit, because the battery holders using springs produce a significant voltage drop. the output of the protection circuit I have connected to the wemos using a molex plug, the battery I have put together with the protection circuit in this housing: https://www.thingiverse.com/thing:2798479
[/edit]

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

countcobolt
Normal user
Posts: 32
Joined: 12 Jun 2017, 11:12

Re: nodemcu on battery

#6 Post by countcobolt » 03 Jul 2018, 16:16

Hi,

I connected the polulu to the V3 in and with a full battery it now runs about 24 hours. I believe my battery is 4400mAh. Currently my NodeMCU wakes up every 10 minutes. Considering it is only working approx 3 minutes per hour, this is 540mA. This result is a bit more less than 9 hours. Is there a way to expand that time? Can I connect 2 batteries in parallel, because I have been reading a lot of horror stories on potential fire hazard.

waspie
Normal user
Posts: 127
Joined: 09 Feb 2017, 19:35

Re: nodemcu on battery

#7 Post by waspie » 03 Jul 2018, 16:41

countcobolt wrote: 03 Jul 2018, 16:16 Hi,

I connected the polulu to the V3 in and with a full battery it now runs about 24 hours. I believe my battery is 4400mAh. Currently my NodeMCU wakes up every 10 minutes. Considering it is only working approx 3 minutes per hour, this is 540mA. This result is a bit more less than 9 hours. Is there a way to expand that time? Can I connect 2 batteries in parallel, because I have been reading a lot of horror stories on potential fire hazard.
probably not without a charge controller for every battery. you could, and you could probably get away with it - but you might not. if it's outside and it can't catch anything on fire then sure, why not. but i wouldn't do it inside a structure.


I run several temp sensors all over my house via 18650 batteries direct voltage to the ESP through a protection circuit. They wake up every 3-5 minutes, send temp, and go back to sleep. They last about 30 days on a charge. There have been no ill effects sending the ESP ~4.2 volts while charging and while the battery is still maintaining a high charge. the controller shuts down access at around 2.6v? volts.

countcobolt
Normal user
Posts: 32
Joined: 12 Jun 2017, 11:12

Re: nodemcu on battery

#8 Post by countcobolt » 03 Jul 2018, 16:43

I just ordered some ESP-12E's so will give those a try. The Polulu is a step up down to 3.3 V and stops at 2.7 volt https://www.pololu.com/product/2122

countcobolt
Normal user
Posts: 32
Joined: 12 Jun 2017, 11:12

Re: nodemcu on battery

#9 Post by countcobolt » 03 Jul 2018, 16:44

waspie wrote: 03 Jul 2018, 16:41
countcobolt wrote: 03 Jul 2018, 16:16 Hi,

I connected the polulu to the V3 in and with a full battery it now runs about 24 hours. I believe my battery is 4400mAh. Currently my NodeMCU wakes up every 10 minutes. Considering it is only working approx 3 minutes per hour, this is 540mA. This result is a bit more less than 9 hours. Is there a way to expand that time? Can I connect 2 batteries in parallel, because I have been reading a lot of horror stories on potential fire hazard.
probably not without a charge controller for every battery. you could, and you could probably get away with it - but you might not. if it's outside and it can't catch anything on fire then sure, why not. but i wouldn't do it inside a structure.


I run several temp sensors all over my house via 18650 batteries direct voltage to the ESP through a protection circuit. They wake up every 3-5 minutes, send temp, and go back to sleep. They last about 30 days on a charge. There have been no ill effects sending the ESP ~4.2 volts while charging and while the battery is still maintaining a high charge. the controller shuts down access at around 2.6v? volts.
Which ESP is this? ESP-01/12/NodeMCU?

Kind regards
Steve

waspie
Normal user
Posts: 127
Joined: 09 Feb 2017, 19:35

Re: nodemcu on battery

#10 Post by waspie » 04 Jul 2018, 06:08

countcobolt wrote: 03 Jul 2018, 16:44
waspie wrote: 03 Jul 2018, 16:41
countcobolt wrote: 03 Jul 2018, 16:16 Hi,

I connected the polulu to the V3 in and with a full battery it now runs about 24 hours. I believe my battery is 4400mAh. Currently my NodeMCU wakes up every 10 minutes. Considering it is only working approx 3 minutes per hour, this is 540mA. This result is a bit more less than 9 hours. Is there a way to expand that time? Can I connect 2 batteries in parallel, because I have been reading a lot of horror stories on potential fire hazard.
probably not without a charge controller for every battery. you could, and you could probably get away with it - but you might not. if it's outside and it can't catch anything on fire then sure, why not. but i wouldn't do it inside a structure.


I run several temp sensors all over my house via 18650 batteries direct voltage to the ESP through a protection circuit. They wake up every 3-5 minutes, send temp, and go back to sleep. They last about 30 days on a charge. There have been no ill effects sending the ESP ~4.2 volts while charging and while the battery is still maintaining a high charge. the controller shuts down access at around 2.6v? volts.
Which ESP is this? ESP-01/12/NodeMCU?

Kind regards
Steve
Just a 12f on a breakout board
https://rover.ebay.com/rover/0/0/0?mpre ... 2422972937

countcobolt
Normal user
Posts: 32
Joined: 12 Jun 2017, 11:12

Re: nodemcu on battery

#11 Post by countcobolt » 04 Jul 2018, 09:22

Hi all,

thinking of putting this to the next level. I have some solar panels that, when fully in sunlight, produce 5V. I do have a charger board like the one described above for the battery but as the sunlight drops, the battery is no longer charged. So I was wondering if I could do the following:
Solar Panel --> Step up to V5 --> Charger board --> Battery
|-> Polulu step up/down to 3.3V --> ESP device?

Kind regards

Steve

waspie
Normal user
Posts: 127
Joined: 09 Feb 2017, 19:35

Re: nodemcu on battery

#12 Post by waspie » 04 Jul 2018, 14:06

countcobolt wrote: 04 Jul 2018, 09:22 Hi all,

thinking of putting this to the next level. I have some solar panels that, when fully in sunlight, produce 5V. I do have a charger board like the one described above for the battery but as the sunlight drops, the battery is no longer charged. So I was wondering if I could do the following:
Solar Panel --> Step up to V5 --> Charger board --> Battery
|-> Polulu step up/down to 3.3V --> ESP device?

Kind regards

Steve
i wired straight to battery, they never produce enough current to ctally put out 5v when charging

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: nodemcu on battery

#13 Post by TD-er » 04 Jul 2018, 21:59

waspie wrote: 04 Jul 2018, 14:06 [...]

i wired straight to battery, they never produce enough current to ctally put out 5v when charging
But then you also miss a lot of charging moments on cloudy days.
I would say adding some kind of step-up is a good idea, but maybe you should also look for an ESP board with LiPo connector and integrated charging circuit.

waspie
Normal user
Posts: 127
Joined: 09 Feb 2017, 19:35

Re: nodemcu on battery

#14 Post by waspie » 05 Jul 2018, 01:22

TD-er wrote: 04 Jul 2018, 21:59
waspie wrote: 04 Jul 2018, 14:06 [...]

i wired straight to battery, they never produce enough current to ctally put out 5v when charging
But then you also miss a lot of charging moments on cloudy days.
I would say adding some kind of step-up is a good idea, but maybe you should also look for an ESP board with LiPo connector and integrated charging circuit.
yeah maybe, but i'd prefer to just wire them to one of the powered controllers so I don't have to keep dealing with batteries at all.

I can't figure out an acceptable way to hide the wires and keep the temp probes hidden.

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: nodemcu on battery

#15 Post by Domosapiens » 05 Jul 2018, 10:30

30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

cyberclwn
Normal user
Posts: 21
Joined: 25 Aug 2017, 21:19

Re: nodemcu on battery

#16 Post by cyberclwn » 06 Jul 2018, 16:04

Hi,

Not sure if this is of any help, but i used this schematic for my solar-powered ESP.
http://www.instructables.com/id/Solar-P ... r-Station/

But i have 2 small solarpanels, but it works lick a charm, with the deep sleep.
Last edited by cyberclwn on 08 Jul 2018, 14:23, edited 1 time in total.

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: nodemcu on battery

#17 Post by Wiki » 07 Jul 2018, 11:45

waspie wrote: 04 Jul 2018, 14:06
countcobolt wrote: 04 Jul 2018, 09:22 Hi all,

thinking of putting this to the next level. I have some solar panels that, when fully in sunlight, produce 5V. I do have a charger board like the one described above for the battery but as the sunlight drops, the battery is no longer charged. So I was wondering if I could do the following:
Solar Panel --> Step up to V5 --> Charger board --> Battery
|-> Polulu step up/down to 3.3V --> ESP device?

Kind regards

Steve
i wired straight to battery, they never produce enough current to ctally put out 5v when charging
Hi,

I think the direct wiring of the battery to the 3.3V pin is the most efficient way if your project doesn't need 5V (as my does with the ultrasonic sensor). The energy loss of your project is not the ESP itself but the surroundung additions.

But if you want to stay on the safe side of the moon, just use this onehttps://www.aliexpress.com/store/product/10PCS- ... 6264RBBNlN to assure a correct 3.3V power supply. Voltages lower than 3.3V out of the Li-Ion battery makes no sence because the voltage of the batteriy drops pretty fast after that point. Add the charging/protection board I have metioned in my last post, and you will be pretty safe. And you will have a running time on one battery you are dreaming of right now. I promise.

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

ligeza
New user
Posts: 3
Joined: 04 Apr 2018, 22:21

Re: nodemcu on battery

#18 Post by ligeza » 07 Jul 2018, 21:15

I'm using nodemcu with battery 18650 (about 3000mAh). It's running on Espeasy and wake up every 5 minutes sending voltage and data from BME280 to domoticz. I only unsoldered ground pin from CH340 and removed AMS1117. Battery is connected directly to 3,3V with MCP1703 LDO voltage regulator. It works without any problems about 6-7 weeks on battery witch is very easy to replace it. There is no protection board for battery, but you can check the voltage in domoticz and if it's under 3,3V just replace battery.
Attachments
DSC02059.JPG
DSC02059.JPG (129.88 KiB) Viewed 41944 times
DSC02058a.jpg
DSC02058a.jpg (223.75 KiB) Viewed 41944 times
DSC02056.JPG
DSC02056.JPG (284.54 KiB) Viewed 41944 times
DSC02055.JPG
DSC02055.JPG (331.17 KiB) Viewed 41944 times

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: nodemcu on battery

#19 Post by Wiki » 08 Jul 2018, 01:41

Hi,

I've just learned, the MCP1703 LDO voltage regulator is definitely the better choice. In comparison to the HT7333 its specs name the half of quiescent current, 2uA instead of 4uA. Thanks for this tip!

Never stop learning!

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: nodemcu on battery

#20 Post by grovkillen » 08 Jul 2018, 02:20

ligeza wrote: 07 Jul 2018, 21:15 I'm using nodemcu with battery 18650 (about 3000mAh). It's running on Espeasy and wake up every 5 minutes sending voltage and data from BME280 to domoticz. I only unsoldered ground pin from CH340 and removed AMS1117. Battery is connected directly to 3,3V with MCP1703 LDO voltage regulator. It works without any problems about 6-7 weeks on battery witch is very easy to replace it. There is no protection board for battery, but you can check the voltage in domoticz and if it's under 3,3V just replace battery.
Nice one! Thanks for sharing :D
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: nodemcu on battery

#21 Post by Drum » 05 Aug 2018, 22:48

Add a solar cell and appropriate charging / protection circuit and it should run indefinitely.
I have a similar setup which just keeps on running.

whatsupskip
Normal user
Posts: 125
Joined: 28 Feb 2018, 07:40
Location: Melbourne, Australia

Re: nodemcu on battery

#22 Post by whatsupskip » 07 Aug 2018, 23:39

ligeza wrote: 07 Jul 2018, 21:15 I'm using nodemcu with battery 18650 (about 3000mAh). It's running on Espeasy and wake up every 5 minutes sending voltage and data from BME280 to domoticz. I only unsoldered ground pin from CH340 and removed AMS1117. Battery is connected directly to 3,3V with MCP1703 LDO voltage regulator. It works without any problems about 6-7 weeks on battery witch is very easy to replace it. There is no protection board for battery, but you can check the voltage in domoticz and if it's under 3,3V just replace battery.
I like your design.

Are you able to show us a bit more of a close up of the base of the unit around the BME280?

How long have you had this working outside? I would be a bit worried about corrosion of the BME280.

Are you using this over grass or something similar?

Have you done any tests to compare to more professional sensors?
Friends with kangaroos and some time koala rescuer.

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: nodemcu on battery

#23 Post by Wiki » 10 Oct 2018, 00:33

Hi,

in the last weeks I tried out some hardware modifications to minimize the power consumption of a Wemos D1 mini (clone from China). At least I was able to reduce the power consumption of the breakout board down to 70µA during deep sleep. All measurements I did refer to a 5V power supply.

I started with the original board equipped with a BMP280 with a running current of 81 mA, a deep sleep current of 6.1 mA. The BMP280 was connected to the 3.3V outlet of the board.

At first I desoldered the onboard voltage regulator and added a HT7333 directly to the board. The output pin of the HT7333 I soldered to the 3.3V connection point of the old regulator (be careful, its easy to rip off the connection point off the board), ground and input pin I soldered to the ground/5V pins of the board. At the same time I soldered a Molex connector from the upper side of the board to the 5V and groung connections of the board.

I got current peeks up to 350 mA being pulled out of the power source during wakeup of the esp. By adding two capacitors of 10µF the peek is avoided. Replacing the voltage regulator reduced the running current by 1.5-2 mA, the current during deep sleep aroung 1 mA.

Second I desoldered the ground pin of the onboard CH340. This reduced the running current down to 69-70 mA, the deep sleep current by 5 mA down to 150 µA. Gotcha, Thanks to ligeza for these tipps.

The modifications in color:
Wemos modded.jpg
Wemos modded.jpg (19.37 KiB) Viewed 41307 times
Wemos modded1.jpg
Wemos modded1.jpg (22.21 KiB) Viewed 41306 times
The resistor shown in the picture is a 180k to get the voltage of the lateron connected battery. Last step was connecting the BMP280 power input to a GPIO pin of the board, ESPEasy configuered to pull up this pin. The from BMP280 needed few µAmps can be feeded by a GPIO easily. Now the board pulls 70 mA during awake time, 70 µA during deep sleep. Setting the board to a fixed IP reduces the time the board has to be connected to the AP significantly.
Wemos modded2.jpg
Wemos modded2.jpg (24.68 KiB) Viewed 41306 times
Now the board is connected by the Molex connector to a 3D-printed battery pack, including a 3000mAh 18650 Liion battery and a battery protection/charging circuit. I expect a running time of at least 90 days with one battery, awaking the ESP every 15 minutes.
Wemos modded3.jpg
Wemos modded3.jpg (11.71 KiB) Viewed 41306 times
Attachments
Wemos modded1.jpg
Wemos modded1.jpg (22.21 KiB) Viewed 41307 times

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

whatsupskip
Normal user
Posts: 125
Joined: 28 Feb 2018, 07:40
Location: Melbourne, Australia

Re: nodemcu on battery

#24 Post by whatsupskip » 10 Oct 2018, 00:53

Great post Wiki. Thank you.

I am not sure my soldering is good enough to pull this physical design off, but it has inspired me.

By the way, it is "peak", not "peek".
Friends with kangaroos and some time koala rescuer.

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: nodemcu on battery

#25 Post by Wiki » 10 Oct 2018, 01:04

Hi,

as you can probably see on the pictures, my soldering skills are not the best either. But its possible. At least desoldering the CH340 ground pin is it worth to be done.

And yes, -e +a.

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: nodemcu on battery

#26 Post by AndrewJ » 10 Oct 2018, 18:34

Great post, thank you for sharing. It's inspired me to have a go.

jumperger
New user
Posts: 1
Joined: 05 Apr 2020, 00:31

Re: nodemcu on battery

#27 Post by jumperger » 05 Apr 2020, 00:36

@drum :
could you give some more information on the solar powered esp8266 ?
Thanks in advance
jumperger

User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

Re: nodemcu on battery

#28 Post by dynamicdave » 05 Apr 2020, 10:28

Here's a link to a write-up of a solar-powered weather station one of my IoT students tackled last year (2019).

Didn't modify the (power routing on the) Wemos D1 Mini as didn't know about the CH340 issues and
I doubt if our soldering skills would have been good enough.

Ran the weather station with no problems at all for a number of weeks during summer-2019 here in the UK.


https://discourse.nodered.org/t/solar-p ... tion/12499

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests