Buzzer symbol in circuitikz

circuitikz

I miss the symbol for a buzzer in circuitikz. The labeling and orientation for the buzzer should work like the "push button". The "legs" in the symbol should be part of the symbol. So no additional line need to be draw. Using the symbol as im my example. An option for scaling the buzzer would certainly make sense.

\documentclass[border=10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{circuitikz}


\begin{document}

\begin{circuitikz}
  \draw (0,0) coordinate (p0) to[vsource, name=vsource]
         (0,2) coordinate (p1) --
       ++(1,0) coordinate (p2) --
       ++(0,1) coordinate (p3) to[push button, l_=$T_1$]
       ++(2,0) coordinate (p4) --
       ++(0,-1) coordinate (p7);
  \draw (p2) --
       ++(0,-1) coordinate (p5) to[push button, l^=$T_2$]
       ++(2,0) coordinate (p6) --
       (p7) to[buzzer, l^=$B_1$]
       ++(2,0) coordinate (p8) to[buzzer, l_=$B_2$]
       ++(0,-2) coordinate (p9) to[buzzer, l_=$B_3$]
       (p0);
  \node[inner sep=2pt, anchor=south east] at (vsource.e) {\tiny $+$};
  \node[inner sep=2pt, anchor=north east] at (vsource.w) {\tiny $-$};

\end{circuitikz}
\end{document}

Expected output:

enter image description here

I know that it is possible to define a new bipole in circuitikz, but my knowledge is not (yet) sufficient.

Best Answer

update

The shapes will be available in 1.5.0: https://github.com/circuitikz/circuitikz/pull/624

original answer

There are a lot of symbols on the linked page --- probably they are in fields different from electronics, which is my field ;-) and the main objective of circuitikz. Anyway, it should not be difficult to add some of them.

This is a "quick and dirty" solution. I just copied the "mic" over (as explained in the chapter about new components in the manual) and then modified it.

\documentclass[border=10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{circuitikz}

\makeatletter

\ctikzset{bipoles/buzzer/height/.initial=0.6}%
\ctikzset{bipoles/buzzer/depth/.initial=.1}%
\ctikzset{bipoles/buzzer/width/.initial=.4}%
%
\pgfcircdeclarebipolescaled{misc}
{}
{\ctikzvalof{bipoles/buzzer/depth}}
{buzzer}
{\ctikzvalof{bipoles/buzzer/height}}
{\ctikzvalof{bipoles/buzzer/width}}{%
    \pgfscope
        \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
        \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
        \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
        \pgfpatharc{0}{180}{\pgf@circ@res@right}
        \pgf@circ@draworfill
    \endpgfscope
    \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.4\pgf@circ@res@up}}
    \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{0pt}}
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
    \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{.4\pgf@circ@res@up}}
    \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{0pt}}
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
    \pgfusepath{draw}
}
\pgfcirc@activate@bipole@simple{l}{buzzer}

\makeatother

\begin{document}

\begin{circuitikz}
  \draw (0,0) coordinate (p0) to[vsource, name=vsource]
         (0,2) coordinate (p1) --
       ++(1,0) coordinate (p2) --
       ++(0,1) coordinate (p3) to[push button, l_=$T_1$]
       ++(2,0) coordinate (p4) --
       ++(0,-1) coordinate (p7);
  \draw (p2) --
       ++(0,-1) coordinate (p5) to[push button, l^=$T_2$]
       ++(2,0) coordinate (p6) --
       (p7) to[buzzer, l^=$B_1$]
       ++(2,0) coordinate (p8) to[buzzer, l_=$B_2$]
       ++(0,-2) coordinate (p9) to[buzzer, l_=$B_3$]
       (p0);
  \node[inner sep=2pt, anchor=south east] at (vsource.e) {\tiny $+$};
  \node[inner sep=2pt, anchor=north east] at (vsource.w) {\tiny $-$};

\end{circuitikz}
\end{document}

example of the new component

Related Question