2
\documentclass[11pt]{article}
\usepackage{circuitikz}
\usepackage{tikz}
\begin{document}


\begin{circuitikz}
\node[op amp] at (2,1) (op1) {};
\node[ground] at (0,0) (gnd1) {};
\node[ocirc] at ($(op1.-)+(-3,0)$) (input) {};
\node[ocirc] at ($(op1.out)+(2,0)$) (output) {};
\node[capacitor] at (2,2.5) (c1) {};

\draw
(gnd1) |- (op1.+)
(input) to [R, bipoles/length=35pt] ($(input)+(2.5,0)$) -- (op1.-)
(op1.out) -- (output)
($(op1.out)+(1,0)$) |- (c1) -| ($(op1.-)+(-1,0)$);
\end{circuitikz}

\begin{circuitikz}
\node[capacitor] at (1,1) {};
\end{circuitikz}

\end{document}

I'm trying to draw a regular integrator circuit, but my capacitor will not show up. I'm using both C and capacitor as node name. This is what I get from my code above:

enter image description here

Best,

Matthew

1 Answer 1

5

somewhere in this site is the following answer (unfortunately i can't find it now):

    \documentclass{standalone}
\usepackage{circuitikz}
    \usetikzlibrary{calc}

\begin{document}
    \begin{circuitikz}[every pin/.append style={align=left, text=blue}]
    \scriptsize
  \draw
  (0, 0) node[op amp] (opamp) {\textcolor{blue}{OA}}
  (opamp.-) to[R] (-3, 0.5)
  (opamp.-) to[short,*-] ++(0,1.5) coordinate (leftC)
  to[C] (leftC -| opamp.out)
  to[short,-*] (opamp.out);
\node[pin=above left: \textcolor{red}{opamp.-}: coordinates of\\
                      OA's inverting (negative)\\
                      input] at (opamp.-) {};
\node[pin=above left: \textcolor{red}{++(0,1.5)} -- vertical offset \\
                      OA's inverting imput named     \\
                      "opamp.-" determine position   \\
                      of the coordinate (leftC)
                      ] at ($(opamp.-)+(0,1.5)$) {};
\node[pin=above right: \textcolor{red}{leftC $-|$ opamp.out}:\\
                      determine the coordinate of\\
                      intersection of lines:\\
                      horizontal from C and \\
                      vertical from OA output\\
                      (see dashed red lines)] at (leftC -| opamp.out) {};
    \draw[dashed, red]  (leftC) -- + (31mm,0)
                        (opamp.out) -- + (0,31mm);
%%%% explanations:
\node[pin=below right:\textcolor{red}{opamp} is name of     \\
                      coordinates {(0,0)}. They\\
                      determine the position\\
                      of OA] at (0,0) {};
\node[pin=below left:OA's non inverting input\\
                      (not used)] at (opamp.+) {};
\node[pin=above right:\textcolor{red}{opamp.out} is name of     \\
                      OA's output coordinates] at (opamp.out) {};
    \end{circuitikz}
\end{document}

which gives:

enter image description here

for your need you only need to remove all explanations, however, they can serve to see, how to draw electrical circuits with circuitikz package.

comparison to your code will chow you, where you made mistakes. considering above example it is simple derived the following solution:

\documentclass[margin=3mm]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{calc}

\begin{document}
\begin{circuitikz}[every pin/.append style={align=left, text=blue}]
\footnotesize
\draw
(0, 0) node[op amp] (opamp) {}
(opamp.-) to[R,l_=R1,-o] (-3, 0.5)
(opamp.-) to[short,*-] ++(0,1.5) coordinate (leftC)
to[C,l=C1] (leftC -| opamp.out)
to[short,-*] (opamp.out) 
(opamp.+) -- + (0,-0.5) node[ground] {}
(opamp.out) to[short,-o] + (0.5,0)
;
\end{circuitikz}
\end{document}

which gives:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .