CircuiTikZ
version 1.8.6-unreleased (2026/02/10)
10 Examples
Here a series of examples, contributed by several people, is shown with their code.
10.1 A red diode
\begin{circuitikz}[scale=1.4]\draw
(0,0) to[C, l=10<\micro\farad>] (0,2) -- (0,3)
to[R, l=2.2<\kilo\ohm>] (4,3) -- (4,2)
to[L, l=12<\milli\henry>, i=$i_1$,v=b] (4,0) -- (0,0)
(4,2) to[D*, color=red] (2,0)
(0,2) to[R, l=1<\kilo\ohm>, *-] (2,2)
to[cV, i=1, -*, v=$\SI{.3}{\kilo\ohm}\, i_1$] (4,2)
(2,0) to[I, i=1<\milli\ampere>, *-*] (2,2)
;\end{circuitikz}
10.2 Using the (experimental) siunitx syntax
\begin{circuitikz}[scale=1.2]\draw
(0,0) node[ground] {}
to[V=$e(t)$, *-*] (0,2) to[C=4<\nano\farad>] (2,2)
to[R, l_=.25<\kilo\ohm>, *-*] (2,0)
(2,2) to[R=1<\kilo\ohm>] (4,2)
to[C, l_=2<\nano\farad>, *-*] (4,0)
(5,0) to[I, i_=$a(t)$, -*] (5,2) -- (4,2)
(0,0) -- (5,0)
(0,2) -- (0,3) to[L, l=2<\milli\henry>] (5,3) -- (5,2)
{[anchor=south east] (0,2) node {1} (2,2) node {2} (4,2) node {3}}
;
\end{circuitikz}
\begin{circuitikz}[scale=1.2]\draw
(0,0) node[anchor=east] {B}
to[short, o-*] (1,0)
to[R=20<\ohm>, *-*] (1,2)
to[R=10<\ohm>, v=$v_x$] (3,2) -- (4,2)
to[cI=$\frac{\si{\siemens}}{5} v_x$, *-*] (4,0) -- (3,0)
to[R=5<\ohm>, *-*] (3,2)
(3,0) -- (1,0)
(1,2) to[short, -o] (0,2) node[anchor=east]{A}
;\end{circuitikz}
10.3 Photodiodes
\begin{circuitikz}[scale=1]\draw
(0,0) node[transformer] (T) {}
(T.B2) to[pD] ($(T.B2)+(2,0)$) -| (3.5, -1)
(T.B1) to[pD] ($(T.B1)+(2,0)$) -| (3.5, -1)
;\end{circuitikz}
10.4 A Sallen-Key cell
\begin{circuitikz}[scale=1]\draw
(5,.5) node [op amp] (opamp) {}
(0,0) node [left] {$U_{we}$} to [R, l=$R_d$, o-*] (2,0)
to [R, l=$R_d$, *-*] (opamp.+)
to [C, l_=$C_{d2}$, *-] ($(opamp.+)+(0,-2)$) node [ground] {}
(opamp.out) |- (3.5,2) to [C, l_=$C_{d1}$, *-] (2,2) to [short] (2,0)
(opamp.-) -| (3.5,2)
(opamp.out) to [short, *-o] (7,.5) node [right] {$U_{wy}$}
;\end{circuitikz}
10.5 Mixing circuits and graphs
\begin{circuitikz}[scale=1.2, american]\draw
(0,2) to[I=1<\milli\ampere>] (2,2)
to[R, l_=2<\kilo\ohm>, *-*] (0,0)
to[R, l_=2<\kilo\ohm>] (2,0)
to[V, v_=2<\volt>] (2,2)
to[cspst, l=$t_0$] (4,2) -- (4,1.5)
to [generic, i=$i_1$, v=$v_1$] (4,-.5) -- (4,-1.5)
(0,2) -- (0,-1.5) to[V, v_=4<\volt>] (2,-1.5)
to [R, l=1<\kilo\ohm>] (4,-1.5);
\begin{scope}[xshift=6.5cm, yshift=.5cm]
\draw [->] (-2,0) -- (2.5,0) node[anchor=west] {$v_1/\si{\volt}$};
\draw [->] (0,-2) -- (0,2) node[anchor=west] {$i_1/\si{\milli\ampere}$} ;
\draw (-1,0) node[anchor=north] {-2} (1,0) node[anchor=south] {2}
(0,1) node[anchor=west] {4} (0,-1) node[anchor=east] {-4}
(2,0) node[anchor=north west] {4}
(-1.5,0) node[anchor=south east] {-3};
\draw [thick] (-2,-1) -- (-1,1) -- (1,-1) -- (2,0) -- (2.5,.5);
\draw [dotted] (-1,1) -- (-1,0) (1,-1) -- (1,0)
(-1,1) -- (0,1) (1,-1) -- (0,-1);
\end{scope}
\end{circuitikz}
10.6 RF circuit
\begin{circuitikz}[scale=1]
\ctikzset{bipoles/detector/width=.35}
\ctikzset{quadpoles/coupler/width=1}
\ctikzset{quadpoles/coupler/height=1}
\ctikzset{tripoles/wilkinson/width=1}
\ctikzset{tripoles/wilkinson/height=1}
%\draw[help lines,red,thin,dotted] (0,-5) grid (5,5);
\draw
(-2,0) node[wilkinson](w1){}
(2,0) node[coupler] (c1) {}
(0,2) node[coupler,rotate=90] (c2) {}
(0,-2) node[coupler,rotate=90] (c3) {}
(w1.out1) .. controls ++(0.8,0) and ++(0,0.8) .. (c3.port3)
(w1.out2) .. controls ++(0.8,0) and ++(0,-0.8) .. (c2.port4)
(c1.port1) .. controls ++(-0.8,0) and ++(0,0.8) .. (c3.port2)
(c1.port4) .. controls ++(-0.8,0) and ++(0,-0.8) .. (c2.port1)
(w1.in) to[short,-o] ++(-1,0)
(w1.in) node[left=30] {LO}
(c1.port2) node[match,yscale=1] {}
(c1.port3) to[short,-o] ++(1,0)
(c1.port3) node[right=30] {RF}
(c2.port3) to[detector,-o] ++(0,1.5)
(c2.port2) to[detector,-o] ++(0,1.5)
(c3.port1) to[detector,-o] ++(0,-1.5)
(c3.port4) to[detector,-o] ++(0,-1.5)
;
\end{circuitikz}
10.7 A styled low noise input stage
\ctikzloadstyle{romano}
\scalebox{0.707}{%
\begin{circuitikz}[american, romano circuit style]
\ctikzset{bipoles/cuteswitch/thickness=0.5}
\draw (0,0) node[ground](GND0){} to[sV, l=$v_{cm}$] ++(0,1)
to [R, l=$R_c$, -*] ++(0,1.5) coordinate(vcm) --++(0,0.5) coordinate(diffc);
\draw (diffc) -| ++(-0.5, 0.5) to[sV,l=$v_+$, name=vplus] ++(0,1) --++(0,2)
-- ++(2.5,0) coordinate(skin+ a) to[battery2, l=$E_+$, name=eplus] ++(1,0)
to[R=$R_+$, name=rplus] ++(2,0) coordinate(skin+ b) -- ++(0.5,0)
-- ++(4,0) coordinate(hpin+) to[highpass] ++(2,0)
node[inst amp, anchor=+, noinv input up,
circuitikz/amplifiers/scale=1.6,
circuitikz/tripoles/inst amp/width=1](LNA){LNA}
(LNA.out);
\coordinate (skin- a) at (LNA.- -| skin+ a);
\draw (diffc) -| ++(0.5,0.5) to[sV,l_=$v_-$, name=vminus] ++(0, 1) |- (skin- a);
\draw (skin- a) to[battery2, l_=$E_-$, name=eminus] ++(1,0)
to[R, l_=$R_-$, name=rminus] ++(2,0) coordinate(skin- b) -- ++(2.5,0)
-- (skin- b -| hpin+) to[highpass] (LNA.-);
\coordinate (gnd a) at (vcm -| skin+ a);
\draw (vcm) -- (gnd a) to[battery2, l_=$E_\mathrm{gnd}$, name=egnd] ++(1,0)
to[R, l_=$R_\mathrm{gnd}$, name=rgnd] ++(2,0) coordinate(gnd b);
% switch set
\def\swdown{-3.2}
\draw (skin- b) ++(1,0) coordinate(sw1) to[cosw, invert, mirror, l=1, *-, name=s1] ++(0,\swdown) to[short, -*] ++(0, -1.5);
\draw (sw1) ++(1,0) coordinate(sw2) to[cosw, invert, mirror, l=2, *-] ++(0,\swdown) to[R=$R$, -*] ++(0, -1.5);
\draw (sw2|-skin+ b) ++(1,0) coordinate(sw3) to[short, *-] (sw3|-sw2) to[cosw, invert, mirror, l=3,] ++(0,\swdown) to[R=$R$, -*] ++(0, -1.5);
\draw (sw3) ++(1,0) coordinate(sw4) to[short, *-] (sw4|-sw2) to[cosw, invert, mirror, l=4, name=s4] ++(0,\swdown) to[short] ++(0, -1.5) coordinate(endsw);
\draw (gnd b) |- (endsw) node[rectjoinfill]{};
% boxes
\node [rectangle, draw, dashed, fit=(GND0) (vplus) (vpluslabel) (vminuslabel)](body){};
\node [anchor=south east, align=center] at (body.south east) {Body} ;
\node [rectangle, draw, dashed, fit=(rplus) (eplus) (epluslabel) (rpluslabel)](top){};
\node [rectangle, draw, dashed, fit=(eminus) (rminus) (eminuslabel) (rminuslabel)](bot){};
\node [anchor=center, align=center] at ($(top.south)!0.5!(bot.north)$) {electrodes} ;
\node [rectangle, draw, dashed, fit=(egnd) (rgnd) (egndlabel) (rgndlabel)](gnd){};
\node [below, align=center] at (gnd.south) {ground\\ electrode} ;
\node [rectangle, draw, dashed, fit=(s1) (s4label), inner ysep=8pt](switches){};
% ADC and micro
\draw (LNA.out) -- ++(0.5,0) node[msport,circuitikz/RF/scale=2](ADC){ADC};
\draw (ADC.right) -- ++(0.5,0) node[twoportshape, anchor=left, t=$\upmu$C](uC){};
\draw (uC.south) -- (uC.south |- switches.east) -- ++(-4,0)
node[align=left, anchor=east](DCS){\small digitally\\ controlled\\ switches};
\draw[-Stealth] (DCS.west) -- (switches.east);
% components
\node [anchor=north west] at ([xshift=-10pt, yshift=-5pt]switches.south east) {ADG1414};
\node [anchor=north west] at ([yshift=-5pt]LNA.refv down) {AD8429};
\end{circuitikz}
} % scalebox
10.8 An example with the compatibility option
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}
\usetikzlibrary{positioning}
\usepackage[compatibility]{circuitikzgit}
\ctikzset{bipoles/length=.9cm}
\begin{document}
\begin{tikzpicture}[circuit ee IEC]
\draw (0,0) to [resistor={name=R}] (0,2)
to[diode={name=D}] (3,2);
\draw (0,0) to[*R=$R_1$] (1.5,0) to[*Tnpn] (3,0)
to[*D](3,2);
\end{tikzpicture}
\end{document}
10.9 3-phases block schematic
\begin{circuitikz}[smallR/.style={european resistor, resistors/scale=0.5}]
\draw (0,0) node[tacdcshape, anchor=ac mid in](acdc){} to[smallR] ++(-2,0)
-- coordinate(point) node[circ](){} ++(-.5,0);
\draw (acdc.ac up in)
to[nos, invert, mirror, name=switch,color=red] ++(-2,0)
-- (point);
\draw (acdc.ac down in) to[smallR] ++(-2,0)
-- (point)
to[oosourcetrans,prim=wye,sec=delta,l=transformer] ++(-1.5,0)
to[tmultiwire] ++(-.5,0)
node[gridnode, anchor=right]{};
\node[above=.3cm,color=red] at (switch) {fault};
\draw (acdc.dc up out) to[smallR,l=HVDC line] ++(2,0 )
node[tdcacshape, anchor=dc up in](dcac){};
\draw (acdc.dc down out) -- (dcac.dc down in);
\draw (dcac.right)
to[ooosource,prim=delta,sec=delta,tert=wye,invert] ++(1.5,0)
to[tmultiwire] ++(.5,0) node[gridnode,anchor=left]{};
\end{circuitikz}
10.10 Using components in pics (since v1.8.0)
\tikzset{mypic/.pic = {
\draw (0,0) coordinate(-in)
% unnamed component
to[R=#1] ++(2,1)
% named component
to[leD*, diodes/scale=0.6, led arrows from cathode,
name=-led, l=label, v]
++(2,-1) coordinate(-out);
}
}
\begin{tikzpicture}
\ctikzset{voltage=raised}
\draw (0,0) to[R] ++(2,1);
\begin{scope}[xshift=2cm,
name prefix=inner-
]
\draw (0,0) to[R, name=r, i<] ++(2,1);
\end{scope}
\draw (4,0) pic(P){mypic=PR};
\node[circ] at (inner-r) {};
\node[circ, cyan] at (inner-r-Ipos) {};
\node[circ, red] at (P-led) {};
\node[circ, blue] at (P-ledlabel) {};
\node[circ, green] at (P-led-Vto) {};
\node[circ, purple] at (P-led-Vfrom) {};
\draw (4,0) pic[rotate=-60, scale=0.7, transform shape](P2){mypic=P2R};
\node[circ, red] at (P2-led) {};
\node[circ, blue] at (P2-ledlabel) {};
\node[circ, green] at (P2-led-Vto) {};
\node[circ, purple] at (P2-led-Vfrom) {};
%% extra data
\node[right] at (0, -1) {DIR: \ctikzgetdirection{inner-r}};
\node[right] at (0, -1.5) {ANC: \ctikzgetanchor{P-led}{Vlab}};
\node[right] at (0, -2) {Iarr: \ctikzgetdirection{inner-r-Iarrow}};
\node[right] at (0, -2.5) {LAB: \ctikzgetdirection{P2-ledlabel}};
\end{tikzpicture}
10.11 Automatic user-defined voltages, currents and flows (since v1.8.5)
%% This can go to your preamble and/or a style file!
%% setup voltage drawing macro: european style, but adding "+" and "-"
\newcommand\eurVPMstyled[4]{% node, label, style, one ignored arguments
\draw [thin, -{Stealth[width=4pt]}, shorten >=5pt, shorten <=5pt, #3]
% NOTICE that boldmath requires double braces to work in nodes
% see https://tex.stackexchange.com/q/487777/38080
(#1-Vfrom) node[font=\tiny]{{\boldmath$\vphantom{+}-$}}
.. controls (#1-Vcont1) and (#1-Vcont2)..
(#1-Vto) node[font=\tiny]{{\boldmath$+$}}
node[pos=0.5,anchor=\ctikzgetanchor{#1}{Vlab}]{#2};
}
% voltage shift must go after the "european voltage, v" pair
\ctikzset{vpms/.style 2 args={european voltages, v, voltage shift=2,
vif queue add={eurVPMstyled}{#1}{#2}{}}}
\ctikzactivatevoltagedirections{vpms}
% setup flow drawing macro: squiggle for power flux
%% requires \usetikzlibrary{decorations, decorations.pathmorphing}
\tikzset{ lray/.style={decorate, decoration={
snake, amplitude=2pt,pre length=1pt,post length=2pt, segment length=5pt,},
-Triangle}}
\newcommand\flowpow[4]{% node, label, color
\draw [lray, #3 ] (#1-Ffrom) -- (#1-Fto)
node [anchor=\ctikzgetanchor{#1}{Flab}, inner sep=4pt]
at (#1-Fpos) {#2};}
\ctikzset{fpow/.style 2 args={f, vif queue add={flowpow}{#1}{#2}{}}}
\ctikzactivateflowdirections{fpow}
% setup current drawing macros: 6 mm with Stealth arrow on the line, dark green
\newcommand{\inlinecurrent}[4]{% node, label
\draw [-{Stealth[scale=1.5]}, thick, color=green!50!black]
($(#1-Ipos)!3mm!(#1-Ifrom)$) -- ($(#1-Ipos)!3mm!(#1-Ito)$)
node [midway, inner sep=6pt, anchor=\ctikzgetanchor{#1}{Ilab}] {#2};
}
\ctikzset{iline/.style ={i, vif queue add={inlinecurrent}{#1}{}{}}}
\ctikzactivatecurrentdirections{iline}
%% setup end
%
% Let's draw our circuit!
%
% % "use auto vif" only needed if using old (before 2020) LaTeX or Plain or ConTeXt
\begin{circuitikz}[use auto vif]
\draw (0,0) to[R=$R_1$, iline={$i$}, vpms={$v_1$}{dashed}] ++(4,0)
to[R, l_=$R_2$, vpms^>={$v_2$}{blue}, fpow_={$P$}{red}] ++(4,0)
to[L=$L$, i=$i$, v=$v_L$, f>^=$P_L$] ++(4,0); % traditional still working!
\end{circuitikz}