I'm trying to create a simplified symbol for a TL431 which has a zener diode in the center and three pins, cathode, anode and ref.
What I tried so far is to make use of the box function of circuitikz. However, it won't let me place a box around a zener (nor a regular diode). I also tried to scale down the diode with /tikz/circuitikz/bipoles/length=0.5cm and use the box option, but still nothing:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[siunitx,fetbodydiode,smartlabels]{circuitikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{figure}
\centering
\begin{circuitikz}[lbl/.style = {label={[label distance=4mm]above right:#1}}] % this line defines a new style to alter the distance of labels, mosfets due to diode and transformer label
\draw
(0,0) node[mixer,box,anchor=east] (m) {}
to[/tikz/circuitikz/bipoles/length=0.5cm,Do,box,>,-o] ++(2.5,0)
(m.west) node[inputarrow] {} to[short,-o]
++(-0.8,0)
(m.south) node[inputarrow,rotate=90] {} --
++(0,-0.7) node[/tikz/circuitikz/bipoles/length=0.5cm,Do,box,anchor=north] {}
;
\end{circuitikz}
\caption[Ersatzschaltbild]{Ersatzschaltbild}
\label{fig:ersatzschaltbild}
\end{figure}
\end{document}
Apart from the box, as an alternative, can I just use a regular zener which is included in circuitikz and add a third ref pin to it? How can I achieve that?
Thanks :)
/EDIT here is my result so far. Feel free to use it. Thanks for all your help.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[siunitx,european,fetbodydiode,smartlabels]{circuitikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{circuitikz}[lbl/.style = {label={[label distance=4mm]above right:#1}}] % this line defines a new style to alter the distance of labels, mosfets due to diode and transformer label
% Creating an smart objet
\def\TL431(#1)#2{%#1: Position#2: Identifier.
\begin{scope}[shift={(#1)}] % using to make coordinate objet.
\draw
(0,0) coordinate (A) coordinate (A #2) % set this coordinate as anode
to [zzD*,-](0,2) coordinate (B) coordinate (K #2); % set this coordinate to kathode (zzD* is circuittikz object)
\coordinate (C) at ($(A)!0.5!(B)$); % find the center point between A and B
\coordinate (D) at ($(A)!1!90:(C)$); % find a point orthogonal.
\node at (C) [rectangle, minimum size=7mm,draw=black,thick] {}; % input rectangle
\draw (C) -- +(D) coordinate (R #2);% draw the Vref pin and set tho coordinate Ref
% Set the labels
\draw (0,0.5) node[right] {\scriptsize A};
\draw (0,1.5) node[right] {\scriptsize K};
\draw (-1,0.8) node[right] {\scriptsize Ref};
%\draw (.4,1) node[right] {\small D - #2}; % diode label identifier % for later use
\draw (.4,1) node[right] {\small TL431}; % diode label identifier
\end{scope}
}
% Creating an smart objet
\def\Optocoupler(#1)#2{%#1: Position#2: Identifier.
\begin{scope}[shift={(#1)}] % using to make coordinate objet.
\draw
(0,0) coordinate (A) coordinate (Dr #2) % set this coordinate as drain
(0,2) coordinate (B) coordinate (K #2);
\coordinate (C) at ($(A)!0.5!(B)$); % find the center point between A and B
\coordinate[left=5mm of C] (Cl);
\coordinate[left=5mm of A] (Al);
\coordinate[left=5mm of B] (Bl);
\coordinate[right=5mm of C] (Cr);
\coordinate[right=5mm of A] (Ar);
\coordinate[right=5mm of B] (Br);
\draw (Bl) to [leDo] (Al);
\draw (Cr) node[npn,photo,nobodydiode](npn){};
\coordinate (D) at ($(A)!1!90:(C)$); % find a point orthogonal.
\node at (C) [rectangle, minimum width=2cm,minimum height=1cm,draw=black,thick] {}; % input rectangle
\draw (npn.C) to (Br) to[short,-o] ++ (.75,0) node[right]{C};
\draw (npn.E) to (Ar) to[short,-o] ++ (.75,0) node[right]{E};
\draw (1,1) node[right] {\small IL213AT}; % diode label identifier
\end{scope}
}
\ctikzset{bipoles/length=.8cm} % to avoid modify text sizes and separations.
% drawing first line input - R - Output
\draw (0,0) node [vcc](vcc){$U_{out}=\SI{24}{\volt}$};
% insert TL431 in position 2,-6 and identified as 1
\TL431(2,-6){1};
% conect first line and TL431
% \draw (2,0) to [short,*-*] (K 1); % K 1 is the identified coordinate kathode % for later use
% Conect TL431 to ground
\draw (A 1) to (2,-7) node [rground]{} coordinate(ground); % A 1 is the identified coordinate of anode
% draw the close loop between Ref and K
\draw(R 1) --++ (-1,0) coordinate (ref);
%\draw[-] (ref) |- (K 1); % for later use
\draw (ref) to[short,*-*] ++ (0,1) coordinate(c1);
\draw (c1) to[R,l_=$R_{F2}$,v^<=$U_{F2}$] ++ (0,2) coordinate(V24);
\draw (ref) to[R,l=$R_{F1}$,v=$U_{F1}$] ++(0,-2) node[rground]{};
\draw (c1) to[C,label=$C_{F1}$] (K 1);
\draw (vcc) to[short,-*] (V24);
% for testing is inserted another TL431 identified as 2 % for later use
%\TL431(7,-6){2};
% you can connect both
%\draw [-, dashed] (K 1) -- (K 2);
% Optocoupler side
\Optocoupler(4,-4){2};
\draw (V24) to [R,label=$R_{Led}$] (Bl);
\draw (Al) to[short,-*] (K 1);
\end{circuitikz}
\end{document}