The fundamental formula for energy in electrical systems is E = P × t (Energy equals Power multiplied by Time). When expanded using Watt's Law, it becomes E = V × I × t. In the strict SI system, energy is measured in Joules (J), but on the workbench and in power systems, we almost exclusively use Watt-hours (Wh) or kilowatt-hours (kWh). If you are sizing a battery, calculating a heating load, or estimating the runtime of an ESP32 IoT node, this single equation dictates your hardware choices.

The Core Formula for Energy and Symbol Definitions

Before plugging in numbers, you must lock in your units. The most common reason a battery bank dies prematurely or a power supply trips is a unit mismatch in the energy calculation. Below is the definitive spec sheet for the variables in the electrical energy formula.

Symbol Quantity Strict SI Unit Practical Electrical Unit Definition
E Energy Joule (J) Watt-hour (Wh) The total capacity to do work over a period.
P Power Watt (W) Watt (W) The rate at which energy is transferred (Joules per second).
t Time Second (s) Hour (h) The duration the load is active.
V Voltage Volt (V) Volt (V) Electrical potential difference across the load.
I Current Ampere (A) Ampere (A) The flow rate of electrical charge.

For authoritative reference on how these units interlock, the NIST Guide to the SI defines the Joule strictly as one Watt applied for one second (1 J = 1 W·s). Therefore, 1 Watt-hour equals exactly 3,600 Joules.

Rearranged Forms and Fatal Unit Mistakes

You will rarely just solve for E. Usually, you know your battery's energy capacity and your load's power, and you need to find runtime. Here are the rearranged forms solving for each variable:

  • Solving for Power: P = E / t (Use to find the maximum continuous draw your inverter or wire gauge must handle).
  • Solving for Time: t = E / P (Use to calculate battery runtime or UPS backup duration).
  • Solving for Voltage: V = E / (I × t) (Use when selecting a battery chemistry based on a fixed current and time requirement).
  • Solving for Current: I = E / (V × t) (Use to size fuses, breakers, and BMS discharge limits).
Warning: The Unit Mistakes That Break the Formula
  • Mixing Seconds and Hours: If you multiply Watts by seconds, you get Joules, not Watt-hours. If your battery is rated in Wh, you must use hours for time. (1 Wh = 3600 J).
  • Confusing mAh with Wh: Milliamp-hours (mAh) measure charge, not energy. A 10,000 mAh power bank at 3.7V holds 37 Wh. A 10,000 mAh 12V lead-acid battery holds 120 Wh. Always convert to Wh before comparing energy across different voltages.
  • Ignoring AC Power Factor: In AC circuits, P = V × I is only true for purely resistive loads. For motors or transformers, you must use P = V × I × PF (Power Factor). Ignoring PF will result in an undersized generator or inverter.

Worked Examples: From Bench to Battery Bank

Abstract formulas fail on the workbench. Here are two solved problems with strict intermediate step tracking to show how the math translates to physical hardware.

Example 1: Sizing a DC Heating Element for a 3D Printer Enclosure

Scenario: You need to run a 12V DC silicone heater pad that draws 4.5A for 3 hours to cure a resin print. You need to know the total energy required in both Watt-hours and Joules to select a power supply and calculate the heat dissipation.

  1. Calculate Power (P):
    P = V × I
    P = 12 V × 4.5 A = 54 W
  2. Calculate Energy in Watt-hours (E_wh):
    E = P × t
    E = 54 W × 3 h = 162 Wh
  3. Convert to Joules (E_j):
    E_j = E_wh × 3600 s/h
    E_j = 162 × 3600 = 583,200 J (or 583.2 kJ)

Practical Takeaway: Your 12V power supply must be rated for at least 54W (preferably 70W for a 20% safety margin). If you were powering this off a 12V battery, you would need a battery with at least 162 Wh of usable capacity (roughly a 12V 15Ah LiFePO4 pack, assuming 80% depth of discharge).

Example 2: ESP32-WROOM-32 Deep Sleep IoT Node

