<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.
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
| Pin | Aliases | Description |
|---|---|---|
pin1 | pos | Positive side of the current measurement. |
pin2 | neg | Negative 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
| Property | Description | Example |
|---|---|---|
name | Label for the ammeter and its current trace. | "AM1" |
connections | Connects the ammeter in series. Use either pos/neg or pin1/pin2. | {{ pos: ".V1 > .pin1", neg: ".R1 > .pin1" }} |
color | Color used for the current trace in simulation graphs. | "#ff0000" |
graphDisplayName | Optional label for oscilloscope-style graph display. | "I_LOAD" |
graphCenter | Current value shown at the center of the trace display. | 0.01 |
graphOffsetDivs | Vertical offset, in divisions, applied to the trace center. | -1 |
graphUnitsPerDiv | Current scale per division. For ammeters this is amps per division. | 0.005 |
footprint | Optional footprint. Required if you position the ammeter on the PCB. | "0402" |
Scope-style graph display
Use graphCenter, graphOffsetDivs, and graphUnitsPerDiv when plotting
multiple current and voltage signals on the same simulation graph. These props
scale the ammeter trace independently from voltage probes, so current can be
shown in amps per division while voltage probes use volts per division.
<ammeter
name="ILOAD"
color="#8a35d7"
graphDisplayName="ILOAD"
graphCenter={0.002}
graphOffsetDivs={-2}
graphUnitsPerDiv={0.0005}
connections={{
pos: ".R_LOAD > .pin2",
neg: ".V1 > .pin2",
}}
/>