logo elektroda
logo elektroda
X
logo elektroda

NodeMCU Thermometer: Powering via Pins, 3.7V 18650 Battery, Voltage Converter & Deep Sleep

swedzik 6816 8
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17794635
    swedzik
    Level 10  
    I am making a thermometer - the system wakes up every 3 minutes, reads the temperature from the sensor and sends the data via WiFi to the database and then performs deep sleep for 3 minutes. The whole thing is supposed to be energy-saving, because it will be battery-powered.
    I omit the fact that everywhere I read the NodeMCU specification it was written that we power the system through the pins with 3.3V, which is not true - the thermometer went crazy until I connected the whole thing to 5V and the problems disappeared.
    Main question: I'm powering it from a 3.7V 18650 battery. So I need to raise the voltage to 5V. Will the voltage converter take a lot of current when the NodeMCU is in deep sleep? Or can it be done with a zener diode somehow? The system, when it sends data via WiFi, consumes about 250mA. What will be the best solution? I prefer to stay with one battery because of the size - there is no space for a second battery.
  • ADVERTISEMENT
  • #2 17795499
    kaczakat
    Level 34  
    What you read was true, you power the ESP8266 with 3.3V, but it's a chip, not a NodeMCU board. This one has stabilizers that convert 5V from USB (or Vin) to 3.3V and if you connect 3.3V to it, you will of course get 2.5V and everything will go crazy. If you want to put it to sleep and use the battery, the NodeMCU is not a good idea, even if you put it to sleep in powerdown mode and all the components on the board will draw current, even 50mA. In addition, this 3>5V converter and 18650 2000mA battery will take you 20 hours. Buy yourself an ESP12E chip for PLN 12, a board for PLN 2 (Allegro ESP8266 adapter), add a capacitor, power it with 4.2V with some LDO stabilizer (at your own risk, you can directly, the board has a place for an LDO stabilizer, but I prefer without and all the chips are still alive), when the voltage measured inside the ESP drops below 3V put the system to sleep forever, maybe with some e-mail to replace the battery. Such systems with a used 18650 cell after a laptop, woken up every 15 minutes, can work for several months.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 17795694
    swedzik
    Level 10  
    Well, I can't quite agree. i.e. when i do deep sleep it actually the whole NodeMCU goes to sleep outside the real time clock. I started the thermometer by powering it with a powerbank. It worked for 3 days, and measuring, although made in China, the amount of electricity needed to fully charge the powerbank, it turned out that it consumed less than 70mAh during these 3 days. So on a good 18650 battery it has a chance to work for several months. The more so that the NdeMCU was put to sleep only for 25 seconds, because after half a minute the powerbank turned itself off :)
    So I will risk the construction on NodeMCU - anyway, I have 3 such copies, I want to use them. So I pose the question again: how to make 3.7V 5V in this case? Does the inverter eat a lot? It is said to have an efficiency of 96%. But maybe simpler is better? Maybe a zener diode is enough?
  • #4 17795800
    khoam
    Level 42  
    swedzik wrote:
    So I pose the question again: how to make 3.7V 5V in this case? Does the inverter eat a lot? It is said to have an efficiency of 96%. But maybe simpler is better? Maybe a zener diode is enough?

    A zener diode will definitely not be enough, because one that increases the voltage has not yet been invented ;) If I'm wrong, someone please correct me.
    Yes, converters have such an efficiency at the moment, let's say in practice 90-95%, but you need to choose the one that "eats" the least current when idling, if so much you want to extend the operation of the system. The maximum load capacity for such a converter is also important. The Chinese have quite popular (number of sold) SX1308 step-up converters, as in the picture below. They can be carefully adjusted to give 5V at the output. Its maximum load capacity is 2A (declared). It's dirt cheap, so you can buy a few to spare ;)

    NodeMCU Thermometer: Powering via Pins, 3.7V 18650 Battery, Voltage Converter & Deep Sleep

    swedzik wrote:
    Well, I can't quite agree. i.e. when i do deep sleep it actually the whole NodeMCU goes to sleep outside the real time clock.

    Here you are partially right, but remember that there is also a CH340G chip that is powered all the time and even when it is not working, it probably draws some current when connected to 5V.
  • ADVERTISEMENT
  • #5 17795957
    kaczakat
    Level 34  
    DeepSleep does not put the USB converter, stabilizers and leds to sleep (unless you don't have a power led). You can check it very simply, you take a 1%, 1R;10R;100R resistor (to easily convert to amperes) and through them you power the NODEMCU in turn during normal operation and in power down mode (deep sleep). You can even measure the voltage drop across the resistors with a meter, but an oscilloscope would be better. Share your experience. Whether it works 8h or 72h depends on the actual capacity, what are the capacitors and LEDs on the NodeMCU board, I gave data from memory. I remember that a clean Atmega328P can be put to sleep with a consumption of up to 100nA and after waking up it works from where the program was stopped, ESP8266 is pathetic in this respect, a clean ESP12E chip in deepsleep requiring a reset to resume work and so consumes 20uA and it also depends on the supply voltage, at The 4.2V I tested was much more and dropped to 30uA below 3V. Here you can see what it looks like https://www.youtube.com/watch?v=IYuYTfO6iOs, in another video Andreas also shows the waveform on the oscilloscope. There is a nice Elektrodroid program for Android (you can calculate it in excel of course), you enter, for example, 80mA/5s+60uA for 175s, 2000mA battery and the operating time will be 876h, you will change it to every 15 minutes and the time will change to 4000h. But leave 1 stupid led on the NodeMCU drawing 3mA and the time drops to 583h, add a UART-USB converter and it gets 60h. If I had to do it on NodeMCU, I would probably add Attiny13 with WDT to wake up (with 500nA) and completely disconnect the entire NODEMCU together with this inverter for the sleep time. It works for me up to 4 months on recovered cells, 1 pc. sometime there 2x2000mA.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #6 17796017
    Slawek K.
    Level 35  
    Like a friend @kaczakat and @khoam they wrote, if you don't do it on a clean esp, nothing will come of it, Nodemcu (board with esp on board) is not suitable for deepsleep due to additional peripherals, i.e. Ch340, stabilizer 5-> 3.3V and others such as led. You simply won't get a satisfactory effect in the form of a long working time due to the high power consumption of these peripherals.

    Regards
  • #7 17796130
    LChucki
    Level 31  
    Statement
    swedzik wrote:
    Maybe a zener diode is enough?

    proves you know nothing about it at all
    swedzik wrote:
    Does the inverter eat a lot? It is said to have an efficiency of 96%

    So what if 96% if idling it will be, for example, 500uA? Count how much the battery works, I suggest one from Jelcz.

    Do not combine as you do not know, just do as written, ESP itself, powered directly from the battery / battery. Only such a solution will ensure long work. If you want to further reduce the power consumption in sleep, do not put the ESP to sleep, but disconnect its power supply with some additional uC. Such AVR or ARM, in sleep mode, consumes a few uA max, not 20 like ESP.
  • #8 17797263
    khoam
    Level 42  
    LChucki wrote:
    If you want to further reduce the power consumption in sleep, do not put the ESP to sleep, but disconnect its power supply with some additional uC.

    There are such patents on the net for TPL5111 - it takes 35nA.
  • #9 17804049
    kaczakat
    Level 34  
    Yes, TPL5111 are nice chips, I found them, for example, in Adafruit or Botland, but once the price of the board with it is 3xESP, two that the current consumption is as much as bare ESP - 20uA. The bare chip alone is $1.4 with Friends.
    I checked my NodeMCU in sleep mode, the V2 with the CP2102 chip draws over 10mA, regardless of whether the power is given on the 3.3V pin or 4-6V on Vin, the difference is imperceptible for a Chinese power supply. In V3 and WEMOS with CH340 it's better, I already had to measure the voltage drop on R100, but it's still about 2.4mA - about 1000x more than the ESP12E chip alone with the HT7333 LDO stabilizer powered by a 4.2V battery. You probably have something like that, since my power supply did not detect anything, it probably turned off the power bank. Of course, there were no LEDs on the boards to indicate connection to the power supply. And by the way, I checked that without a stabilizer, the consumption from the 3.9V bare ESP8266 cell is 300uA and drops with voltage, and since most of the capacity is above 3.3V, it is more profitable to add this LDO or use a FEPO4 cell. If it is enough for 100h of operation on a 2000mA battery and you have a V3, then OK, but rather 70mA would not be enough for more than a day, maybe you meant 700mA, 7000mA? More precisely, working in the 5s/80mA+25s cycle, 2.5mA would consume over 1111mAh+converter in 72h.
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around powering a NodeMCU-based thermometer using a 3.7V 18650 battery, with a focus on raising the voltage to 5V for proper operation. Users clarify that while the ESP8266 chip operates at 3.3V, the NodeMCU board requires 5V due to onboard voltage regulators. Concerns are raised about the current consumption of voltage converters during deep sleep mode, with suggestions to use efficient step-up converters like the SX1308, which can provide 5V output with minimal idle current. Alternatives such as using a bare ESP12E chip for lower power consumption and the TPL5111 timer for deep sleep management are also discussed. The consensus is that NodeMCU's additional components lead to higher power draw, making it less suitable for long-term battery operation compared to simpler setups.
Summary generated by the language model.
ADVERTISEMENT