Skip to main content
Built-in Elements

<battery />

Overview​

A <battery /> is a power source that provides electrical energy through electrochemical reactions. Batteries are essential components that supply power to electronic circuits and devices. They have a positive and negative terminal.

A battery element has two pins and is polarized, meaning it has a positive terminal (cathode) and a negative terminal (anode). The voltage and capacity of the battery determine how much power it can provide and for how long.

When specifying a battery, you'll need to provide the voltage rating and optionally the capacity. Common battery types include AA, AAA, 9V, coin cells, and lithium-ion batteries.

export default () => (
<battery
name="BAT1"
capacity="2500mAh"
/>
)
Schematic Circuit Preview

Pins​

A battery has the following pins and aliases:

Pin #AliasesDescription
pin1pos, positive, cathodeThe positive terminal that provides current
pin2neg, negative, anodeThe negative terminal that completes the circuit

Specifications​

Batteries can be configured with these key properties:

  • capacity - The energy storage capacity specified in mAh or Ah e.g. "2500mAh", "1.2Ah"

Common Battery Types​

Here are some common battery types and their typical specifications:

Battery TypeVoltageTypical CapacityChemistry
AA1.5V2000-3000mAhAlkaline
AAA1.5V800-1200mAhAlkaline
9V9V400-600mAhAlkaline
CR20323V200-250mAhLithium coin cell
186503.7V2500-3500mAhLithium-ion

Schematic Orientation​

Batteries can display their positive and negative terminals in different orientations. Use the schOrientation property to control the symbol orientation.

Valid orientation values are:

  • horizontal
  • vertical
  • pos_left
  • pos_right
  • pos_top
  • pos_bottom
  • neg_left
  • neg_right
  • neg_top
  • neg_bottom
<battery
name="BAT1"
capacity="2500mAh"
schOrientation="pos_left"
schX={0}
schY={0}
connections={{ pos: "net.VCC", neg: "net.GND" }}
/>

Usage Examples​

Basic Power Supply​

<battery
name="BAT1"
capacity="2000mAh"
/>

High Capacity Battery​

<battery
name="BAT1"
capacity="3000mAh"
/>

Small Capacity Battery​

<battery
name="BAT_RTC"
capacity="220mAh"
/>
tip

When designing battery-powered circuits, consider adding battery monitoring circuitry to track voltage levels and prevent over-discharge, especially for rechargeable batteries.