5

It seems the amazing package CircuiTikZ is mainly focussed on electronics or circuit boards.

However, sometimes it is necessary to draw some contactor coils for relais, contactors etc. what is not yet available in CircuiTikZ predefined symbols.

Is it possible to draw this symbol by myself?

Screenshot of the desired element


Minimum Working Example (MWE):

\documentclass[border=5mm]{standalone}  
\usepackage{circuitikz}

\begin{document}
    \begin{circuitikz}

        \draw (0,0) to[twoport, l=$K1$] (0,2);% This is possible indeed, but not a "true" contactor coil...

    \end{circuitikz}
\end{document}

Screenshot of the current approach:

Screenshot of the current approach

2 Answers 2

6

It is possible using TiKz library tikz-relay (https://ctan.org/pkg/tikz-relay):

\documentclass[margin=3mm]{standalone}
\usepackage{circuitikz,tikz}
\usetikzlibrary{circuits.ee.IEC.relay}
\begin{document}
\begin{circuitikz}[circuit ee IEC relay,thick]
\draw (0,0) to [relay coil={info=$K_1$,term=A1,term'=A2}] (0,1);
\end{circuitikz}
\end{document}

enter image description here

5
  • 1
    Off topic, but what a dull relay! I guess some engineers take pride in NOT being artistic. Jun 9, 2019 at 0:09
  • :-). Engineers say that something should be good enough, extremely cheap.
    – user31034
    Jun 9, 2019 at 6:31
  • 1
    @JohnKormylo: Actually this is the common contactor coil symbol, at least in Europe. :-) This nearly squared shape from Rmanos approach was never seen here, maybe in the US? :-)
    – Dave
    Jun 9, 2019 at 9:37
  • @dave - European resistors aren't exactly works of art either. I was thinking more of the fancy coil and stdp switch combo relay symbol. OTOH, why confuse people with the internal workings? Sigh! Jun 9, 2019 at 16:02
  • @dave, it's almost square because I am lazy and just put width and height randomly... ;-) No standard has been consulted!
    – Rmano
    Jun 10, 2019 at 9:02
5

In circuitikz, you can use generic which is a rectangular blob:

\documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
%\usepackage[siunitx, RPvoltages]{circuitikzgit}
\begin{document}
\begin{circuitikz}[
    ]
    \ctikzset{relaycoil/.style={bipoles/generic/width=0.3, 
        bipoles/generic/height=0.4}}
    \draw (0,0) to[generic=K1, relaycoil, name=k1] ++(0,2);
    \node [rotate=90, above right, font=\scriptsize] at(k1.right) {A1};
    \node [rotate=90, above left, font=\scriptsize] at(k1.left) {A2};
\end{circuitikz}
\end{document}

relay contactor coil in circuitikz

Notice that the definition of width and height are thought for the element in a horizontal position.

3
  • 2
    Very good. You should reverse the labels of A1 and A2.
    – Sebastiano
    Jun 8, 2019 at 16:19
  • 1
    @Sebastiano thanks, done
    – Rmano
    Jun 8, 2019 at 16:21
  • 2
    My congratulation for all and I'm always disponible to help everybody. +1.
    – Sebastiano
    Jun 8, 2019 at 16:22

You must log in to answer this question.

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