The fundamental energy formula for electricity is E = P × t (Energy = Power × time). By substituting the power equation (P = V × I), the expanded form becomes E = V × I × t. On the benchtop, you use this to calculate battery life in Joules or milliamp-hours; at the breaker panel, you use it to calculate utility costs in kilowatt-hours (kWh). The math is simple, but mixing up your time units or ignoring nominal voltage shifts will brick your embedded projects or leave your off-grid battery bank dead before sunset.

The Core Energy Formula and Its Operating Assumptions

The base formula assumes a steady-state direct current (DC) circuit. When you move to alternating current (AC) or variable loads, the formula requires modification to remain physically accurate.

  • DC Circuits: E = V × I × t applies directly, assuming V and I remain constant over time t.
  • AC Resistive Loads: For purely resistive AC loads (like incandescent bulbs or resistive heaters), you substitute RMS (Root Mean Square) voltage and current: E = VRMS × IRMS × t.
  • AC Reactive Loads: If the load has inductance or capacitance (motors, switch-mode power supplies), you must include the Power Factor (PF). The real energy consumed is E = VRMS × IRMS × PF × t.
  • Variable Loads: If power fluctuates (like an ESP32 waking from deep sleep), the continuous formula becomes an integral: E = ∫ P(t) dt. In practice, we solve this by breaking the timeline into discrete blocks of constant power and summing them.

Symbol Definitions and Rearranged Forms

Before solving, lock in your variables. A common failure mode on the bench is plugging a resistance value into a power variable slot because the symbols look similar in hastily written notes.

SymbolVariableStandard SI UnitPractical Bench Unit
EElectrical EnergyJoule (J)Watt-hour (Wh), milliamp-hour (mAh)
PPowerWatt (W)Kilowatt (kW), milliwatt (mW)
tTimeSecond (s)Hour (h)
VVoltageVolt (V)Millivolt (mV)
ICurrentAmpere (A)Milliamp (mA), Microamp (µA)
RResistanceOhm (Ω)Kilo-ohm (kΩ)
PFPower FactorDimensionless (0 to 1)Percentage (%)

Rearranged Forms

