\usetikzlibrary{matrix}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\usetikzlibrary{shapes.symbols}
\tikzstyle{block} = [draw,
rectangle,
thick,
minimum width=4.3cm,
align=center,
rounded corners]
\tikzstyle{outblock} = [block, fill=green!25, draw=green!70!black]
\tikzstyle{ucblock} = [block, fill=brown!50, draw=brown]
\tikzstyle{lin} = [thick, rounded corners]
\tikzstyle{outc} = [lin, -triangle 45]
\tikzstyle{inc} = [lin, triangle 45-]
\tikzstyle{ioc} = [lin, triangle 45-triangle 45]
\tikzstyle{vcc} = [-open triangle 90, thick]
\begin{document}
\footnotesize #1 \\
#2 \\
\footnotesize #3
}
\coordinate (arrowpeak-#1) at ($(#1.north) + (-3\hpitch,5mm)$);
\draw [vcc]
($(#1.north) + (-3\hpitch,0)$)
-- node [right, pos=1.2] {\llabel{#2}}
(arrowpeak-#1);
}
\draw [vcc]
($(#1.north) + (3\hpitch,0)$)
-- node [right, pos=1.2] {\llabel{#2}}
($(#1.north) + (3\hpitch,5mm)$);
}
\newlength{\hpitch}
\newlength{\vpitch}
\begin{tikzpicture}
%%% Blocks %%%
\matrix [row sep=1cm, column sep=1.5cm] {
\node[outblock] (bat) {\comptxt{Power Supply}{3V Lithium Battery}{}}; &
&
\node[block] (boost) {\comptxt{3.3V Boostconverter}{TPS61025}{}}; \\
%%%%%%%%%%%%%%%
\node[block] (ntx) {\comptxt{434\,MHz TX}{NTX2 433\,MHz}{Or RFM-228 (SPI)}}; &
&
\node[block] (osc) {\comptxt{Oscillator}{9.216\,MHz Crystal}{}}; \\
%%%%%%%%%%%%%%%
\node[block] (xbee) {\comptxt{868\,MHz TX/RX}{XBee 868\,MHz}{}}; &
&
\node[block] (swi) {\comptxt{silicon switch}{TS5A5624}{disable \IIC{}}}; \\
%%%%%%%%%%%%%%%
\node[block] (flash) {\comptxt{256\,Mbit flash}{S25FL256SAGNFI001}{}}; &
\node[ucblock] (uc) {\comptxt{Microcontroller}{ATmega1281}{}}; &
\node[block] (mux) {\comptxt{\IIC{} Mux/Conv.}{PCA9540}{}}; \\
%%%%%%%%%%%%%%%
\node[outblock] (beep) {\comptxt{Alarm}{Beeper}{+ Driver}}; &
&
\node[block] (9dof) {\comptxt{Motion Sensors}{9DOF-Board}{}}; \\
%%%%%%%%%%%%%%%
\node[block] (gps) {\comptxt{GPS RX}{MAX-6Q}{}}; &
&
\node[block] (temp) {\comptxt{Temp./Hum.}{SHT25}{}}; \\
%%%%%%%%%%%%%%%
\node[block] (cfg) {\comptxt{config memory}{4K EEPROM}{}}; &
&
\node[outblock] (temp2) {\comptxt{Temp./Hum.}{SHT25}{}}; \\
%%%%%%%%%%%%%%%
\node[block] (inout) {\comptxt{Input/Output Debug}{LEDs + DIP-switches}{}}; &
&
\node[block] (press) {\comptxt{pressure sensor}{SSCMNNN015PA2A3}{}}; \\
};
%%% Lines %%%
%% Left side to uC
% Battery - Boost converter
\draw [outc]
($(bat.east) + (0,\vpitch)$)
-- node [above] {\llabel{U$_{bat}$}}
($(boost.west) + (0, \vpitch)$);
% NTX2 - uC
\draw [inc]
(ntx)
-| node [above, near start] {\llabel{PWM 3.3V}}
(uc.north);
% XBee - uC
\draw [ioc]
(xbee)
-| node [above, near start] {\llabel{UART 3.3V}}
($(uc.north) - (\hpitch,0)$);
% Flash - uC
\draw [ioc]
(flash)
-- node [above=2pt] {\llabel{SPI 3.3V}}
(uc.west);
% Beeper - uC
\draw [ioc]
(beep)
-| node [above, near start] {\llabel{\IIC{} 3.3V}}
($(uc.south) - (1\hpitch,0)$);
% GPS - uC (UART)
\draw [ioc]
($(gps.east) + (0,\vpitch)$)
-| node [above, near start] {\llabel{UART 3.3V}}
($(uc.south) + (0\hpitch,0)$);
% GPS - uC (I/O)
\draw [outc]
($(gps.east) - (0,\vpitch)$)
-| node [below, near start] {\llabel{I/O 3.3V}}
($(uc.south) + (1\hpitch,0)$);
% GPS - config memory
\draw [ioc]
(gps)
-- node [right] {\llabel{\IIC{} 3.3V}}
(cfg);
% I/O Debug - uC
\draw [ioc]
(inout)
-| node [above, near start] {\llabel{I/O 3.3V}}
($(uc.south) + (2\hpitch,0)$);
%% Right side - uC
% Boost to uC
\draw [ioc]
($(boost.west) - (0,\vpitch)$)
-| node [below, near start] {\llabel{I/O 3.3V}}
($(uc.north) + (1\hpitch,0)$);
% Oscillator - uC
\draw [outc]
(osc)
-| ($(uc.north) + (2\hpitch,0)$);
% silicon switch - uC
\draw [ioc]
(swi)
-| node [above, near start] {\llabel{I/O 3.3V}}
($(uc.north) + (3\hpitch,0)$);
%% I2C bus
\draw [ioc]
(mux)
-- (uc.east);
\coordinate (i2c1) at ($(uc.east)!0.5!(mux.west)$);
\coordinate (i2c2) at (i2c1 |- 9dof);
\draw [outc] (i2c1)
-- (i2c2)
-- (9dof);
\draw [outc] (i2c2)
|- node [left, very near start] {\llabel{\IIC{} 3.3V}}
(press);
%% SHT25 to mux/conv
\draw[inc]
($(mux.east) - (0,\vpitch)$)
-- ($(mux.east) + (\hpitch,-\vpitch)$)
|- node [left, very near start] {\llabel{\IIC{} 3.3V}}
(temp);
\draw [inc]
($(mux.east) + (0,\vpitch)$)
-- ($(mux.east) + (2\hpitch,\vpitch)$)
|- node [auto] {\llabel{\IIC{} 3.3V}}
(temp2);
%% Serial port
\coordinate (serialend) at ($(xbee.east) + (1.5,-8mm)$);
\coordinate (xbeetmp) at ($(uc.north) - (\hpitch,0)$);
\coordinate (serialstart) at (xbeetmp |- serialend);
\draw ($(serialend) - (0.7mm,0)$) circle (0.7mm);
\draw[lin]
(serialstart)
-- node [above] {\llabel{SERIAL}}
(serialend);
%%% Power supplies %%%
\foreach \dev in {ntx,xbee,flash,gps,cfg,inout,boost,uc}{
\vcc{\dev}{3.3V}
}
\vccalt{swi}{3.3V}
\foreach \dev in {swi,mux,9dof,temp,temp2,press}{
\vcc{\dev}{3.3V\_\IIC{}}
}
%%% Antennas %%%
\coordinate (antoffset) at ($(ntx.west) + (-7mm,0)$);
\foreach \dev in {ntx,xbee,gps}{
\draw[thick]
(antoffset |- \dev.north)
-- (antoffset |- arrowpeak-\dev)
+(-1.5mm,0mm) -- +(0mm,-2.5mm)
+(1.5mm,0mm) -- +(0mm,-2.5mm)
-- (antoffset |- \dev)
-- (\dev.west);
}
%%% Legend %%%
\filldraw[draw=green!50!black, fill=green!25, rounded corners]
($(cfg.south east) + (5mm,0mm)$)
rectangle +(8mm,8mm)
($(cfg.south east) + (15mm,4mm)$)
node [right, align=center] {externe \\ Komponenten};
\end{tikzpicture}
\end{document}