6

How it is possible to draw an ADC (analog to digital converter) with tikz library ? Some Simple ADC like this ?

enter image description here

What is the right way to place nodes on such rectangle so that i can use it further with specifying nodes the same way we do when using some circuitikz figures

\draw 
(1.5,-2) node[op amp] (opamp) {}
;

and then use it's nodes:

 (opamp.-) to [short, -o] ++(-2.5, 0) node[left] {$V_1$} 
4

I'm not familiar with circuitikz, so perhaps it includes some clean way to define your own rectangular shapes with multiple inputs/outputs. If not, it can be done in plain tikz with a technique like the following:

\usetikzlibrary{calc}

\def\ADC#1#2#3#4#5{ % 1: pos, 2: node name, 3: width, 4: height, 5: number of pins
  \node[minimum width=#3cm, minimum height=#4cm, rectangle, draw] at (#1) (#2) {};
  \pgfmathsetmacro{\distance}{#4/(#5+1)}
  \foreach \p in {1,...,#5} {
    \coordinate (#2-L-\p) at ($(#2.north west)+(0,-\p*\distance)$);
    \coordinate (#2-R-\p) at ($(#2.north east)+(0,-\p*\distance)$);
  }
}

The macro \ADC{pos}{name}{width}{height}{N} draws a rectangle and defines N anchors points at each side (left or right) named (name-L-1), (name-L-2), etc for the left side and (name-R-1), (name-R-2), etc for the right side. It does not show any text, but after the rectangle is drawn, you can refer to those coordinates to place your labels, make connections, etc..

For example:

\begin{tikzpicture}
% Draw box and define anchors
\ADC{0,0}{ADC}{4}{5}{4};

% Draw labels
\node at (ADC) {\Large LTC1096};
\foreach \i/\l/\r in {1/{\stackrel{CS/}{SHUTDOWN}}/V_{CC},2/+IN/CLK,3/-IN/C_{OUT},4/GND/V_{REF}} {
 \draw (ADC-L-\i) node[right] {$\l$};
 \draw (ADC-R-\i) node[left] {$\r$};
}

% Connect anchors to whatever other place

\foreach \i in {1,...,4} {
  \draw (ADC-L-\i) -- +(-1,0);
}

\fill[blue] (6,3) circle (3mm) coordinate (whatever);
\draw (ADC-R-2) -- (whatever);

\end{tikzpicture}

Would produce:

Result

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.