Depending on what your multimeter or datasheet gives you, you will need to isolate different variables. Here is the formula solved for each primary parameter:

  • Solve for Power: P = E / t
  • Solve for Time: t = E / P
  • Solve for Voltage: V = E / (I × t)
  • Solve for Current: I = E / (V × t)
  • Solve for Resistance (via Joule's Law): R = E / (I² × t)

Unit Tracking: Where the Joule Meets the Kilowatt-Hour

The most frequent mistake that breaks this formula is mixing time units. The SI unit for energy is the Joule, which is defined as one Watt applied for one second. However, utility companies and battery manufacturers use the Watt-hour, which is one Watt applied for one hour.

The Conversion Constant: 1 Watt-hour (Wh) = 3,600 Joules (J). Therefore, 1 kilowatt-hour (kWh) = 3,600,000 Joules (3.6 MJ).

According to the NIST Guide to the SI, the Watt-hour is a non-SI unit accepted for use with the International System because of its practical necessity in commercial power metering. When calculating battery capacity, you must rigorously track whether your time variable is in seconds or hours, and whether your current is in Amps or milliamps. If you multiply Watts by hours, you get Wh. If you multiply Watts by seconds, you get Joules. Mixing these yields numbers that are off by a factor of 3,600.

Realistic Magnitudes: A standard CR2032 coin cell holds roughly 1,000 to 1,500 Joules of energy. A typical US household consumes about 30 kWh (108 Megajoules) per day. If your benchtop calculation says an LED draws 5 Megajoules an hour, you have dropped a decimal or mixed up milliamps with Amps.

Solved Problems: From Benchtop to Breaker Panel

Here are two worked examples demonstrating strict unit tracking across different scales of electrical work.

Problem 1: Embedded Systems (ESP32 Sleep Cycle Energy)

Scenario: An ESP32-WROOM-32 runs on a 3.3V rail. It wakes up, transmits via WiFi drawing 160 mA for 2 seconds, then enters deep sleep drawing 10 µA for 58 seconds. Calculate the total energy consumed in one 60-second cycle in Joules.

Step 1: Convert all units to base SI (Volts, Amps, Seconds).

  • V = 3.3 V
  • Iwake = 160 mA = 0.160 A
  • twake = 2 s
  • Isleep = 10 µA = 0.000010 A
  • tsleep = 58 s

Step 2: Calculate energy for the wake state (E = V × I × t).

  • Ewake = 3.3 V × 0.160 A × 2 s
  • Ewake = 0.528 W × 2 s = 1.056 Joules

Step 3: Calculate energy for the sleep state.

  • Esleep = 3.3 V × 0.000010 A × 58 s
  • Esleep = 0.000033 W × 58 s = 0.001914 Joules

Step 4: Sum for total cycle energy.

  • Etotal = 1.056 J + 0.001914 J = 1.0579 Joules

Takeaway: The deep sleep energy is statistically negligible compared to the RF transmission burst. Optimizing the WiFi handshake time yields vastly better battery life than tweaking deep sleep currents.

Problem 2: Mains Wiring (Space Heater Cost Calculation)

Scenario: A 1500W resistive space heater is plugged into a 120V nominal receptacle and runs for 4 hours. Electricity costs $0.16 per kWh. Calculate the energy consumed and the cost.

Step 1: Convert power to kilowatts and identify time in hours.

  • P = 1500 W = 1.5 kW
  • t = 4 hours

Step 2: Calculate energy in kWh.

  • E = P × t
  • E = 1.5 kW × 4 h = 6.0 kWh

Step 3: Calculate cost.

  • Cost = 6.0 kWh × $0.16/kWh = $0.96

Context: According to the US Department of Energy, space heating is one of the largest residential energy expenses. Running this single 15A portable heater for 8 hours a day over a 30-day month yields 360 kWh, costing $57.60—highlighting why hardwired heat pumps are preferred over resistive plug-in loads.

Real-World Scenario: Sizing an Off-Grid LiFePO4 Bank (And What Went Wrong)

Formulas on paper are clean; real-world components have quirks. Here is a teardown of a common off-grid solar sizing failure driven by a misapplication of the energy formula.

The Setup

A van-life builder needs to power a 12V DC compressor fridge (averaging 45W) and a set of LED lights (20W) for 24 hours without solar input. They are using a Lithium Iron Phosphate (LiFePO4) battery bank.

The Numbers

  • Total Power (P) = 45W + 20W = 65W
  • Time (t) = 24 hours
  • Required Energy (E) = 65W × 24h = 1,560 Wh

The builder remembers the lead-acid rule of thumb: divide Watt-hours by 12V to get Amp-hours.
1,560 Wh / 12V = 130 Ah.
They purchase a premium 12V 150Ah LiFePO4 battery (advertised as 12V), assuming 150Ah > 130Ah provides a safe buffer.

The Outcome

At hour 19, the fridge compressor kicks on, and the battery's Battery Management System (BMS) immediately triggers a low-voltage cutoff, killing all power to the van. The battery still has roughly 20% of its chemical capacity remaining, but it is unusable.

What Went Wrong?

The builder made three critical errors in applying the energy formula to physical hardware:

  1. Nominal Voltage Mismatch: Lead-acid batteries have a nominal voltage of 12.0V. LiFePO4 batteries have a nominal voltage of 12.8V. The battery they bought actually holds 12.8V × 150Ah = 1,920 Wh, not the 1,800 Wh they assumed. While this gave them more total energy, it skewed their state-of-charge (SoC) monitoring.
  2. Ignoring Voltage Sag and Cutoff Thresholds: The energy formula (E = V × I × t) assumes V is constant. In reality, as a LiFePO4 cell drops below 10% State of Charge, the voltage curve cliffs sharply. When the fridge compressor demanded a 15A startup surge, the internal resistance of the nearly depleted battery caused the terminal voltage to sag below the BMS's 10.0V low-voltage cutoff threshold, tripping the system even though average energy calculations suggested 20% capacity remained.
  3. Forgetting Inverter Quiescent Draw: The builder plugged a laptop into a 1000W pure sine wave inverter. Even with the laptop unplugged, the inverter's internal control board draws roughly 1.5A at 12V (18W) just being turned on. Over 24 hours, that invisible 18W parasitic draw consumed an extra 432 Wh—a massive 27% of their total calculated energy budget that never appeared in their initial P × t math.

The Fix: Always calculate energy using the exact nominal voltage of the specific chemistry (12.8V for LiFePO4). Add a 20% fudge factor for inverter quiescent draw and wiring losses. Finally, size the battery bank so that the maximum continuous load does not pull the cells below the BMS low-voltage cutoff during peak surge events, regardless of what the average Watt-hour math says.