Drogheda/03-Architecture-Hardware/circuitikz-wiring/wiring-blocks.tex

291 lines
22 KiB
TeX
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

% wiring-blocks.tex — shared CircuiTikZ blocks (es-MX) — Drogheda Watchdog v3 proto
% Requires: \usepackage{circuitikz} in the host document, then \input{wiring-blocks}
\usetikzlibrary{calc}
\definecolor{net5V}{HTML}{C62828}
\definecolor{net3V3}{HTML}{EF6C00}
\definecolor{netGND}{HTML}{212121}
\definecolor{netSig}{HTML}{1565C0}
\definecolor{netAna}{HTML}{2E7D32}
\definecolor{netTac}{HTML}{B8860B}
\definecolor{netIgn}{HTML}{800020}% guinda — ignición cruda 12–24 V (GX16 p3)
\definecolor{Indigo}{HTML}{2C3C5B}
\ctikzset{bipoles/length=0.75cm, font=\footnotesize}
% \pin{color}{nodename}{coord}{label}
\newcommand{\pin}[4]{\node[circle,fill=#1,text=white,inner sep=1.7pt,font=\bfseries\tiny] (#2) at (#3) {#4};}
\usetikzlibrary{arrows.meta}
% \ant{x}{y} — small antenna glyph rooted at (x,y)
\newcommand{\ant}[2]{\draw (#1,#2) -- ++(0,0.34) -- ++(-0.18,0.22); \draw (#1,#2) ++(0,0.34) -- ++(0.18,0.22);}
% ===== 1 · RIELES =====
\newcommand{\blkRieles}{%
\coordinate (r5) at (0,3.0); \coordinate (rg) at (0,-2.2);
\draw[net5V,line width=1pt] (-1.6,3.0)--(10.6,3.0); \node[net5V,font=\bfseries,anchor=south east] at (10.6,3.05){5 V};
\draw[netGND,line width=1pt] (-1.6,-2.2)--(10.6,-2.2); \node[netGND,font=\bfseries,anchor=north east] at (10.6,-2.25){GND};
\node[draw,rounded corners,minimum width=2.1cm,minimum height=1.5cm,align=center,font=\scriptsize](src) at (-0.2,0.4){Fuente 5 V\\SD-15B-05\\o banco};
\draw[net5V] (src.north) -- (src.north|-r5);
\draw[netGND] (src.south) -- (src.south|-rg);
\node[draw,fill=blue!8,rounded corners,minimum width=2.6cm,minimum height=1.8cm,align=center,font=\scriptsize](bp) at (4.2,0.4){\textbf{Blackpill}\\STM32F411};
\draw[net5V] (bp.north) -- (bp.north|-r5);
\draw[netGND] (bp.south) -- (bp.south|-rg);
\node[net3V3,font=\scriptsize,anchor=west] at (bp.east) {$\rightarrow$ 3.3 V};
\draw (9.0,3.0) to[C,l_=$100\,\mu$F$+$100\,nF] (9.0,-2.2);
}
% ===== 2 · LED DE ESTADO =====
\newcommand{\blkLED}{%
\pin{netSig}{PB0}{-1,0}{PB0}
\draw[netSig] (PB0) to[R,l=$330\,\Omega$,*-] (2.6,0);
\draw (2.6,0) to[leD] (2.6,-2.2) node[ground]{};
\node[anchor=west,font=\scriptsize,align=left,text width=3.7cm] at (3.6,-0.9){PB0 $\rightarrow$ 330\,$\Omega$ $\rightarrow$ ánodo; cátodo $\rightarrow$ GND.};
}
% ===== 3 · INTERRUPTOR DE CARGA =====
\newcommand{\blkCarga}{%
\coordinate (r5) at (0,3.0);
\draw[net5V,line width=1pt] (-1.6,3.0)--(9.2,3.0); \node[net5V,font=\bfseries,anchor=south east] at (9.2,3.05){5 V};
\pin{netSig}{PA1}{-1.6,0}{PA1}
\node[npn,anchor=base](Q) at (2,0){};
\node[font=\scriptsize,anchor=north] at ($(Q.south)+(0,-0.05)$){2N3904};
\draw[netSig] (PA1) to[R,l=$1\,\mathrm{k}\Omega$] (Q.base);
\draw (Q.emitter) -- ++(0,-1.4) node[ground]{};
\node[pmos,anchor=gate](M) at (6,1.7){};
\node[font=\scriptsize,anchor=south] at ($(M.north)+(0,0.05)$){IRF9540 (P)};
\coordinate (corner) at (Q.collector |- M.gate);
\draw[netSig] (Q.collector) -- (corner) -- (M.gate);
\draw (corner) to[R,l_=$10\,\mathrm{k}\Omega$] (corner |- r5);
\fill (corner) circle(1.6pt);
\draw[net5V] (M.source) -- (M.source |- r5);
\draw (M.drain) -- ++(0,-1.6) coordinate(sal);
\pin{netSig}{SAL}{sal}{SAL}
\node[anchor=west,font=\scriptsize] at ($(sal)+(0.25,0)$){Salida ``stack'' ($\rightarrow$ bloque 8)};
}
% ===== 4 · SENSADO =====
\newcommand{\blkSensado}{%
% PA0
\draw (-1.7,2.2) to[battery1,l_={18650 (1S4P, $\sim$12 Ah)}] (-0.2,2.2);
\pin{netAna}{PA0}{2.6,2.2}{PA0}
\draw[netAna] (-0.2,2.2) to[R,l=$10$k] (PA0);
\draw[netAna] (PA0) to[R,l=$10$k] (5.2,2.2); \draw (5.2,2.2)--++(0,-0.7) node[ground]{};
\node[anchor=west,font=\scriptsize] at (6.2,2.2){$\div2$ analóg.};
% PA4
\node[net5V,font=\bfseries\scriptsize,anchor=east] at (-1.7,0.4){5 V}; \draw[net5V] (-1.7,0.4)--(-0.2,0.4);
\pin{netAna}{PA4}{2.6,0.4}{PA4}
\draw[netAna] (-0.2,0.4) to[R,l=$10$k] (PA4);
\draw[netAna] (PA4) to[R,l=$10$k] (5.2,0.4); \draw (5.2,0.4)--++(0,-0.7) node[ground]{};
\node[anchor=west,font=\scriptsize] at (6.2,0.4){$\div2$ analóg.};
% PA5 — ignición real: 12–24 V -> DFR1015 (IN+/IN-/OUT+/OUT-) -> 100R -> (clamp + cap) -> PA5
\node[draw,rounded corners,minimum width=1.5cm,minimum height=1.25cm,font=\tiny,align=center](DFR) at (-0.35,-1.45){DFR1015\\$\rightarrow$\,5 V};
% ignition -> IN+ (upper-left)
\node[netIgn,font=\tiny,align=right,anchor=east] at (-2.05,-1.15){Ign.\\12–24 V\\(GX16 p3)};
\draw[netIgn,line width=0.9pt] (-2.0,-1.15) -- (-1.1,-1.15); \node[font=\tiny,anchor=south west] at (-1.08,-1.12){+};
% IN- (lower-left) -> common GND
\draw[line width=0.9pt] (-1.1,-1.75) -- (-1.6,-1.75) -- (-1.6,-2.45); \node[font=\tiny,anchor=north west] at (-1.08,-1.78){$-$};
% OUT+ (upper-right) -> 100R -> PA5
\draw[line width=0.9pt] (0.4,-1.15) to[R,l=$100$] (2.2,-1.15); \node[font=\tiny,anchor=south east] at (0.38,-1.12){+};
\coordinate (p5) at (2.7,-1.15);
\pin{netSig}{PA5}{3.5,-1.15}{PA5}
\draw[netSig,line width=0.9pt] (2.2,-1.15) -- (PA5); \fill (p5) circle(1.3pt);
% OUT- (lower-right) -> common GND
\draw[line width=0.9pt] (0.4,-1.75) -- (0.9,-1.75) -- (0.9,-2.45); \node[font=\tiny,anchor=north east] at (0.38,-1.78){$-$};
% common DFR ground (IN-/OUT- = GND del sistema)
\draw[line width=0.9pt] (-1.6,-2.45) -- (0.9,-2.45); \draw (-0.35,-2.45) -- (-0.35,-2.55) node[ground]{};
\node[font=\tiny,anchor=north] at (-0.35,-2.98){GND (IN$-$/OUT$-$)};
% BAT54 clamp to 3V3 + 100nF debounce on PA5
\draw[line width=0.8pt] (p5) -- (2.7,-0.95); \draw[line width=0.8pt] (2.7,-0.95) to[D,l_=BAT54] (2.7,-0.2);
\draw[net3V3,line width=0.9pt] (2.35,-0.2) -- (3.05,-0.2); \node[net3V3,font=\tiny,anchor=south] at (2.7,-0.16){3V3};
\draw[line width=0.8pt] (p5) to[C,l_=100\,nF] (2.7,-2.5); \draw (2.7,-2.5) node[ground]{};
\node[font=\tiny,anchor=west] at (3.85,-1.15){PA5 digital};
\node[anchor=north west,font=\tiny,align=left,text width=9.8cm] at (-2.1,-3.5){\textbf{!} \textbf{Banco (proto):} sin DFR1015 — un apagador \textbf{3V3 $\rightarrow$ PA5} simula la ignición. \textbf{Sin divisor}; el DFR1015 acepta 12 y 24 V y su \textbf{GND (IN$-$/OUT$-$) va al GND del sistema}; PA5 $\le$ 3.3 V.};
}
% ===== 5 · VENTILADOR (horizontal) =====
\newcommand{\blkVent}{%
\coordinate (r5) at (0,2.6);
% LM2596 makes the fan's SEPARATE 5 V (24 V -> 5 V)
\node[net5V,font=\bfseries\tiny,anchor=east] at (-2.55,2.6){24 V};
\draw[net5V,line width=0.9pt] (-2.5,2.6) -- (-2.15,2.6);
\node[draw,rounded corners,fill=blue!6,minimum width=1.5cm,minimum height=0.85cm,font=\tiny,align=center](LM) at (-1.4,2.6){LM2596\\24$\rightarrow$5 V};
\draw[line width=0.8pt] (-1.4,2.175) -- (-1.4,1.55) node[ground]{};
\draw[net5V,line width=1pt] (-0.65,2.6)--(7.6,2.6); \node[net5V,font=\bfseries,anchor=south east] at (7.6,2.65){5 V sep.};
% gate drive: PA6 -> 220 -> gate ; 100k gate -> GND
\pin{netSig}{PA6}{-1.6,0}{PA6}
\draw[netSig,line width=0.9pt] (PA6) to[R,l=$220$] (1.4,0);
\node[nmos](M) at (2.7,0){};
\draw[netSig,line width=0.9pt] (1.4,0) -- (M.gate); \fill (1.4,0) circle(1.3pt);
\draw[line width=0.9pt] (1.4,0) to[R,l_=$100$k] (1.4,-1.6); \draw (1.4,-1.6) node[ground]{};
\draw[line width=0.9pt] (M.source) -- (M.source|-0,-1.6) node[ground]{};
\node[font=\tiny,anchor=south east] at ($(M.gate)+(-0.02,0.05)$){G};
\node[font=\tiny,anchor=north west] at ($(M.source)+(0.06,-0.04)$){S};
\node[font=\tiny,anchor=south west] at ($(M.drain)+(0.05,0.05)$){D};
\node[font=\scriptsize,anchor=south] at (2.7,0.95){IRLZ44N (N)};
% 2-wire fan to the right, AT drain height -> clean horizontal drain wire to fan(-)
\path (M.drain) ++(3.0,0) coordinate(fc);
\node[draw,circle,minimum size=1.25cm,font=\scriptsize](F) at (fc){VENT};
\node[font=\tiny,anchor=north] at ($(F.south)+(0,-0.03)$){2 hilos};
\coordinate (fk) at ($(F.west)+(-0.6,0)$);
\draw[line width=0.9pt] (M.drain) -- (F.west); \fill (fk) circle(1.3pt);
\node[font=\tiny,anchor=north west] at ($(F.west)+(0.02,-0.03)$){$-$};
\node[net5V,font=\tiny,anchor=south west] at ($(F.north)+(0.02,0.02)$){+};
\draw[net5V,line width=0.9pt] (F.north) -- (F.north|-r5);
% flyback diode across fan (band/cathode -> +5V)
\draw[line width=0.9pt] (fk) to[D,l=1N5819] (fk|-r5);
% note (2-wire fan: no tach)
\node[anchor=north west,font=\scriptsize,align=left,text width=9.7cm] at (-2.6,-2.2){\textbf{!} Ventilador de \textbf{2 hilos}: \textbf{+} $\rightarrow$ 5 V sep. y \textbf{$-$} $\rightarrow$ \textbf{DRAIN (D)}. \textbf{G} = control (PA6); \textbf{S} = GND. El \textbf{5 V sep. lo hace un LM2596} (24$\rightarrow$5 V, \textbf{ajústalo a 5.0 V}) para que el arranque del ventilador no hunda el 5 V principal. \textbf{Sin tach}: PB10 sin usar (DNP).};
}
% ===== 6 · TEMP I2C =====
\newcommand{\blkTemp}{%
\coordinate (r3) at (0,2.6);
\node[draw,rounded corners,minimum width=2.3cm,minimum height=2.7cm](S) at (0,0){};
\node[font=\bfseries\scriptsize,align=center] at (0,0.7){AHT10\\(T + RH)};
\node[font=\tiny] at (0,-0.7){0x38 (fija)};
\foreach \y/\nm in {0.9/VCC,0.35/GND,-0.4/SCL,-0.95/SDA}{\draw (1.15,\y)--(1.7,\y); \node[anchor=east,font=\tiny] at (1.05,\y){\nm};}
\draw[net3V3] (1.7,0.9) -| (3.2,2.6); \node[net3V3,anchor=south,font=\scriptsize] at (3.2,2.6){3V3};
\draw[netGND] (1.7,0.35) -- ++(0.5,0) -- ++(0,-1.4) node[ground]{};
\pin{netSig}{PB6}{3.6,-0.4}{PB6} \draw[netSig] (1.7,-0.4)--(PB6);
\pin{netSig}{PB7}{3.6,-0.95}{PB7} \draw[netSig] (1.7,-0.95)--(PB7);
\draw[netSig] (2.6,-0.4) to[R,l=$4.7$k] (2.6,1.8) -- (2.6,2.6) -- (3.2,2.6);
\node[anchor=west,font=\scriptsize] at (4.4,-0.7){pull-ups 4.7\,k a 3V3};
\node[anchor=north west,font=\tiny,align=left,text width=9.6cm] at (-1.35,-1.75){\textbf{!} \textbf{AHT10} sustituye al SHT40 en el proto (sin stock; SHT40/TMP102 quedan para el PCB). VCC = \textbf{3V3, NUNCA 5 V} (1.8--3.6 V, el breakout no trae regulador). \textbf{SOLO el AHT10 en el bus} I\textsuperscript{2}C (restricción Aosong); dirección \textbf{0x38 fija} $\rightarrow$ firmware 0x44$\rightarrow$0x38. Mide \textbf{temperatura + humedad} del aire del gabinete.};
}
% ===== 7 · RESET + GAUGE =====
\newcommand{\blkResetGauge}{%
\pin{netSig}{NRST}{-1.2,1.6}{NRST}
\draw (NRST) -- (0.6,1.6); \draw (0.6,1.6) to[push button] (2.4,1.6);
\draw[netGND] (2.4,1.6) -- ++(0,-0.8) node[ground]{};
\node[anchor=west,font=\scriptsize] at (3.0,1.6){botón de reset $\rightarrow$ GND};
\foreach \i/\nm in {0/PB12,1/PB13,2/PB14,3/PB15}{%
\pin{netSig}{\nm}{\i*2.1,-0.4}{\nm}
\draw (\nm) to[R,l=$330$] (\i*2.1,-1.9); \draw (\i*2.1,-1.9) to[leD] (\i*2.1,-3.0) node[ground]{};
}
\node[anchor=west,font=\scriptsize,Indigo] at (-0.3,-3.7){\textbf{!} Quedan apagados hasta tener firmware};
}
% ===== 8 · CONEXIÓN DEL STACK RTK (simpleRTK2B + 4G NTRIP) =====
\newcommand{\blkStack}{%
\node[font=\scriptsize\bfseries,Indigo,anchor=south] at (-1.3,1.9){del watchdog (Blackpill)};
\pin{net5V}{wSAL}{-1.3,1.2}{SAL}
\pin{netGND}{wGND}{-1.3,0.3}{GND}
\pin{netSig}{wTX}{-1.3,-0.7}{PA2}
\pin{netSig}{wRX}{-1.3,-1.7}{PA3}
\node[anchor=west,font=\tiny,gray] at (-0.95,-0.7){TX}; \node[anchor=west,font=\tiny,gray] at (-0.95,-1.7){RX};
\node[anchor=north,font=\tiny,gray] at (-1.3,0.95){SAL = bloque 3};
% simpleRTK2B Pro
\node[draw,fill=blue!7,rounded corners,minimum width=3.5cm,minimum height=4.1cm](F9P) at (4.3,-0.2){};
\node[font=\bfseries\scriptsize,align=center] at (4.3,1.35){simpleRTK2B Pro\\(ZED-F9P)};
\foreach \yy/\nm/\cc in {1.2/{5 V}/net5V,0.3/{GND}/netGND,-0.7/{UART1 RX}/netSig,-1.7/{UART1 TX}/netSig}{%
\draw[\cc,line width=0.9pt] (2.55,\yy)--(2.95,\yy); \node[anchor=west,font=\tiny] at (3.0,\yy){\nm};}
\draw[net5V,line width=1pt] (wSAL) -- (2.55,1.2); \node[net5V,font=\tiny,anchor=south] at (1.0,1.25){5 V conmutado};
\draw[netGND,line width=0.9pt] (wGND) -- (2.55,0.3);
\draw[netSig,line width=0.9pt] (wTX) -- (2.55,-0.7);
\draw[netSig,line width=0.9pt] (wRX) -- (2.55,-1.7);
% GNSS antenna
\draw (4.3,1.85) -- (4.3,2.45); \ant{4.3}{2.45} \node[anchor=west,font=\tiny] at (4.6,2.72){Antena GNSS (SMA)};
% 4G NTRIP master on the XBee socket
\node[draw,fill=black!8,rounded corners,minimum width=3.0cm,minimum height=2.3cm](G4) at (9.1,0.2){};
\node[font=\bfseries\scriptsize,align=center] at (9.1,0.7){4G NTRIP\\Master (XBee)};
\node[font=\tiny,align=center] at (9.1,-0.4){socket XBee del Pro\\(UART2 interno)};
\draw[densely dashed,line width=0.9pt] (6.05,0.2)--(7.6,0.2); \node[font=\tiny,anchor=south,align=center] at (6.82,0.3){socket XBee\\(3.3 V + datos)};
% LTE antennas
\draw (8.5,1.35)--(8.5,1.95); \ant{8.5}{1.95} \draw (9.7,1.35)--(9.7,1.95); \ant{9.7}{1.95} \node[anchor=west,font=\tiny] at (9.95,2.15){2$\times$ ant. LTE};
% RTCM flow
\draw[-{Stealth},Indigo,thick] (7.6,-0.55)--(6.05,-0.55); \node[Indigo,font=\tiny,anchor=north] at (6.82,-0.6){RTCM3 (correcciones)};
% notes
\node[anchor=north west,font=\scriptsize,align=left,text width=11.4cm] at (-1.3,-2.5){\textbf{!} El 4G va en el \textbf{socket XBee del simpleRTK2B Pro}, no al Blackpill; ahí recibe \textbf{3.3 V} y datos (el socket del Pro es de 3.3 V, no de 5 V). Las \textbf{correcciones (RTCM3) llegan por 4G}, no por el GNSS.\\ \textbf{!} Cruce \textbf{TX$\leftrightarrow$RX}: PA2 (TX) $\rightarrow$ UART1 RX y PA3 (RX) $\leftarrow$ UART1 TX. GND común. Relé \$PHLG opcional (PA9/PA10) = DNP, apagado por defecto.};
}
% ===== 10 · RESPALDO DE BATERÍA (PROTO): TP4056 + MT3608 =====
\newcommand{\blkBatt}{%
\coordinate (r5) at (0,2.4);
% rail: nodo SYS -> apagador de corte -> MAIN5V
\draw[net5V,line width=1pt] (-2.0,2.4)--(6.9,2.4); \node[net5V,font=\bfseries\tiny,anchor=south east] at (6.85,2.45){nodo SYS};
\draw[net5V,line width=1pt] (6.9,2.4) to[nos] (7.9,2.4); \node[font=\tiny,anchor=south,align=center] at (7.4,2.75){apagador\\de corte};
\draw[net5V,line width=1pt] (7.9,2.4)--(8.8,2.4); \node[net5V,font=\bfseries\tiny,anchor=north east] at (8.8,2.3){MAIN5V};
% vehicle 5V + OR diode D1
\node[net5V,font=\bfseries\tiny,anchor=east,align=right] at (-2.05,1.4){5 V veh.\\(SD-15B-05)};
\draw[net5V,line width=0.9pt] (-2.0,1.4) -- (-1.1,1.4);
\draw[net5V,line width=0.9pt] (-1.1,1.4) to[nos] (-0.125,1.4);
\node[font=\tiny,anchor=north,align=center] at (-0.6,1.13){IRF9540\\CHRG\_RUN (PA8)};
\fill (-1.1,1.4) circle(1.2pt); \draw[line width=0.9pt] (-1.1,1.4) -- (-1.1,1.8); \draw[line width=0.9pt] (-1.1,1.8) to[D] (-1.1,2.4); \node[font=\tiny,anchor=west] at (-1.0,2.06){1N5819};
% TP4056 charger
\node[draw,rounded corners,fill=blue!6,minimum width=1.55cm,minimum height=1.1cm,font=\tiny,align=center](TP) at (0.65,1.0){TP4056\\cargador};
\draw[line width=0.9pt] (-0.125,0.74) -- (-0.45,0.74) -- (-0.45,0.2) node[ground]{};
% shared battery+ node: TP BAT+ -- 18650+ -- MT IN+ (y=0.74)
\draw[line width=0.9pt] (1.425,0.74) -- (3.9,0.74);
\draw (2.5,0.74) -- (2.5,0.24); \draw (2.5,0.24) to[battery1] (2.5,-1.2); \fill (2.5,0.74) circle(1.2pt);
\node[font=\tiny,anchor=east,align=right] at (2.28,-0.55){18650\\1S4P $\sim$12 Ah};
\draw[line width=0.9pt] (2.5,-1.2) -- (2.5,-1.65) node[ground]{};
% NTC (cell temp) — UNUSED on proto: the TP4056 module has no TEMP pin
\draw[gray,line width=0.8pt,densely dashed] (3.8,-0.28) to[thR,l_={NTC 10k}] (3.8,-1.2) node[ground]{}; \node[gray,font=\tiny,anchor=south,align=center] at (3.8,-0.23){NTC — SIN USAR en proto\\(TP4056 sin pin TEMP; PCB $\rightarrow$ LTC4040)};
% MT3608 boost
\node[draw,rounded corners,fill=blue!6,minimum width=1.7cm,minimum height=1.1cm,font=\tiny,align=center](MT) at (4.75,1.0){MT3608\\elev.$\rightarrow$5 V};
\draw[line width=0.9pt] (4.75,0.45) -- (4.75,-0.55) node[ground]{};
\draw[line width=0.9pt] (5.6,1.26) -- (6.2,1.26); \fill (6.2,1.26) circle(1.2pt); \draw[line width=0.9pt] (6.2,1.26) -- (6.2,1.8); \draw[line width=0.9pt] (6.2,1.8) to[D] (6.2,2.4); \node[font=\tiny,anchor=west] at (6.3,2.06){1N5819};
% note
\node[anchor=north west,font=\tiny,align=left,text width=10.4cm] at (-2.05,-2.05){\textbf{!} \textbf{Stand-in de banco} (ya lo tienes): el \textbf{vehículo carga el 18650} por el TP4056; el \textbf{MT3608 eleva} 3.6 V $\rightarrow$ 5 V; los \textbf{2× 1N5819} hacen OR de veh + respaldo hacia el \textbf{nodo SYS}, y el \textbf{apagador de corte} (SPST) une SYS $\rightarrow$ MAIN5V: \textbf{mata vehículo Y batería} (= Bloque E del PCB, P11). Ajusta el MT3608 apenas $<$ 5 V del vehículo (prioridad al vehículo). \textbf{BAT\_SENSE} = 18650+ $\rightarrow$ PA0 (Bloque 4). El módulo TP4056 \textbf{no expone el pin TEMP} $\rightarrow$ el NTC del kit queda \textbf{SIN USAR} en proto (en el PCB va al LTC4040); la protección térmica de carga la hace el MCU con \textbf{PA8 (CHRG\_RUN)}: 1 k $\rightarrow$ 2N3904 $\rightarrow$ IRF9540 (pull-up 10 k) en el IN+ del TP4056. \textbf{PA8 ALTO = carga; MCU ausente = SIN carga} (inversión vs PCB CHRG\_EN $\rightarrow$ flag en firmware). El MCU lee temperatura por \textbf{AHT10} (Bloque 6) + \textbf{LM35 $\rightarrow$ PA7} y \textbf{NTC $\rightarrow$ PB1} (Bloque 11). El \textbf{PCB usa el LTC4040} (Bloque B).};
}
% ===== 11 · TEMPERATURA ANALÓGICA (NTC 10k -> PB1 ADC) =====
\newcommand{\blkTempA}{%
\node[net3V3,font=\bfseries\scriptsize,anchor=south] at (0,2.1){3V3};
\draw[net3V3,line width=0.9pt] (0,2.05) -- (0,1.85);
\draw (0,1.85) to[R,l=$10$k] (0,0.8);
\coordinate (nd) at (0,0.45);
\draw (0,0.8) -- (nd); \fill (nd) circle(1.3pt);
\draw (nd) to[thR,l=NTC\,10k] (0,-1.4) node[ground]{};
\draw[netAna,line width=0.9pt] (nd) -- (1.3,0.45); \pin{netAna}{PB1}{1.6,0.45}{PB1}
\node[font=\tiny,anchor=west] at (1.95,0.45){ADC (temperatura)};
\draw (nd) -- (-0.85,0.45); \draw (-0.85,0.45) to[C,l_=100\,nF] (-0.85,-0.75) node[ground]{};
% LM35 (second analog channel -> PA7)
\node[draw,rounded corners,minimum width=1.5cm,minimum height=1.7cm,font=\bfseries\scriptsize,align=center](LM) at (6.3,0.45){LM35};
\node[font=\tiny,anchor=north] at (6.3,-0.45){TO-92};
\draw[net5V,line width=0.9pt] (6.3,1.3) -- (6.3,1.95); \node[net5V,font=\bfseries\scriptsize,anchor=south] at (6.3,1.95){MAIN5V (5 V)};
\draw[netGND,line width=0.9pt] (6.3,-0.75) -- (6.3,-1.15) node[ground]{};
\draw[netAna,line width=0.9pt] (7.05,0.45) -- (7.8,0.45); \pin{netAna}{PA7}{8.1,0.45}{PA7}
\node[font=\tiny,anchor=west] at (8.45,0.45){ADC1\_IN7};
\node[font=\tiny,anchor=south] at (7.42,0.5){OUT};
\draw[netGND,line width=0.7pt] (5.55,1.0) -- (5.0,1.0); \draw (5.0,1.0) to[C,l_=100\,nF] (5.0,-0.2) node[ground]{};
\node[anchor=north west,font=\scriptsize,align=left,text width=9.4cm] at (-1.7,-1.9){\textbf{!} \textbf{Ruta analógica — dos canales.} \textbf{NTC $\to$ PB1} (ADC1\_IN9): divisor \textbf{3V3 — 10k(1\%) — NTC 10k — GND}; $\approx$1.65 V a 25 °C, baja al calentar; $\approx$165\,$\mu$A (sin auto-calentamiento); Beta ($\approx$3950)/Steinhart; \textbf{de contacto, al punto caliente} (celda/módem). \textbf{LM35 $\to$ PA7} (ADC1\_IN7): 10 mV/°C, alimentado a \textbf{5 V (nunca 3V3, necesita $\ge$4 V)}; salida $\le$1.5 V $\to$ segura para el ADC; \textbf{aire/tarjeta} (junto a TP4056/MT3608). Con el \textbf{AHT10} (Bloque 6, aire + RH) son \textbf{TRIPLE temperatura por 3 rutas independientes}; la humedad la da solo el AHT10. Cualquiera puede disparar \textbf{CHRG\_RUN} (corte de carga, PA8 — Bloque 10).};
}
% ===== 9 · MODO B — DIAGNÓSTICO POR NTRIP (relé + inyección $PHLG) =====
\newcommand{\blkStackB}{%
% ---------- F9P (left) ----------
\node[draw,fill=blue!7,rounded corners,minimum width=2.7cm,minimum height=4.6cm](F9P) at (1.75,0){};
\node[font=\bfseries\scriptsize,align=center] at (1.75,1.7){simpleRTK2B\\Pro (F9P)};
\node[font=\tiny,align=center,Indigo] at (1.75,-1.85){sw $\rightarrow$ UART1\\(UART2 libre)};
\draw (1.75,2.3)--(1.75,2.9); \ant{1.75}{2.9} \node[anchor=west,font=\tiny] at (2.0,3.05){Ant. GNSS};
\foreach \yy/\nm/\cc in {1.9/{5 V}/net5V,1.35/{GND}/netGND,0.6/{UART1 RX}/netSig,0.05/{UART1 TX}/netSig,-0.8/{TX2}/netSig,-1.5/{RX2}/netSig}{%
\draw[\cc,line width=0.9pt] (3.1,\yy)--(3.5,\yy); \node[anchor=east,font=\tiny] at (3.05,\yy){\nm};}
% ---------- Watchdog (middle, in-line) ----------
\node[draw,fill=Indigo!8,rounded corners,minimum width=2.5cm,minimum height=4.0cm](WD) at (6.4,0){};
\node[font=\bfseries\scriptsize,align=center,Indigo] at (6.4,1.5){Watchdog\\(Blackpill)};
\node[font=\tiny,align=center] at (6.4,-1.5){relé verbatim\\+ inyecta \$PHLG};
\foreach \yy/\nm/\cc in {1.9/{5 V}/net5V,1.35/{GND}/netGND,0.6/{PA2}/netSig,0.05/{PA3}/netSig,-0.8/{PA10}/netSig}{%
\draw[\cc,line width=0.9pt] (5.15,\yy)--(4.75,\yy); \node[anchor=west,font=\tiny] at (5.2,\yy){\nm};}
\draw[netSig,line width=0.9pt] (7.65,-0.8)--(8.05,-0.8); \node[anchor=east,font=\tiny] at (7.6,-0.8){PA9};
% ---------- 4G modem on breakout (right) ----------
\node[draw,fill=black!8,rounded corners,minimum width=2.7cm,minimum height=3.2cm](G4) at (10.6,-0.1){};
\node[font=\bfseries\scriptsize,align=center] at (10.6,0.8){4G NTRIP\\Master (XBee)};
\node[font=\tiny,align=center] at (10.6,-0.25){en breakout\\(BOB-08276)};
\draw (10.1,1.5)--(10.1,2.1); \ant{10.1}{2.1} \draw (11.1,1.5)--(11.1,2.1); \ant{11.1}{2.1} \node[anchor=west,font=\tiny] at (11.3,2.25){2$\times$ LTE};
\foreach \yy/\nm/\cc in {1.0/{VCC}/net3V3,-0.8/{DIN}/netSig,-1.5/{DOUT}/netSig}{%
\draw[\cc,line width=0.9pt] (9.25,\yy)--(8.85,\yy); \node[anchor=west,font=\tiny] at (9.3,\yy){\nm};}
% ---------- data connections ----------
\draw[netSig,line width=0.9pt,{Stealth}-] (3.5,0.6)--(4.75,0.6); % UART1 RX <- PA2
\draw[netSig,line width=0.9pt,-{Stealth}] (3.5,0.05)--(4.75,0.05); % UART1 TX -> PA3
\node[gray,font=\tiny,anchor=south] at (4.12,0.62){monitor};
\draw[netSig,line width=1pt,-{Stealth}] (3.5,-0.8)--(4.75,-0.8); % TX2 -> PA10
\draw[netSig,line width=1pt,-{Stealth}] (8.05,-0.8)--(8.85,-0.8); % PA9 -> DIN
\node[Indigo,font=\tiny,anchor=south] at (8.45,-0.72){\$PHLG};
% corrections direct (dashed, around the bottom)
\draw[netSig,densely dashed,line width=1pt,-{Stealth}] (8.85,-1.5) -- (8.85,-2.75) -- (3.5,-2.75) -- (3.5,-1.5);
\node[font=\tiny,anchor=south] at (6.1,-2.72){RTCM3 directo (no pasa por el MCU)};
% to server
\draw[-{Stealth},Indigo,thick] (11.9,1.5)--(12.6,2.0); \node[Indigo,font=\tiny,anchor=west] at (12.0,1.9){$\rightarrow$ servidor};
% notes
\node[anchor=north west,font=\scriptsize,align=left,text width=13.4cm] at (-1.4,-3.2){\textbf{!} \textbf{5 V/GND} de F9P y watchdog $=$ SAL/GND (bloque 3); \textbf{VCC del 4G $=$ 3.3 V} (buck «MODEM 3.3 V» desde SAL — nunca 5 V). \textbf{IOREF $=$ 3.3 V}. El 4G va en \textbf{breakout} (fuera del socket) y el switch del Pro en \textbf{UART1}, dejando UART2 libre.\\ \textbf{!} El MCU queda \textbf{en línea} en la subida (F9P TX2 $\rightarrow$ PA10 $\rightarrow$ PA9 $\rightarrow$ 4G DIN) e inyecta \$PHLG. La bajada \textbf{RTCM3 (4G DOUT $\rightarrow$ F9P RX2) es directa} (punteada). \textbf{PCB:} bypass normalmente-cerrado en UART2 $\Rightarrow$ un MCU ausente/colgado nunca corta las correcciones.};
}