Page 1 of 1

nodemcu on battery

Posted: 24 Jun 2018, 17:48
by countcobolt
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

Re: nodemcu on battery

Posted: 24 Jun 2018, 19:56
by TD-er
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.

Re: nodemcu on battery

Posted: 25 Jun 2018, 08:26
by countcobolt
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?

Re: nodemcu on battery

Posted: 25 Jun 2018, 10:39
by wim16
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/

Re: nodemcu on battery

Posted: 26 Jun 2018, 14:05
by Wiki
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]

Re: nodemcu on battery

Posted: 03 Jul 2018, 16:16
by countcobolt
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.

Re: nodemcu on battery

Posted: 03 Jul 2018, 16:41
by waspie
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.

Re: nodemcu on battery

Posted: 03 Jul 2018, 16:43
by countcobolt
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

Re: nodemcu on battery

Posted: 03 Jul 2018, 16:44
by countcobolt
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

Re: nodemcu on battery

Posted: 04 Jul 2018, 06:08
by waspie
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

Re: nodemcu on battery

Posted: 04 Jul 2018, 09:22
by countcobolt
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

Re: nodemcu on battery

Posted: 04 Jul 2018, 14:06
by waspie
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

Re: nodemcu on battery

Posted: 04 Jul 2018, 21:59
by TD-er
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.

Re: nodemcu on battery

Posted: 05 Jul 2018, 01:22
by waspie
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.

Re: nodemcu on battery

Posted: 05 Jul 2018, 10:30
by Domosapiens

Re: nodemcu on battery

Posted: 06 Jul 2018, 16:04
by cyberclwn
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.

Re: nodemcu on battery

Posted: 07 Jul 2018, 11:45
by Wiki
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.

Re: nodemcu on battery

Posted: 07 Jul 2018, 21:15
by ligeza
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.

Re: nodemcu on battery

Posted: 08 Jul 2018, 01:41
by Wiki
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!

Re: nodemcu on battery

Posted: 08 Jul 2018, 02:20
by grovkillen
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

Re: nodemcu on battery

Posted: 05 Aug 2018, 22:48
by Drum
Add a solar cell and appropriate charging / protection circuit and it should run indefinitely.
I have a similar setup which just keeps on running.

Re: nodemcu on battery

Posted: 07 Aug 2018, 23:39
by whatsupskip
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?

Re: nodemcu on battery

Posted: 10 Oct 2018, 00:33
by Wiki
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 41297 times
Wemos modded1.jpg
Wemos modded1.jpg (22.21 KiB) Viewed 41296 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 41296 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 41296 times

Re: nodemcu on battery

Posted: 10 Oct 2018, 00:53
by whatsupskip
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".

Re: nodemcu on battery

Posted: 10 Oct 2018, 01:04
by Wiki
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.

Re: nodemcu on battery

Posted: 10 Oct 2018, 18:34
by AndrewJ
Great post, thank you for sharing. It's inspired me to have a go.

Re: nodemcu on battery

Posted: 05 Apr 2020, 00:36
by jumperger
@drum :
could you give some more information on the solar powered esp8266 ?
Thanks in advance
jumperger

Re: nodemcu on battery

Posted: 05 Apr 2020, 10:28
by dynamicdave
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