# Relaxation Oscillator using Op-Amp in CircuiTikZ

• This tutorial is about drawing a relaxation oscillator in LaTeX using CircuiTikZ package. We will learn how to draw operational amplifier and how to connect different electrical components to its inputs and outputs. ## Short description

• The relaxation oscillator is built based on operational amplifier, resistors and capacitors. Resistors and capacitors are drawn along path unlike op-amp and the ground which are added as nodes. Check the code below to figure out how one can draw the above illustration!

## Relaxation oscillator LaTeX code

\documentclass[border=0.2cm]{standalone}

% Package
\usepackage{circuitikz}
\ctikzset{bipoles/thickness=1}

\begin{document}

\begin{tikzpicture}[line width=0.8pt]

\node[op amp,scale=1.5,fill=yellow!50] (opamp) at (0,0){};
\draw (opamp.-) -| ++(-0.1,2)node[above]{$V_{-}$} coordinate(vm);

% Draw capacitor
\draw (vm) to[C, l_=C,*-] ++(-3,0)node[ground]{};

% Draw resistors
\draw (vm) to[R, l=R] ++(3.5,0) -| (opamp.out);
\draw (opamp.+) -| ++(-0.1,-2)node[below]{$V_{+}$} coordinate(vp);
\draw (vp) to[R, l=R,*-] ++(-3,0)node[ground]{};
\draw (vp) to[R, l_=R] ++(3.5,0) -| (opamp.out);
\draw (opamp.out) to[short,*-o] ++(1,0) node[right]{$V_{out}$};

% Draw Vdd and Vss
\draw (opamp.up) to[short,-o] ++(0,1)node[right]{$V_{DD}$};
\draw (opamp.down) to[short,-o] ++(0,-1)node[right]{$V_{SS}$};

\end{tikzpicture}

\end{document}
• If you would to write a detailed tutorial about it, leave me a comment below or reach me via e-mail at admin@latexdraw.com, I will be happy to hear from you!