Circuit power budget

How much current the board and modules draw, whether the regulator, USB or power supply copes and how long the battery lasts.

Board and modules

The board itself: 100 mA running, up to 300 mA at peak, rail 3.3 V, regulator AMS1117-3.3. The sleep current is an estimate.

  • OLED SSD1306
  • BME280

Power

Source

A computer USB 2.0 port gives 500 mA.

Draws from the source at peak
mA
3.3 V rail
111 mA, peak 326
5 V rail (modules)
0 mA, peak 0
From the source
111 mA, peak 326
AMS1117-3.3
0.19 W, about 42 °C
  • 3.3 V rail: up to 326 mA of 1,000 mA (linear regulator AMS1117-3.3 rated 1,000 mA).
  • Source: up to 326 mA, a computer USB port gives 500 mA.
  • AMS1117-3.3 heats up: (5 − 3.3) V × 111 mA = 0.19 W, the case reaches about 42 °C at 25 °C ambient, 0.55 W at peak.

Peak: radio transmission, motor and servo start. Module currents come from the pinout database, and for boards the sleep current is an estimate: the regulator, the LED and the USB bridge do not sleep.

How power is calculated

The calculation adds up the current of the board and the modules separately on the 3.3 V and 5 V rails, in normal operation and at peak. The currents come from the board database; for a module that isn't in the database, enter its current by hand. The 3.3 V rail is compared with the board's regulator, and the total current with the source: a computer's USB at 500 mA, a power supply with the current you enter, or a battery. A circuit from the builder opens here with all its modules.

Linear regulator heating is calculated from the power P = (Vin − Vout) × I: the temperature is about 25 °C + P × θ. For an AMS1117 in a SOT-223 package the calculation uses θ = 90 °C/W; the Advanced Monolithic Systems datasheet gives 55-80 °C/W for boards with 100-2500 mm² of copper, and a junction limit of 125 °C. With a battery, the calculation takes the sleep fraction into account and gives the run time.

Examples

  • ESP32 DevKit from USB: the AMS1117 drops 5 V to 3.3 V, and at 100 mA it dissipates (5 − 3.3) × 0.1 = 0.17 W, about 40 °C at 25 °C ambient.
  • The same AMS1117 from 12 V: at 100 mA that is (12 − 3.3) × 0.1 = 0.87 W and about 103 °C, and at 130 mA already about 127 °C, which is over the 125 °C limit.

Common mistakes

  • People power modules from the 3V3 pin of an Arduino Nano. Its 3.3 V comes from the USB-UART chip, and according to the site's database you can draw up to 50 mA from it.
  • People pick a power supply by the average current. When transmitting over Wi-Fi an ESP32 draws up to 240 mA, and with a supply sized right at the average current the board resets.

FAQ

How much current does an ESP32 draw with Wi-Fi and in sleep?
According to the Espressif datasheet (3.3 V, 25 °C) the chip draws 240 mA when transmitting 802.11b at 19.5 dBm, 95-100 mA when receiving, 20-68 mA in modem-sleep depending on the frequency, 0.8 mA in light-sleep and 10 µA in deep-sleep with the RTC timer. A DevKit board draws more asleep because the regulator, the power LED and the USB bridge keep running: in the site's database that is an estimate of about 10 mA.
Why does the AMS1117 get hot, and how much current can I draw from it?
A linear regulator turns (Vin − 3.3 V) × I into heat. At 90 °C/W and 25 °C ambient the die reaches 125 °C at 1.1 W: from 5 V that is about 650 mA, from 12 V about 130 mA. With a copper pour under the package the thermal resistance is lower and the current higher; from 12 V use a switching buck converter.
How many amps does a computer's USB port give?
USB 2.0 gives 500 mA, USB 3.x gives 900 mA at 5 V. A Type-C port reports over the CC line whether it can supply 1.5 A or 3 A; a board with a Type-C connector needs 5.1 kΩ resistors on CC1 and CC2 to be powered from such a port. For USB the calculation uses 500 mA.
Can I power an ESP32 straight from an 18650?
Not on the 3V3 pin: a charged 18650 gives 4.2 V, and the ESP32's supply limit in the datasheet is 3.6 V. Through the 5V pin and the AMS1117, the output will be below 3.3 V, because that regulator drops about 1.1 V. Use a low-dropout 3.3 V regulator or a boost converter to 5 V.
Is USB enough for servos and a WS2812 strip?
A single WS2812 LED at full white draws up to 60 mA, 10 LEDs already 600 mA, which is more than the 500 mA of a USB 2.0 port. According to the site's data an SG90 draws up to 650 mA at start and stall. Power servos and the strip from a separate 5 V supply with a common ground, and size the supply by the sum of the peaks.

You might also need