0

Does anyone know of a custom 4-pin/leg FET symbol in CircuitTikZ? Something similar to this would be perfect: enter image description here

There is a reasonable section in the original package but this would be much better for my purposes

2
  • Nigfetd is close, but I suspect no cigar. Commented Feb 26, 2017 at 0:32
  • @JohnKormylo Just so I am afraid. I don't have the skill just yet to make my own either!
    – user27119
    Commented Feb 26, 2017 at 22:47

2 Answers 2

2

This can be realized using a quite ugly hack by moving th Gateline over the source/drainline and supress drawing of the gate-connection using option "nogate":

\begin{circuitikz}
\ctikzset{tripoles/nigfetd/gate width/.initial=.5}%move gate over drain/source-line
\draw (0,0)node[nigfetd,nogate](t){};
\draw(t.G)++(0,0.35)coordinate(G1)--++(0.4,0){--++(0,0.25)};
\draw(t.G)coordinate(G2)--++(0.4,0){--++(0,0.25)};

\draw(G1)node[left]{$G_1$};
\draw(G2)node[left]{$G_2$};
\end{circuitikz}

enter image description here

Best regards, Stefan

1

This was somewhat complicated by not being able to use \drawfetcore.

\documentclass[border=1pt]{standalone}
\usepackage{circuitikz}

\makeatletter
% ***************************** nig2fetd *********************************

\ctikzset{tripoles/nig2fectd/.is family}
\ctikzset{tripoles/nig2fetd/width/.initial=.7}
\ctikzset{tripoles/nig2fetd/gate height/.initial=.35}% also used to locate top and bottom connections
\ctikzset{tripoles/nig2fetd/base height/.initial=.5}
\ctikzset{tripoles/nig2fetd/conn height/.initial=.35}
\ctikzset{tripoles/nig2fetd/height/.initial=1.1}
\ctikzset{tripoles/nig2fetd/base width/.initial=.5}
\ctikzset{tripoles/nig2fetd/gate width/.initial=.62}
\ctikzset{tripoles/nig2fetd/bodydiode scale/.initial=.3}
\ctikzset{tripoles/nig2fetd/bodydiode distance/.initial=.3}
\ctikzset{tripoles/nig2fetd/bodydiode conn/.initial=.6}
\ctikzset{tripoles/nig2fetd/curr direction/.initial=1}
\ctikzset{tripoles/nig2fetd/sub gate/.initial=.15}

\pgf@circ@definetranspath{nig2fetd}% not sure what this does


% N-CHANNEL IGFET DEPLETION TYPE
\pgfdeclaretransistorwrapperaddbulk{nig2fetd}{%
  \anchor{G1}{
             \northeast
             \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/sub gate}\pgf@y
             \left
             \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/curr direction}\pgf@circ@res@step
  }
    \anchor{G2}{
             \northeast
             \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/conn height}\pgf@y
             \left
             \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/curr direction}\pgf@circ@res@step
  }
}{%
    \pgf@circuit@trans@depletiontypetrue
    \pgftransformationadjustments
        %top connection
      \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
      \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@up}}
      \pgfpathlineto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@up}}
        \pgfusepath{draw}
        \pgfscope
      \pgfpathmoveto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base height}\pgf@circ@res@up}}
        \ifpgf@circuit@trans@depletiontype
              \pgfpathlineto{\pgfpoint
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base height}\pgf@circ@res@down}}
        \else

      \pgfpathlineto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base height}\pgf@circ@res@up*0.45}}
      \pgfpathmoveto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base height}\pgf@circ@res@up*0.25}}
      \pgfpathlineto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base height}\pgf@circ@res@down*0.25}}
      \pgfpathmoveto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@down*0.45}}
      \pgfpathlineto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base height}\pgf@circ@res@down}}
        \fi
      \pgfsetlinewidth{2\pgflinewidth}
        \pgfusepath{draw}
        \endpgfscope
        %Bulk connection line
      \pgfpathmoveto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgf@circ@res@up+\pgf@circ@res@down}}
      \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
        {\pgf@circ@res@up+\pgf@circ@res@down}}

      %bottom connection
      \pgfpathmoveto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@down}}
      \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
       {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@down}}
      \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}    
      \pgfusepath{draw}

     %draw thick gate lines
    \pgfscope
    \pgfpathmoveto{\pgfpoint
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/sub gate}\pgf@circ@res@down+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
    \pgfpathlineto{\pgfpoint
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
    \pgfpathmoveto{\pgfpoint
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/sub gate}\pgf@circ@res@up-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
    \pgfpathlineto{\pgfpoint
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
    \pgfsetlinewidth{2\pgflinewidth}
    \pgfusepath{draw}
    \endpgfscope

      \pgfscope
          \pgfslopedattimetrue 
          \pgfallowupsidedownattimetrue
          \pgfresetnontranslationattimefalse

          \pgftransformlineattime{.6}{%
            \pgfpoint
              {\pgf@circ@res@right}%
              {\pgf@circ@res@up+\pgf@circ@res@down}%
          }{%
            \pgfpoint%
              {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}%
              {\pgf@circ@res@up+\pgf@circ@res@down}%
          }
              \ifpgf@circuit@trans@ntype
              \else
              \pgftransformrotate{180}
              \fi
          \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
          \endpgfscope

        % GATE CONNECTION
        \ifpgf@circuit@bpt@drawgate
            \ifpgf@circuit@trans@ntype
                \pgfpathmoveto{\pgfpoint
                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/conn height}\pgf@circ@res@down}}
                \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/conn height}\pgf@circ@res@down}}
            \pgfpathmoveto{\pgfpoint
                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/sub gate}\pgf@circ@res@up}}
                \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/sub gate}\pgf@circ@res@up}}
            \else
                \pgfpathmoveto{\pgfpoint
                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
                    {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/conn height}\pgf@circ@res@down}}
                \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/conn height}\pgf@circ@res@down}}       
            \fi
        \pgfusepath{draw}
        \fi

      % SOURCE CONNECTION
      \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
      \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}    
      \pgfusepath{draw}

      % SOLDER DOT at source-bulk connection
      \ifpgf@circuit@fet@solderdot
      \pgfscope
        \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
          \pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@down}}
        \pgfnode{circ}{center}{}{}{}
      \endpgfscope{}
      \fi
}
\makeatother

\begin{document}
\begin{circuitikz}
\node[nig2fetd] (T) {};
\node[left] at (T.G1) {G1};
\node[left] at (T.G2) {G2};
\node[below] at (T.S) {S};
\node[above] at (T.D) {D};

\end{circuitikz}
\end{document}

demo

You must log in to answer this question.

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