2

I would like to draw a Power Splitter symbol for CircuiTikZ like the one here below but I don't really know where to start. Maybe such a symbol (even not with the "circles" at the input/output) alredy exists?

enter image description here

My first try is

\newcommand{\Splitter}[1] 
{  % #1 = name
\begin{scope}[transform shape]
\draw[thick] (#1)node[](a){} +(-12pt,-12pt) rectangle +(12pt,12pt);
\draw[rotate=0] ([yshift=0pt]a) +(-25pt,0) -- +(-5pt,0);
\draw[rotate=0] ([yshift=0pt]a) +(-5pt,0) -- +(9pt,9pt);
\draw[rotate=0] ([yshift=0pt]a) +(-5pt,0) -- +(9pt,-9pt);
\draw[rotate=0] ([yshift=0pt]a) +(9pt,-9pt) -- +(25pt,-9pt);
\draw[rotate=0] ([yshift=0pt]a) +(9pt,+9pt) -- +(25pt,+9pt);
\end{scope}
}

The problem is that including it in a document, it is impossible (or very difficult to connect my splitter to the input/output blocks.

MWE:

\documentclass{standalone}
\usepackage{circuitikz}
\newcommand{\Splitter}[1] 
{  % #1 = name
\begin{scope}[transform shape]
\draw[thick] (#1)node[](a){} +(-12pt,-12pt) rectangle +(12pt,12pt);
\draw[rotate=0] ([yshift=0pt]a) +(-25pt,0) -- +(-5pt,0);
\draw[rotate=0] ([yshift=0pt]a) +(-5pt,0) -- +(9pt,9pt);
\draw[rotate=0] ([yshift=0pt]a) +(-5pt,0) -- +(9pt,-9pt);
\draw[rotate=0] ([yshift=0pt]a) +(9pt,-9pt) -- +(25pt,-9pt);
\draw[rotate=0] ([yshift=0pt]a) +(9pt,+9pt) -- +(25pt,+9pt);
\end{scope}
}
\begin{document}  
\tikzset{ar/.style={-latex,shorten >=-1pt, shorten <=-1pt},
         block/.style = {draw, thick, rectangle, minimum height = 3em, minimum width = 3em}}
\begin{circuitikz}
%Input node
\node[block] at (-2,0) (in) {Input};

%Splitter
\path (0,0) to[sV,color=white,name=test]node[midway,above=-0.15cm]{Splitter}(0,1);
\Splitter{test}

%Input nodes
\node[block] at (+2,1) (out1) {Output 1};
\node[block] at (+2,-1) (out2) {Output 2};
\end{circuitikz}
\end{document}

enter image description here

Thank you for your help!

4
  • Welcome to TEX. What have you done so far? Can you show us some working code with \documentclass and \end{document}?
    – Bobyandbob
    Mar 22, 2018 at 7:53
  • Thank you @Bobyandbob for your answer. I added some details of what I have done so far.
    – G Tr3s0ld1
    Mar 22, 2018 at 8:15
  • Do you mean opamp? See: Lining amplifiers up in circuitikz
    – Bobyandbob
    Mar 22, 2018 at 10:01
  • @Bobyandbob no, not quite, a splitter is something very different from an Amplifier and should also be represented in another way.
    – G Tr3s0ld1
    Mar 22, 2018 at 10:27

2 Answers 2

2

an alternative :-)

enter image description here

splitter is defined as node. for its outputs are defined two new anchors: out A and out B:

\documentclass[border=1mm]{standalone}
\usepackage{siunitx}
\usepackage[siunitx]{circuitikz}
\usetikzlibrary{positioning,
                shapes
                }

\makeatletter
%%%% new anchors: "out A" and "out B"
\expandafter\def\csname pgf@anchor@rectangle@out A\endcsname{% output A: below .east
    \pgf@process{\southwest}%
    \pgf@ya=0.25\pgf@y%
    \pgf@process{\northeast}%
    \pgf@y=0.75\pgf@y%
    \advance\pgf@y by\pgf@ya    }% end of out A
\expandafter\def\csname pgf@anchor@rectangle@out B\endcsname{% output B: above .east
    \pgf@process{\southwest}%
    \pgf@ya=0.75\pgf@y%
    \pgf@process{\northeast}%
    \pgf@y=0.25\pgf@y%
    \advance\pgf@y by\pgf@ya    } % end of out B
\makeatother

\tikzset%
{
splitter/.style = {rectangle, draw, semithick, minimum height=10mm, minimum width=15mm,
                            append after command={\pgfextra{\let\LN\tikzlastnode
     \draw[thick] (\LN.west) -- ([xshift=-4mm] \LN.center)
                             -- ([xshift=-8mm] \LN.out A)
                             -- (\LN.out A)
  ([xshift=-4mm] \LN.center) -- ([xshift=-8mm] \LN.out B)
                             -- (\LN.out B);
    \node[left,font=\footnotesize] at (\LN.east) {#1};
                                                }}
                        },
         splitter/.default = {}
}
\begin{document}
\begin{circuitikz}
\node[splitter=\SI{-3}{\decibel},label=splitter] (s) {};
\draw[red]  ([xshift=-11mm] s.west) node[left] {P1} to[short,o-]  (s.west)
            (s.out A) to[short,-o] ++ (1,0) node[right] {P2}
            (s.out B) to[short,-o] ++ (1,0) node[right] {P3};
% showing used splitter anchors
\coordinate[pin={[gray]135:west}]   (c) at (s.west) {};
\coordinate[pin={[gray] 45:out A}]  (c) at (s.out A) {};
\coordinate[pin={[gray]-45:out B}]  (c) at (s.out B) {};
\end{circuitikz}
\end{document}
1

This solution puts the splitter at the origin and aligns everything else to it. While #1 was originally used to locate the splitter, I used it to name the node and as part of in, out1 and out2 coordinate names. (One cannot use . or : as name delimiters, as those are reserved.)

If you intend to use this a lot, you might look into creating a shape. Then you add anchor points and do things like node[splitter,anchor=in] to align the node relative to its input anchor, etc. I have some tutorials on my web site.

\documentclass{standalone}
\usepackage{circuitikz}
\newcommand{\Splitter}[1] 
{  % #1 = name
\begin{scope}[transform shape]
\draw[thick] node[](#1){} +(-12pt,-12pt) rectangle +(12pt,12pt);
\draw[rotate=0] ([yshift=0pt]#1) +(-25pt,0) coordinate(#1-in) -- +(-5pt,0);
\draw[rotate=0] ([yshift=0pt]#1) +(-5pt,0) -- +(9pt,9pt) -- +(25pt,9pt) coordinate(#1-out1);
\draw[rotate=0] ([yshift=0pt]#1) +(-5pt,0) -- +(9pt,-9pt) -- +(25pt,-9pt) coordinate(#1-out2);
\end{scope}
}
\begin{document}  
\tikzset{ar/.style={-latex,shorten >=-1pt, shorten <=-1pt},
         block/.style = {draw, thick, rectangle, minimum height = 3em, minimum width = 3em}}
\begin{circuitikz}
\Splitter{test}
\draw
  (test-in) node[block,left] {Input}
  (test-out1) node[block,above right] {Output 1}
  (test-out2) node[block,below right] {Output 2};
\end{circuitikz}
\end{document}

demo

You must log in to answer this question.

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