Essential Circuit Packages
Copy
\usepackage{circuitikz} % Complete circuit diagrams
\usepackage{tikz} % TikZ graphics
\usepackage{siunitx} % SI units for electronics
\usepackage{steinmetz} % Phasor notation
\usepackage{units} % Unit formatting
\usepackage{amsmath} % Math expressions
Basic Circuit Elements
Passive Components
Copy
\begin{circuitikz}
% Resistor
\draw (0,0) to[R, l=$R_1$] (2,0);
% Capacitor
\draw (0,0) to[C, l=$C_1$] (2,0);
% Inductor
\draw (0,0) to[L, l=$L_1$] (2,0);
% Variable resistor
\draw (0,0) to[vR, l=$R_{var}$] (2,0);
% Potentiometer
\draw (0,0) to[pR, l=$P_1$] (2,0);
\end{circuitikz}
Active Components
Copy
\begin{circuitikz}
% Voltage source
\draw (0,0) to[V, l=$V_s$] (2,0);
% Current source
\draw (0,0) to[I, l=$I_s$] (2,0);
% Battery
\draw (0,0) to[battery, l=$E$] (2,0);
% AC source
\draw (0,0) to[sV, l=$V_{ac}$] (2,0);
% Dependent sources
\draw (0,0) to[cV, l=$k V_x$] (2,0); % Voltage controlled
\draw (0,0) to[cI, l=$g V_x$] (2,0); % Current controlled
\end{circuitikz}
to[R, l=R1] | → | Resistor with label R₁ |
to[C, l=C1] | → | Capacitor with label C₁ |
to[V, l=Vs] | → | Voltage source with label Vs |
Semiconductor Devices
Diodes and Transistors
Copy
\begin{circuitikz}
% Diode
\draw (0,0) to[D, l=$D_1$] (2,0);
% LED
\draw (0,0) to[leDo, l=LED] (2,0);
% Zener diode
\draw (0,0) to[zD, l=$D_z$] (2,0);
% Bipolar transistors
\draw (0,0) node[npn](npn1){Q1};
\draw (0,-2) node[pnp](pnp1){Q2};
% MOSFET
\draw (4,0) node[nmos](mos1){M1};
\draw (4,-2) node[pmos](mos2){M2};
% JFET
\draw (8,0) node[njfet](jfet1){J1};
\end{circuitikz}
Operational Amplifiers
Copy
\begin{circuitikz}
% Basic op-amp
\draw (0,0) node[op amp](opamp1){};
% With power supplies
\draw (0,-3) node[op amp, yscale=-1](opamp2){}
(opamp2.up) node[above] {$+V_{CC}$}
(opamp2.down) node[below] {$-V_{EE}$};
% Inverting amplifier circuit
\draw (0,0) node[op amp](opamp){}
(opamp.+) to[R, l=$R_2$] ++(0,-2) node[ground]{}
(opamp.-) to[R, l=$R_1$] ++(-3,0) to[sV, l=$V_{in}$] ++(0,-2)
node[ground]{}
(opamp.-) to[R, l=$R_f$] ++(0,2) -| (opamp.out)
(opamp.out) to[R, l=$R_L$] ++(2,0) node[ocirc, label=right:$V_{out}$]{};
\end{circuitikz}
Complex Circuits
Complete Circuit Example
Copy
\begin{circuitikz}[scale=1.2]
% Power supply
\draw (0,4) to[V, l=$12V$] (0,0)
(0,4) to[short] (2,4)
(0,0) node[ground]{};
% Voltage divider
\draw (2,4) to[R, l=$R_1=\SI{10}{k\ohm}$] (2,2)
to[R, l=$R_2=\SI{5}{k\ohm}$] (2,0)
(2,0) to[short] (0,0);
% Transistor amplifier
\draw (2,2) to[short] (3,2)
(3,2) to[R, l=$R_B=\SI{47}{k\ohm}$] (5,2)
(5,2) node[npn, anchor=base](Q1){Q1}
(Q1.collector) to[R, l=$R_C=\SI{2.2}{k\ohm}$] (5,4)
(5,4) to[short] (2,4)
(Q1.emitter) to[R, l=$R_E=\SI{1}{k\ohm}$] (5,0)
(5,0) to[short] (2,0);
% Output coupling
\draw (Q1.collector) to[C, l=$C_{out}=\SI{10}{\mu F}$] (7,3)
to[R, l=$R_L=\SI{8}{\ohm}$] (7,0)
(7,0) to[short] (5,0)
(7,3) node[ocirc, label=right:Output]{};
% Input coupling
\draw (3,2) to[C, l=$C_{in}=\SI{1}{\mu F}$] (1,2)
node[ocirc, label=left:Input]{};
\end{circuitikz}
Digital Logic Circuits
Logic Gates
Copy
\begin{circuitikz}
% Basic gates
\draw (0,0) node[and port](and1){};
\draw (0,-2) node[or port](or1){};
\draw (0,-4) node[not port](not1){};
\draw (4,0) node[xor port](xor1){};
\draw (4,-2) node[nand port](nand1){};
\draw (4,-4) node[nor port](nor1){};
% Labels
\draw (and1.out) node[right=5mm] {AND};
\draw (or1.out) node[right=5mm] {OR};
\draw (not1.out) node[right=5mm] {NOT};
\draw (xor1.out) node[right=5mm] {XOR};
\draw (nand1.out) node[right=5mm] {NAND};
\draw (nor1.out) node[right=5mm] {NOR};
\end{circuitikz}
Flip-Flops and Counters
Copy
\begin{circuitikz}
% D Flip-flop
\draw (0,0) node[flipflop D](ff1){}
(ff1.bpin 1) node[left] {D}
(ff1.bpin 2) node[left] {CLK}
(ff1.bpin 6) node[right] {Q}
(ff1.bpin 7) node[right] {$\overline{Q}$};
% JK Flip-flop
\draw (0,-4) node[flipflop JK](ff2){}
(ff2.bpin 1) node[left] {J}
(ff2.bpin 2) node[left] {CLK}
(ff2.bpin 3) node[left] {K}
(ff2.bpin 6) node[right] {Q}
(ff2.bpin 7) node[right] {$\overline{Q}$};
% Clock signal
\draw (ff1.bpin 2) to[short] ++(-1,0)
to[square voltage source, l=CLK] ++(0,-1.5)
to[short] ++(1,0) to (ff2.bpin 2);
\end{circuitikz}
AC Circuit Analysis
Phasor Diagrams
Copy
\begin{circuitikz}
% AC source and impedances
\draw (0,0) to[sV, l=$V_s \angle 0°$] (0,3)
to[R, l=$R=\SI{50}{\ohm}$] (3,3)
to[L, l=$L=\SI{10}{mH}$] (6,3)
to[C, l=$C=\SI{100}{\mu F}$] (6,0)
to[short] (0,0);
% Phasor diagram
\begin{scope}[shift={(8,1.5)}, scale=1.5]
\draw[->] (0,0) -- (2,0) node[right] {Re};
\draw[->] (0,0) -- (0,2) node[above] {Im};
\draw[->, thick, red] (0,0) -- (1.5,0.8)
node[above right] {$V_R$};
\draw[->, thick, blue] (0,0) -- (0.5,1.5)
node[above left] {$V_L$};
\draw[->, thick, green] (0,0) -- (0.8,-0.6)
node[below right] {$V_C$};
\end{scope}
\end{circuitikz}
Specialized Components
Transformers and Coupled Circuits
Copy
\begin{circuitikz}
% Ideal transformer
\draw (0,0) to[L, l=$L_1$] (0,2)
to[sV, l=$V_1$] (2,2)
to[short] (2,0)
to[short] (0,0);
\draw (3,0) to[L, l=$L_2$] (3,2)
to[R, l=$R_L$] (5,2)
to[short] (5,0)
to[short] (3,0);
% Coupling
\draw[dashed] (0.5,1) -- (2.5,1);
\node at (1.5,1.2) {$k$};
% Center-tapped transformer
\draw (0,-4) to[L, l=$L_1$] (0,-2)
to[sV, l=$V_{ac}$] (2,-2)
to[short] (2,-4)
to[short] (0,-4);
\draw (3,-4) to[L, l=$L_{2a}$] (3,-3)
(3,-3) to[L, l=$L_{2b}$] (3,-2)
to[short] (5,-2)
to[D] (5,-3)
to[D] (5,-4)
to[short] (3,-4);
\draw (3,-3) to[short] (6,-3) node[ground]{};
\end{circuitikz}
Measurement and Test Equipment
Meters and Instruments
Copy
\begin{circuitikz}
% Voltmeter
\draw (0,0) to[V, l=V] (2,0);
% Ammeter
\draw (0,-1) to[A, l=A] (2,-1);
% Oscilloscope
\draw (4,0) node[oscilloscope](scope){}
(scope.in 1) node[left] {CH1}
(scope.in 2) node[left] {CH2};
% Function generator
\draw (0,-4) node[generator](gen){}
(gen.out 1) node[right] {OUT}
(gen.out 2) node[right] {GND};
% Multimeter
\draw (4,-4) node[multimeter](mm){MM}
(mm.north) node[above] {Digital}
(mm.south) node[below] {Multimeter};
\end{circuitikz}
Circuit Analysis Techniques
Node Voltage Analysis
Copy
% Circuit with node labels
\begin{circuitikz}
\draw (0,0) node[ground]{}
to[I, l=$I_s$] (0,2)
to[short] (2,2) coordinate(n1)
to[R, l=$R_1$] (4,2) coordinate(n2)
to[R, l=$R_2$] (4,0)
to[short] (0,0);
\draw (n1) to[R, l=$R_3$] ++(0,-2) node[ground]{};
\draw (n2) to[I, l_=$I_o$, i_=$i_o$] ++(2,0) coordinate(n3)
to[R, l=$R_L$] ++(0,-2) node[ground]{};
% Node labels
\node at (n1) [above] {$v_1$};
\node at (n2) [above] {$v_2$};
\node at (n3) [above] {$v_3$};
% Equations
\node at (2,-3) [align=left] {
Node 1: $\frac{v_1}{R_3} + \frac{v_1-v_2}{R_1} = I_s$ \\
Node 2: $\frac{v_2-v_1}{R_1} + \frac{v_2}{R_2} + \frac{v_2-v_3}{R_L} = 0$
};
\end{circuitikz}
Units and Measurements
Electronic Units with siunitx
Copy
% Basic electrical units
\SI{12}{V} % Voltage
\SI{2.5}{A} % Current
\SI{100}{\ohm} % Resistance
\SI{10}{k\ohm} % Kiloohms
\SI{1}{M\ohm} % Megohms
% Capacitance and inductance
\SI{100}{\mu F} % Microfarads
\SI{22}{pF} % Picofarads
\SI{10}{mH} % Millihenries
\SI{1}{\mu H} % Microhenries
% Power and energy
\SI{25}{W} % Watts
\SI{100}{mW} % Milliwatts
\SI{3.6}{kW.h} % Kilowatt-hours
% Frequency
\SI{60}{Hz} % Hertz
\SI{1}{kHz} % Kilohertz
\SI{2.4}{GHz} % Gigahertz
Component Values and Tolerances
Standard Component Values
Copy
% Resistor with tolerance
$R_1 = \SI{4.7}{k\ohm} \pm 5\%$
% Capacitor specifications
$C_1 = \SI{100}{\mu F}, \SI{25}{V}$
% Inductor with core material
$L_1 = \SI{1}{mH}$ (ferrite core)
% Transistor specifications
$\beta = 100$, $V_{CE(sat)} = \SI{0.2}{V}$
% Power ratings
$P_{max} = \SI{1/4}{W}$ at $\SI{25}{°C}$
Best Practices
Clear Component Labels
Always label components with both reference designators and values
Consistent Symbol Style
Use consistent symbols throughout your document
Proper Scaling
Scale circuits appropriately for readability
Ground References
Clearly indicate ground and reference points
Troubleshooting
Common issues:
- Component overlap: Adjust node spacing for complex circuits
- Label positioning: Use
l=,l_=,l^=for different positions - Line thickness: Use
thickorvery thickfor emphasis - Grid alignment: Use coordinates for precise component placement
