Source: https://mokxi.com/parts/battery
Updated: 2026-11-10

Part

# Battery: AA, coin cell, LiPo

A voltage behind an internal resistance: 1.6 V a fresh AA, 4.2 V a full LiPo, and less once a motor starts.

See every part

- 2 pins
- 3 settings
- In 20 projects
- In 4 lessons

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Battery: AA, coin cell, LiPo in brief

What it is, and every setting the properties panel gives it.

A battery here is a voltage behind an internal resistance, which is the one thing the number on its label leaves out. Fresh and unloaded it reads more than the label: 1.6 V for an AA, 9.6 V for a 9 V battery, 4.2 V for a full 18650 or LiPo cell. Under load it sags by the current times that resistance, so a 9 V battery with 1.7 ohms inside loses about 0.8 V into an 18 ohm load, and 100 mA costs a coin cell about a volt inside itself, which is why one cannot run a servo. The kind property picks AA and AAA packs, NiMH, coin cells, one or two 18650s, LiPo pouches, 2S and 3S RC packs or a 12 V lead-acid block, each with its figure from a datasheet or a stated assumption. The charge slider moves it in a straight line between its empty and full voltages. It does not run down while the circuit runs, so the slider is how you show what a flat battery does.

Family

Power and wiring

Pins

2

kind

9v (or aa2, aa3, aa4, 18650, 18650x2, aa1, aaa1, aaa2, aa6, aa8, nimh4, nimh6, cr2032, cr2025, lir2032, lipo500, lipo1000, lipo2000, lipo2s, lipo3s, sla12)

charge

100

capacity

0

Pins

## 2 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

What it does

V+

The red lead.

V-

The black lead. Nothing connects it to ground but a wire.

How to use it

## How to read a battery’s voltage with an Arduino

One lithium-ion cell is 4.2 V full and about 3.0 V empty, under the Uno’s 5 V reference, so it goes straight onto an analog pin: the red lead to A0 and the black lead to GND. The volts are analogRead(A0) times 5 / 1023, and a straight line from 3.0 to 4.2 V gives a rough percent.

The circuit here does that with an 18650, a 16x2 I2C LCD and a traffic light module. Drag the battery’s charge slider: full reads 4.20 V and 100 %, half 3.60 V and 50 %, and under 20 % the red light blinks. A battery over 5 V, two 18650s, a 9 V battery or a 12 V pack, needs a voltage divider in front of the pin.

Part pin

Board pin

V+ (the red lead)

A0

V- (the black lead)

GND

On a 3.3 V board a full lithium-ion cell is over the ADC’s range, so read it through two equal resistors and double the result.

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

A cell’s voltage and charge

How it is modeled

## What is true about the Battery: AA, coin cell, LiPo, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

It is a source. The battery starts an analog solve the way the bench supply
does, so resistors, LEDs, motors and the TB6612FNG's bridge all draw real current
from it.

Internal resistance. Energizer's E91 sheet gives a fresh alkaline AA as 150 to
300 milliohms; the part uses 0.2 ohm a cell. The 9 V figure, 1.7 ohm, is an
assumption in the range fresh 9 V batteries measure (Energizer's 522 sheet gives no
number). Into 18 ohm, half an amp, a 9 V battery loses about 0.8 V inside itself.

Fresh and empty. A fresh alkaline cell reads about 1.6 V unloaded, and both
sheets rate a cell down to 0.8 V.

18650 cells. Samsung's INR18650-25R sheet charges a cell to 4.20 V and gives its
AC impedance as 18 milliohm or less. The part uses 0.04 ohm a cell, an assumption
that adds the slower DC part of the drop and a holder's springs. That is why two
18650s run a robot car's motors where a 9 V battery gives up: two amps cost them
about 0.16 V. The sheet discharges a cell to 2.5 V under load; resting, an emptied
cell comes back to about 3.0 V, which is the part's 0 percent.

AAA. Energizer's E92 sheet gives the same 150 to 300 milliohms as the AA; the
part uses 0.25 ohm, inside it, for the smaller cell.

NiMH. Panasonic's eneloop sheet: 1.2 V nominal, tested down to 1.0 V, about 25
milliohm at 1 kHz; the part uses 0.03 ohm a cell with a holder. Off the charger a cell
rests at about 1.40 V, which is a measurement rather than a datasheet figure. Four
NiMH cells give 4.8 V where four alkalines give 6, which is why a 5 V project runs on
four of them.

Coin cells. Energizer's CR2032 and CR2025 sheets: 3.0 V, rated down to 2.0 V. A
fresh one reads about 3.2 V unloaded (a measurement). The CR2032 sheet's pulse test
starts near 10 ohm inside, rising past 100 ohm as it empties; the part uses the fresh
10 ohm. That is why a coin cell cannot run a servo or a Wi-Fi radio: 100 mA would
cost it a volt inside itself.
The LIR2032 is the rechargeable Li-ion one, 4.2 V full, 0.6 ohm or less.

LiPo. One-cell pouches charge to 4.2 V and stop at 3.0 V, like an 18650. Their
sheets give no internal resistance; comparable cells' sheets, protection board
included, give under 200 milliohm for 500 mAh, about 100 for 1200 mAh and about 70
for 2400 mAh, which is what the part uses. An RC pack is far stiffer: 0.01 ohm a
cell is an assumption (new packs measure 3 to 10 milliohm a cell) with the leads
added. The 2S and 3S packs draw their balance plug, but it has no pins: charging is
not modeled.

Lead-acid. Yuasa's NP7-12 sheet gives 23 milliohm; its manual has a 12 V block at
about 12.8 V at rest when full and 11.8 V empty. Under load it is rated down to
10.5 V.

### Not modeled

The battery emptying while the circuit runs (a 2850 mAh AA would take hours of
simulated time to notice), resistance rising as it empties, temperature, and
recovery after a rest. A coin cell's resistance climbing past 100 ohm as it empties
is not modeled either, nor its resistance rising with the current it is asked for.
So a red LED wired straight across a CR2032, the "LED throwie", takes about 100 mA
here and burns out, while on the bench the cell sags further and the LED survives.
Give the LED a resistor, as you would anyway. Between full and empty charge is a straight line, which is
an assumption: the real curve is flatter in the middle. It is there to show what a
flat battery does to a circuit, not to predict run time.

From Battery, in full.

Projects

## See the Battery: AA, coin cell, LiPo in a project

20 built-in projects use it. Each opens in the editor, already wired.

Lessons

## Where it turns up in a lesson

4 lessons place it in their own circuits.

### Learn articles

4 lessons

- Arduino Battery Level Indicator: 18650 on A0
- Arduino SIM800L: Send and Receive SMS, AT Commands
- Arduino Line Follower Robot: Code and Circuit
- Arduino TB6612FNG: Wiring, Library and Code

Boards

## The boards it is shown on

Each of these 2 boards has a built-in project with the Battery: AA, coin cell, LiPo in it.

- Arduino Uno R3
- ESP32-C3-DevKitM-1

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the Battery: AA, coin cell, LiPo

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
