Devices: batteries, board parts and analog blocks
Batteries and supercapacitors, board parts, analog building blocks, sensor modules and RF parts. The parameter tables use the same columns as Devices: passives. Every part has labelled fields with units in the inspector and in All parameters, and the live stimulus of a sensor (light, temperature, field, strain, distance, load) is its main field, first in the list, with a slider range that fits it. A field that shows auto takes a value derived from other parameters until you type one (for example the must-operate voltage of a relay is 0.75 of its coil voltage). Clear it to go back. A variant placed from the library starts with its own typical values, such as 1 kΩ for a Pt1000 or 1.2 V dropout for an AMS1117. A part placed from the library can start with its own values, and a part made with the Part Wizard takes them from its datasheet fields (Part templates reference).
37.1Batteries and supercapacitors
| Type | Pins | Variants | Class |
|---|---|---|---|
battery (BT) | +, - | liion, lifepo4, nimh, alkaline, coin, leadacid, lipo_pack | approximate |
A battery with its chemistry's open-circuit voltage curve against state of charge, a series resistance and a polarisation R1-C1, and a state of charge that falls as it delivers charge. Drag soc to charge or discharge it at once. It warns when the terminal voltage falls below the cut-off.
| Chemistry | Cell voltage from empty to full |
|---|---|
| Li-ion, LiPo pack | 3.0 → 3.6 at 20 % → 3.84 at 60 % → 4.2 V |
| LiFePO4 | 2.5 → 3.2 → 3.31 → 3.6 V |
| NiMH | 1.0 → 1.2 → 1.26 → 1.4 V |
| Alkaline | 0.9 → 1.2 → 1.4 → 1.6 V |
| Coin (lithium) | 2.0 → 2.8 → 2.95 → 3.2 V |
| Lead-acid | 1.75 → 1.95 → 2.06 → 2.15 V |
| Parameter | Key | Unit | Default | Range | Value comes from | What it does |
|---|---|---|---|---|---|---|
| Cells in series | cells | 1 (lipo_pack 3) | Default, inspector, part file | |||
| Capacity | capacity_ah | Ah | 2 | Default, inspector, part file | ||
| State of charge | soc | 0 to 1 | 0.8 | Live slider | ||
| Series resistance | r | Ω | 0.05 (coin 15) | Default, inspector, part file | ||
| Polarisation | r1, c1 | Ω, F | 0.02, 2000 | Default, inspector, part file | Recovery after a load step. | |
| Fixed voltage | v | V | none | File or All parameters | If set, a fixed EMF with no state of charge. |
Key: the name in the circuit file, in a parameter step (R1.r) and for AI agents. Range: a value outside it is refused with E_PARAM. Value comes from: where you can set it. The All parameters tab and agents can set every parameter.
- Place a battery (liion) and a 4 Ω load. Probe the battery voltage.
- Set the timebase to 1 s per second and run.
You should seeThe voltage steps down by I · r at once, then sags further over a minute as the polarisation charges, and recovers slowly when you remove the load.
A supercapacitor (capacitor variant supercap) is a main ESR-C branch with a slower R2-C2 branch and optional leakage: c 1 F, esr 0.1 Ω, r2 10 x esr, c2 0.1 x c, rleak none.
37.2Board parts
| Part | Type | Pins | Model and parameters (default) |
|---|---|---|---|
| Connector | conn (J) | 1xN, 2xN, usb_c, usb_micro, usb_a, barrel, trs, trs_sw, rj45, sma, microsd, bat_holder, banana | No electrical element. It only connects its pins to their nets. |
| Test point, mounting hole, fiducial | tp, mhole, fiducial | one pin | No element. |
| Net tie | net_tie (NT) | a, b (variant 3: a, b, c) | Joins its nets into one. |
| Jumper | jumper (JP) | a, b (3way: a, b, c) | state (0 open, 1 closed, click to toggle), r (1 mΩ closed). |
| Resistor network | rnet (RN) | iso2, iso4, iso8: a1, b1, … bus4, bus8: com, r1 … | r (10 kΩ). |
| Strain gauge | strain (R) | a, b | R = r0 (1 + gf · strain · 10-6): r0 (350 Ω), gf (2), strain (0 µε, live). |
| Ferrite bead | ferrite (FB) | a, b | dcr in series with L, R and C set by z100 (600 Ω at 100 MHz), dcr (0.15 Ω), f_srf (1 GHz). Its impedance falls with DC current above irated (0.5 A). |
| Feed-through capacitor | cap3 (C) | in, out, gnd | c (100 nF) to gnd, l_thru (2 nH), rdc (10 mΩ). |
| Common-mode choke | cmc (L) | a1, b1, a2, b2 | Two coupled windings: l (1 mH), k (0.995), dcr (50 mΩ). |
37.3Analog building blocks
| Part | Type | Pins | What it does | Parameters (default) |
|---|---|---|---|---|
| Darlington array | darr (U) | uln2003: in1 … in7, gnd, com, out7 … out1. uln2803: 8 channels | Real Darlington pairs with base resistors and clamp diodes to com. | rin (2.7 kΩ), imax (0.5 A, warns) |
| 556 dual timer | timer556 (U) | 14 pins | Two 555 timers sharing the supply. | none |
| Dual potentiometer | pot_dual (RV) | a1, b1, w1, a2, b2, w2 | One wiper position moves both gangs. | r (10 kΩ), pos (0.5, live), r_end, variant lin or log |
| Multi-winding transformer | xfmr_multi (T) | ct: p1, p2, s1, sct, s2. ct_pri, dual, flyback, current | Coupled windings, every pair coupled by k. | lp (1 mH), ratio (1), ratio2, ratio_aux (0.2), n (100, current transformer), k (0.999, flyback 0.98), rp, rs |
| Bridge sensor | bridge_sensor (U) | exc+, exc-, out+, out- | Four resistors unbalanced by the measurand: V(out) = (sens · x + zero) mV/V x V(exc). | r_bridge (350 Ω), sens (2 mV/V), x (0 to 1 of full scale, live), zero (0) |
| Analog sensor | asensor (U) | VCC, GND, OUT | OUT = offset + sens · x, optionally ratiometric. | x (25, live), sens (10 mV per unit), offset (0), ratiometric (0), vcc_ref (5 V), rout (100 Ω), icc (60 µA), tau |
| Instrumentation amplifier | inamp (U) | rg: in+, in-, rg1, rg2, ref, out, v+, v-. fixed, diff: 6 pins | Gain 1 + 2 rf / Rg with the real external Rg, or a fixed gain. Offset and common-mode error (vcm / CMRR) are input referred; large steps slew at slew. | rf (24.7 kΩ), gain (1), gbw (1 MHz), slew (1.2 V/µs), vos (50 µV), cmrr_db (100), rail (1.2 V), iq (1.3 mA) |
| Current-sense amplifier | csa (U) | uni: IN+, IN-, OUT, VS, GND. bidir: plus REF. hs: plus REF1, REF2 | OUT = gain · (V(IN+) - V(IN-) - vos) + reference, with bandwidth and output swing limits. | gain (50 V/V), bw (350 kHz), vos (100 µV), rail (30 mV), ib (75 µA) |
| Hall current sensor | isense_hall (U) | ip+, ip-, vcc, gnd, out, filt | ACS712 class: OUT = VCC/2 + sens · I, ratiometric. | sens (185 mV/A), r_ip (1.2 mΩ), bw (80 kHz) |
| Analog multiplier | mult (U) | x1, x2, y1, y2, z, w, v+, v- | AD633 class: W = (x1 - x2)(y1 - y2) / scale + z. | scale (10 V), bw (1 MHz) |
| Audio amplifier | audioamp (U) | btl, se, lm386 | Bridge-tied, single-ended, or the LM386 with its gain pins (20 open, 200 with a capacitor). btl / se: SD low shuts the amplifier down (outputs high impedance); SD open is on (300 kΩ pull-up). | gain (20), iq (4 mA), rail (0.3 V) |
| Digital potentiometer | digipot (U) | updown (X9C103), spi (MCP4131), i2c | Wiper set by code. Up/down counts on nINC. SPI takes 16-bit frames. I2C (MCP4017 rheostat W to B) answers at addr 0x2F: a write sets the wiper, a read returns it, and it ACKs on SDA. | r (10 kΩ), steps (100, spi 129, i2c 128), code (50, live), r_w (75 Ω), addr (47, i2c) |
| OTA | ota (U) | in+, in-, iabc, out, v+, v- | LM13700 class: Iout = Iabc · tanh(Vin / 2 Vt); the output stays 0.8 V inside the rails. | rout (10 MΩ at Iabc = 500 µA, scaling as 1 / Iabc, so at Iabc = 0 the output leaks next to nothing) |
37.4Sensor modules and RF parts
| Part | Type | Pins | What it does | Parameters (default) |
|---|---|---|---|---|
| PIR motion module | pir (U) | VCC, OUT, GND | OUT high (3.3 V) while motion is on and t_hold after. | motion (0, click), t_hold (2 s) |
| Ultrasonic ranger | ultrasonic (U) | VCC, TRIG, ECHO, GND | HC-SR04: after a 10 µs TRIG pulse, ECHO is high for 2 · dist / 343 m/s. | dist (0.5 m, live) |
| Touch sensor IC | touch (U) | Q, VSS, I, AHLB, VDD, TOG | TTP223: Q follows the touch, or toggles with TOG high. AHLB inverts. | touch (0, click), t_resp (60 ms) |
| Microphone | mic (MK) | electret: out, gnd. mems_analog: VDD, GND, OUT. mems_pdm: VDD, GND, CLK, DATA, LR | A test tone at spl dB SPL. The PDM mic outputs a real sigma-delta bit stream. | sens (-42 dBV/Pa), spl (94 dB), tone_f (1 kHz), i_d (0.5 mA), vbias (0.9 V), sens_dbfs (-26) |
| IR receiver | irrx (U) | OUT, GND, VS | With code set, outputs an NEC frame starting at 10 ms, active low. | code |
| Antenna | antenna (AE) | mono: feed. dipole: feed+, feed-. chip, pcb: feed, gnd | Radiation resistance with reactance at f0. | r_rad (50 Ω), x (0), f0 (2.45 GHz) |
| RF attenuator | attenuator (AT) | IN, OUT, GND | A matched pi network. | atten_db (10 dB), z0 (50 Ω) |
| Balun | balun (T) | UNBAL, GND, BAL+, BAL- | Coupled inductors, 1:1, 1:2 or 1:4. | lp (100 nH), k (0.98) |
| SAW filter | saw (FL) | IN, OUT, GND | A series resonance at f0 with the bandwidth and insertion loss. | f0 (433.92 MHz), bw (1 MHz), il_db (2.5 dB), z0 (50 Ω) |
| RF amplifier | rfamp (U) | IN, OUT, VCC, GND | Gain with compression at p1db and a pole at f3db, 50 Ω in and out. | gain_db (15), f3db (3 GHz), p1db (15 dBm), icc (30 mA) |
| Peltier (TEC) | peltier (TEC) | +, - | Resistance plus a Seebeck voltage from the temperature difference it pumps. | r (2 Ω), seebeck (50 mV/K), rth (1 K/W) |
| Gas sensor | gas (U) | h1, h2, a, b | MQ-x: the sensing resistance falls with ppm and needs the heater warm. | r_h (33 Ω), ppm (100, live), r0, ppm0, k (the variant’s datasheet curve, below), tau_heat (30 s) |
The gas sensor (gas) has three variants, and each starts with its own datasheet curve: the sensing resistance is Rs = r0 · (ppm / ppm0)-k. The fields r0, ppm0 and k show auto with the variant's values until you type your own, and a value you typed wins.
| Variant | Gas | r0 | ppm0 | k |
|---|---|---|---|---|
mq2 | LPG | 10 kΩ | 574 ppm | 0.45 |
mq135 | CO2 | 76.6 kΩ | 117 ppm | 0.361 |
mq7 | CO | 10 kΩ | 99 ppm | 0.659 |
The MQ-135 in 400 ppm of CO2 reads about 49 kΩ. The sensor still needs its heater warm (tau_heat 30 s) before the resistance follows the gas.