\documentclass[border=10, convert={outfile=\jobname.png}]{standalone}

\usepackage[european resistor]{circuitikz}
\usetikzlibrary{fit, shapes.misc}
\usepackage{siunitx}

\begin{document}
\begin{circuitikz}[]
  % Raspberry Pi 3B
  \draw (0.5, 3.5) rectangle (3, -2);
  \node[right] at (1, 3) {\textbf{Raspi}};

  \draw (3.5, 2) to [short] (2.5, 2) node [left] {GND};
  \draw (3.5, 0) to [short] (2.5, 0) node [left] {GPIO18};

  \draw (1.75, -1.5) node [above] {USB}
    to [short] (1.75, -2.5);

  % Bread Board
  \draw (4, 3.5) rectangle (11.5, -4);
  \node[right] at (4.5, 3) {\textbf{Breadboard}};

  \draw (3.5, 2) to [short] (4.5, 2) node [circ] {}
    to [short] (6.5, 2) node [circ] {}
    to [short] (12, 2);

  \draw (3.5, 0) to [short] (4.5, 0) node [circ] {}
    to [R, l=$\SI{1.8}{\kilo\ohm}$] (6.5, 0)
    to [short] (10.5, 0);

  \draw (12, 1)
    to [short] (10.5, 1)
    to [R, l_=$\SI{120}{\ohm}$] (8.5, 1)
    to [empty led, l_=Green] (6.5, 1) node [circ] {};

  \draw (12, -1.5)
    to [short] (10.5, -1.5)
    to [R, l_=$\SI{120}{\ohm}$] (8.5, -1.5)
    to [empty led, l_=Yellow] (6.5, -1.5) node [circ] {};

  \draw (12, -3)
    to [short] (10.5, -3)
    to [R, l_=$\SI{120}{\ohm}$] (8.5, -3)
    to [empty led, l_=Red] (6.5, -3) node [circ] {};

  \draw (11, -3) to [short] (12, -3);

  \draw (4.5, 2) to [R, l=$\SI{2.1}{\kilo\ohm}$] (4.5, 0);

  \draw (6.5, 2) to [short] (6.5, -3);

  \draw (10.5, 1) node [circ] {}
    to [short] (10.5, 0);

  % Arduino Duemilanove
  \draw (12.5, 3.5) rectangle (16, -3.5);
  \node[right] at (13, 3) {\textbf{Arduino}};

  \draw (12, 2) to [short] (13, 2) node [right] {GND};
  \draw (12, 1) to [short] (13, 1) node [right] {D10};
  \draw (12, -1.5) to [short] (13, -1.5) node [right] {D11};
  \draw (12, -3) to [short] (13, -3) node [right] {D12};

  \draw (16.5, 2) to [short] (15.5, 2) node [left] {\SI{5}{\volt}};
  \draw (16.5, 0) to [short] (15.5, 0) node [left] {D13};

  \draw (15, -3) node [above] {USB}
    to [short] (15, -4);

  % Sensor
  \draw (17, 3.5) rectangle (19.5, -0.5);
  \node[right] at (17.5, 3) {\textbf{Sensor}};

  \draw (16.5, 2) to [short] (18, 2);
  \draw (16.5, 0) to [short] (18, 0);

  \draw (18, 2) to [normal open switch, name=switch] (18, 0);
  \node [rounded rectangle, line width=1pt, draw, fit=(switch), inner ysep=1pt, inner xsep=10, rotate=90] at (switch.center) {};

  % USB cable

  \draw (1.75, -2.5)
    to [short] (1.75, -5)
    to [short, l=Power for Arduino] (15, -5)
    to [short] (15, -4);
\end{circuitikz}

\end{document}

%%% Local Variables:
%%% coding: utf-8
%%% mode: latex
%%% TeX-engine: xetex
%%% End:
