Tikz for Circuits -1 : Passives


Circuitikz provides a set of macros to type­set­ting elec­tronic net­works. It is based on pgf and TikZ packages.
Here is the syntax for basic circuits to typeset using circuitikz in LaTeX tikzpicture environment .

Ideal sources

1
2
3
4
5
6
7
8
9
\begin{tikzpicture}
%--------start graphics code --------
\draw[step=0.5,very thin,black!20] (-1,-0.5) grid (6,2.5);
\draw (0,0) to[voltage source] (0,2);
\draw (2,0) to[current source] (2,2);
\draw (4,0) to[sI=$v_1$] (4,2);
\draw (6,0) node [ground] {};
%--------end graphics code ----------
\end{tikzpicture}

Rendered by QuickLaTeX.com

RC Circuit

1
2
3
4
5
6
7
8
9
10
11
\begin{tikzpicture}
%--------start graphics code --------
\draw[step=0.5,very thin,black!20] (-1,-0.5) grid (6,2.5);
\path (0,0) coordinate (ref_gnd);
\draw
  (ref_gnd) to[american voltage source=\(V\)] ++(0,2)
            to[R=\(R_1\)] ++(3,0) 
            to[C=\(C_1\)] ++(0,-2) 
  -- (ref_gnd);
%--------end graphics code ----------
\end{tikzpicture}

Rendered by QuickLaTeX.com

Series RLC Circuit

1
2
3
4
5
6
7
8
9
10
11
12
\begin{tikzpicture}
%--------start graphics code --------
\draw[step=0.5,very thin,black!20] (-1,-0.5) grid (6,2.5);
\path (0,0) coordinate (ref_gnd);
\draw
  (ref_gnd) to[american voltage source=\(V\)] ++(0,2)
            to[R=\(R_1\)] ++(3,0) 
            to[L=\(L_1\)] ++(3,0) 
            to[C=\(C_1\)] ++(0,-2) 
  -- (ref_gnd);
%--------end graphics code ----------
\end{tikzpicture}

Rendered by QuickLaTeX.com

Parallel RLC Circuit

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
\begin{tikzpicture}
%--------start graphics code --------
\draw[step=0.5,very thin,black!20] (-1,-1) grid (6,2.5);
\path (0,0) coordinate (ref_gnd);
\draw
  (ref_gnd) to[american voltage source=\(V\)] ++(0,2)
            -- ++(2,0)   to[R=\(R_1\)] ++(0,-2) -- (ref_gnd) 
  ++(2,2)   -- ++(1.5,0) to[L=\(L\)] ++(0,-2) -- ++(-1.5,0)
  ++(1.5,2) -- ++(1.5,0) to[C=\(C\)] ++(0,-2) -- ++(-1.5,0);
\fill[color=black] (ref_gnd)++(2,0)   circle[radius=0.08];
\fill[color=black] (ref_gnd)++(3.5,0) circle[radius=0.08];
\fill[color=black] (ref_gnd)++(2,2)   circle[radius=0.08];
\fill[color=black] (ref_gnd)++(3.5,2) circle[radius=0.08];
%--------end graphics code ----------
\end{tikzpicture}

Rendered by QuickLaTeX.com

T-pad Attenuator.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
\begin{tikzpicture}
%--------start graphics code --------
\draw[step=0.5,very thin, black!20] (-1,-0.5) grid (6,2.5);
\path (0,0) coordinate (ref_gnd);
\draw
  (ref_gnd)++(0,2) node[ocirc] 
  to [R=\(R_1\)] ++(2,0) 
  to [R=\(R_2\)] ++(2,0)  node[ocirc]
  ++(-2,0)  node[circ] 
  to [R=\(R_3\)] ++(0,-2) 
%  node[ground];
  ++(-2,0) node[ocirc] 
  to ++(2,0) node[circ] 
  to ++(2,0) node[ocirc];
%--------end graphics code ----------
\end{tikzpicture}

Rendered by QuickLaTeX.com

Leave a Comment