\documentclass[border=4pt]{standalone}
\usepackage{ga}
\input{../fm.tikz}
\begin{document}
\begin{circuitikz}[font=\small]
\draw (0,0) to[american voltage source, l=$V_\mathrm{in}$, invert] (0,2.6) to[R, l=$R_1$] (2.0,2.6) node[circ]{} to[short, -o] (3.2,2.6);
\draw (2.0,0) to[battery1, l_=$V_\mathrm{B}$] (2.0,1.2) to[empty diode, l_=$D_1$] (2.0,2.6);
\node[font=\footnotesize] at (1.6,2.25) {$-$}; \node[font=\footnotesize, left] at (1.75,1.95) {0.7 V}; \node[font=\footnotesize] at (1.6,1.55) {$+$};
\draw (0,0) -- (2.0,0) to[short, -o] (3.2,0);
\node at (3.2,2.15) {$+$}; \node at (3.4,1.3) {$V_\mathrm{out}$}; \node at (3.2,0.45) {$-$};
\begin{scope}[xshift=6.2cm, yshift=0.4cm]
\axes{-1.6}{3.0}{-0.6}{2.4}{$V_\mathrm{in}$}{$V_\mathrm{out}$}
\draw[cv] (-1.5,1.1) -- (1.1,1.1) -- (2.3,2.3); \yt{1.1}{2 V} \xt{1.1}{2 V}
\draw[densely dotted] (1.1,0) -- (1.1,1.1);
\draw (1.8,1.8) -- (2.1,1.8) -- (2.1,2.1); \node[right, font=\footnotesize] at (2.1,1.9) {1};
\end{scope}
\begin{scope}[yshift=-3.6cm]
\node[right, align=left] at (-1.6,2.0) {$V_\mathrm{in}>2$ V:\\ Diode off};
\draw (0.8,0) to[american voltage source, l=$V_\mathrm{in}$, invert] (0.8,2.4) to[R] (2.6,2.4) node[circ]{} to[short, -o] (3.6,2.4);
\draw (2.6,2.4) -- (2.6,1.9) node[ocirc]{}; \draw (2.6,1.4) node[ocirc]{} to[battery1] (2.6,0);
\draw (0.8,0) -- (2.6,0) to[short, -o] (3.6,0);
\node at (3.6,2.0) {$+$}; \node[right] at (3.6,1.2) {$V_\mathrm{out} = V_\mathrm{in}$}; \node at (3.6,0.4) {$-$};
\end{scope}
\end{circuitikz}
\end{document}
