[Tex/LaTex] Transformers in Circuitikz

circuitikz

This might be a basic question, but im trying to incorporate..

\draw (0,0) node [transformer](T){}
      (T.A1) node[anchor=east] {A1}
 (T.A2) node[anchor=east] {A2}
      (T.B1) node[anchor=north] {B1} 
      (T.B2) node[anchor=west] {B2}
      (T.base) node{K};
\draw (T.B1) -- (2,0);
\draw (2,0) to[D, v=${V_\gamma=0.7}$,i>_=](4,0);        

\draw (T.B2) to[D, v=${V_\gamma=0.7}$,i>_=](4,-2.1);      

How to do i then locate the legs of the transformer, ie draw some shorts on the right hand side so that I can make a centre tapped transformer, with to rectifying diodes coming off the right showing 240V_{rms} as input and 12V_{rms} on secondary. Also is there a graphic in circuitikz that shows the two lines in the middle of the inductors?. The way im doing it at the minute is to
do

\draw (x,y) -- (a,b);

Do i need to incorporate anchors with the transformer? Im not entirely sure how to do this..

Best Answer

This is one way of doing it. There is a model called transformer core that draws two vertical lines.

Update: With neutral line and transformer core

enter image description here

Code

\documentclass[border=10pt]{standalone}  
\usepackage[american,siunitx]{circuitikz}
\usetikzlibrary{arrows,shapes,calc,positioning}
\begin{document}  
\begin{circuitikz}[american]
\draw (0,0) node [transformer core](T){}  % reminded by @PaulGessler, thanks.
      (T.A1) node[above] {A1}
      (T.A2) node[below] {A2}
      (T.B1) node[above] {B1} 
      (T.B2) node[below] {B2}
      (T.base) node{K};
\draw (T.A1) --++(-2,0);
\draw (T.A2) --++(-2,0);
\draw (T.B1) --++(2,0) to[D, v=${V_\gamma=0.7}$, i>_=](5,0);        
\draw (T.B2) --++(2,0) to[D, v=${V_\gamma=0.7}$ ,i>_=](5,-2.1);
\draw(T.A1) to[open,v<={$240V_{rms}$}](T.A2);
\draw(T.B2) to[open,v>=$$](T.B1);
% 2 new lines for neutral line on the secondary side.
\draw[thick] ($(T.B1)!0.515!(T.B2)-(0.7,0)$)--node[pos=0.5,above,inner sep=0pt](n){$12V_{rms}$}++ (3,0);
\draw  (n) -- ++ (0,-0.3)node[ground]{};
\end{circuitikz}

\end{document}

enter image description here

Code

\documentclass[border=10pt]{standalone}  
\usepackage[american,siunitx]{circuitikz}
\usetikzlibrary{arrows,shapes,calc,positioning}
\begin{document}  
\begin{circuitikz}[american]
\draw (0,0) node [transformer](T){}
      (T.A1) node[above] {A1}
      (T.A2) node[below] {A2}
      (T.B1) node[above] {B1} 
      (T.B2) node[below] {B2}
      (T.base) node{K};
\draw (T.A1) --++(-2,0);
\draw (T.A2) --++(-2,0);
\draw (T.B1) --++(2,0) to[D, v=${V_\gamma=0.7}$, i>_=](5,0);        
\draw (T.B2) --++(2,0) to[D, v=${V_\gamma=0.7}$ ,i>_=](5,-2.1);
\draw(T.A1) to[open,v<={$240V_{rms}$}](T.A2);
\draw(T.B2) to[open,v>=$12V_{rms}$](T.B1);
\draw ($(T.base)+(1mm,-2mm)$)  -- ++(0,-1.8);
\draw ($(T.base)+(-1mm,-2mm)$) -- ++(0,-1.8);
\end{circuitikz}

\end{document}
Related Question