Skip to main content
Built-in Elements

<ammeter />

Overview

<ammeter /> measures current through a circuit branch during SPICE simulation. Insert it between the two nodes of the branch you want to measure, then connect pos and neg to define the positive current direction.

An ammeter is primarily a schematic and simulation component. It emits a current probe for simulation graphs.

Schematic Circuit Preview
export default () => (
<board routingDisabled>
<voltagesource name="V1" voltage="15V" schX={-3} />
<ammeter
name="AM1"
color="#ff0000"
connections={{
pos: ".V1 > .pin1",
neg: ".R1 > .pin1",
}}
/>
<resistor name="R1" resistance="10ohm" schX={3} />

<trace from=".R1 > .pin2" to=".V1 > .pin2" />

<analogsimulation
duration="1ms"
timePerStep="100us"
spiceEngine="ngspice"
/>
</board>
)

Pins

PinAliasesDescription
pin1posPositive side of the current measurement.
pin2negNegative side of the current measurement.

Positive current is measured entering pos and leaving neg. Reverse the connections if the plotted current has the opposite sign from the direction you want.

Properties

PropertyDescriptionExample
nameLabel for the ammeter and its current trace."AM1"
connectionsConnects the ammeter in series. Use either pos/neg or pin1/pin2.{{ pos: ".V1 > .pin1", neg: ".R1 > .pin1" }}
colorColor used for the current trace in simulation graphs."#ff0000"
graphDisplayNameOptional label for oscilloscope-style graph display."I_LOAD"
graphCenterCurrent value shown at the center of the trace display.0.01
graphVerticalOffsetVertical offset from the graph center. Accepts numbers or SI-prefixed strings."1mA"
graphCurrentPerDivCurrent scale per division. Accepts numbers or SI-prefixed strings."2mA"
footprintOptional footprint. Required if you position the ammeter on the PCB."0402"

Scope-style graph display

Use graphDisplayName, graphCenter, graphVerticalOffset, and graphCurrentPerDiv to override how an ammeter channel appears when an <analogsimulation /> uses graphIndependentAxes. These props are optional: without them, tscircuit automatically centers and scales the current trace from the simulated data.

graphVerticalOffset is expressed in current units, not divisions. For example, graphVerticalOffset="1mA" with graphCurrentPerDiv="2mA" places the trace center half a division away from the axis center.