How to power a NodeMCU ESP8266 with a portable battery

How to supply a power to a NodeMCU ESP8266 + MPU-6050 (as shown in below image) using a portable battery so that the ESP8266 board is not required to connect to a PC or power adaptor.


Can I use a 9V battery like below to supply power. Please advice me.

Likely not. It will quickly run empty .Try 6 * AA instead.

9V batteries have limited mAh capacity (~600mAh) and tend to be cost-prohibiting.

USB battery packs work well. Just size the mAh to fit your use.

I would go with 4xAA or 4xAAA (if it’s just to run the MPU6050).

Input voltage range varies between different boards, your image shows some esp32 one.
Try USB power bank, easy and safe.

That’s indeed an important info. Some boards have “Vin” pin, while others have a 5V pin. The input voltage range depends on what regulator your board has, but it’s good to keep it close to the minimum. So, I agree with the powerbank.

could you kindly share some details about USB battery pack and an image of it

I am making an elderly fall detection system which would be attach to the arm of a person so its not practical to use a power bank in such case

can I directly connect a 4xAAA without any additional components such as voltage converter, resistor, etc. Will it also gives the power to MPU-6050 sensor?

As I said, normally yes, because the board has an onboard regulator. But it will be better if you find the specs of your exact board to know the max voltage that can be applied to “Vin” pin.

Yes, but through the ESP8266 board, as it’s showed in the pic you posted in #1. You can’t apply 6V directly on the MPU6050

the details of the board specifies that +5v recommended for Vin, maximum +10V. So, can I use this 9V battery as shown in below image

You can, but this would be a poor choice because of these two reasons:

  • 9V (aka smoke alarm) batteries have a small capacity and will be quickly drained;
  • the difference between 9V and 5V will be wasted as heat on the onboard regulator. This decreases the amount of current that you can drain from the board. Not a problem if you have only the MPU6050 connected to it, but it can be if other things will be connected to the board later.

Many newer ESP32 boards are designed for battery power.
They have a LiPo battery connector and even a buil-in charging circuit.
The NodeMCU ESP8266 is not such a board.

The easiest way to battery power the NodeMCU is with a cellphone powerbank, connected to the USB socket.
Leo..