Scenario: An ESP32-WROOM-32 wakes up for 2 seconds every hour to transmit MQTT sensor data (drawing 160 mA at 3.3V), then returns to deep sleep for the remaining 3,598 seconds (drawing 10 µA at 3.3V). What is the daily energy consumption?

  1. Calculate Active Energy per cycle:
    P_active = 3.3 V × 0.160 A = 0.528 W
    t_active = 2 seconds = 0.000555 hours
    E_active = 0.528 W × 0.000555 h = 0.000293 Wh per cycle
  2. Calculate Sleep Energy per cycle:
    P_sleep = 3.3 V × 0.00001 A = 0.000033 W
    t_sleep = 3598 seconds = 0.99944 hours
    E_sleep = 0.000033 W × 0.99944 h = 0.000033 Wh per cycle
  3. Total Daily Energy (24 cycles):
    E_daily = (0.000293 + 0.000033) × 24 = 0.007824 Wh per day

Practical Takeaway: A standard 18650 Li-ion cell holds about 12 Wh. Dividing 12 Wh by 0.007824 Wh/day yields over 1,500 days (4+ years) of theoretical runtime. In reality, the self-discharge rate of the lithium cell (roughly 2-3% per month) will kill the battery long before the ESP32 does. For a deeper dive into low-power microcontroller calculations, All About Circuits provides excellent foundational DC power theory.

Boundary Conditions: When the Formula Applies

The formula E = P × t assumes a constant load. In the real world, loads fluctuate. Here is how to handle the edge cases:

  • Variable DC Loads: If your load changes over time (like a motor starting up or a PWM-driven LED strip), you cannot use a single P value. You must use the average power (P_avg) measured over the specific time window, or integrate the power curve: E = ∫ P(t) dt. On the bench, use a power logger or a shunt resistor with an oscilloscope to capture the area under the curve.
  • AC Mains and Power Factor: For AC circuits, the formula expands to E = V_rms × I_rms × PF × t. If you are sizing a backup generator for a workshop with heavy induction motors, assuming a PF of 1.0 will result in a generator that stalls under load. Always assume a PF of 0.8 for mixed motor loads unless you have measured it with a true-RMS clamp meter.
  • Realistic Magnitudes: To build intuition, 1 Watt-hour is the energy required to keep a 1W LED lit for one hour. A typical smartphone battery holds 12 to 18 Wh. A US household uses roughly 30,000 Wh (30 kWh) per day. If your calculation yields 500,000 Wh for a single portable device, you have missed a decimal point.

Decision Path: Sizing an Off-Grid Battery Bank

Use this decision tree to translate your calculated energy requirement (E) into a specific battery chemistry and form factor. This path assumes a standard 12V DC architecture, which is the default for 90% of DIY solar, camper, and bench projects.

Condition (Daily Energy E) Recommended Chemistry & Architecture Concrete Hardware Pick (Default)
E < 50 Wh
(e.g., IoT nodes, small Raspberry Pi clusters)
3.7V Li-ion (18650/21700 cells) in a 3S or 4S pack with a dedicated BMS. Custom 4S1P 21700 pack (approx. 50Wh) using a 15A BMS.
50 Wh ≤ E ≤ 1,200 Wh
(e.g., Camper vans, ham radio go-boxes, backup sump pumps)
12V LiFePO4 (Lithium Iron Phosphate). Drop-in replacement for lead-acid, 10-year cycle life, safe chemistry. Renogy 12V 100Ah Smart LiFePO4 (Yields 1,280 Wh total, 1,024 Wh usable at 80% DoD).
E > 1,200 Wh
(e.g., Off-grid cabins, full home backup, heavy machinery)
48V Server Rack LiFePO4. Higher voltage reduces current and wire gauge requirements for high-power inverters. EG4 48V 100Ah Server Rack Battery (Yields 5,120 Wh per module, scalable in parallel).
The Default Recommendation:
If you are building a standard DIY solar generator, camper electrical system, or workshop backup and your daily energy calculation falls in the middle tier, buy the Renogy 12V 100Ah Smart LiFePO4. It includes built-in Bluetooth monitoring to track your actual state of charge (SoC), eliminating the need for a separate external shunt monitor. It provides 1,280 Wh of total energy, meaning it can sustain a 100W load for roughly 10 hours (accounting for inverter inefficiencies and the 80% depth-of-discharge limit to preserve cycle life). Do not oversize to 48V unless your inverter exceeds 2,000W, as the complexity and cost of 48V charge controllers and DC-DC converters rarely justify the copper savings for smaller builds.