Drogheda/03-Architecture-Hardware/Guia-Conexion-Protoboard/cuerpo.tex

684 lines
45 KiB
TeX
Raw 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.

% cuerpo.tex — Guía de Conexión en Protoboard v3.0 (bloques 1–11)
% Fuente de datos autoritativa: ../Drogheda_Conexiones-por-Bloque_Proto_v1.xlsx
% (hojas: Conexiones · Mapa de pines · Fuentes y convertidores · Estado y cambios)
% v3.0: catálogo visual (modulos-pinout.tex) + puente XBee 2.0→2.54 mm en el Bloque 9.
\section{Cómo usar esta guía}
Esta guía lleva al técnico de armado por el cableado completo del prototipo del
\textbf{watchdog HBOX v3} sobre tarjeta DEV / protoboard (MCU STM32F411 «Blackpill»,
firmware v2.3), organizado en \textbf{11 bloques} que se arman y prueban uno por uno.
No armes los bloques en el orden en que aparecen: sigue el \textbf{orden de armado} de la
sección~\ref{sec:orden}, que va de lo más simple (solo USB) a lo más delicado (stack RTK).
\medskip
\noindent\textbf{¿Primera vez con electrónica, o alguna pieza no se parece a lo que
esperabas?} Empieza por la sección~\ref{sec:identifica} (\emph{Identifica cada pieza}): ahí
está dibujado cada módulo y componente como se ve físicamente, con el nombre de cada patita
y a dónde va. Cada bloque incluye una línea «\textbf{Piezas de este bloque}» que te regresa
a esos dibujos.
\begin{helgennotice}[Documentos compañeros — dónde está cada cosa]
\begin{itemize}
\item \textbf{Lista de conexiones autoritativa:}
\texttt{Drogheda\_Conexiones-por-Bloque\_Proto\_v1.xlsx} (hojas \textit{Conexiones},
\textit{Mapa de pines}, \textit{Fuentes y convertidores}, \textit{Estado y cambios}).
Si esta guía y el XLSX difieren, \textbf{manda el XLSX}.
\item \textbf{Diagramas por bloque (CircuiTikZ):} \textbf{incrustados en esta guía} al final
de cada bloque. Los mismos dibujos, por separado: carpeta \texttt{circuitikz-wiring/} —
\texttt{Drogheda\_Diagrama\_CircuiTikZ.pdf} (lámina completa) y
\texttt{Drogheda\_Diagrama\_Beamer.pdf} (una diapositiva por bloque).
\item \textbf{Catálogo visual de piezas (nuevo en v3.0):} sección~\ref{sec:identifica} de
esta misma guía — vista física de cada módulo (LM2596, MT3608, TP4056, AHT10, DFR1015,
Blackpill, simpleRTK2B Pro, 4G) y patitas de cada componente (transistores, diodos, LEDs,
capacitores, resistencias por color).
\item \textbf{Estado eléctrico canónico del diseño:}
\texttt{watchdog-electrical-design-state.md} (léelo antes de cambiar cualquier cosa).
\item \textbf{Listas de compra:} \texttt{watchdog-LISTA-DE-COMPRAS-ES.xlsx} y
\texttt{watchdog-protoboard-BOM-3boards.xlsx}.
\end{itemize}
\end{helgennotice}
\section{Estado y cambios recientes}
\label{sec:estado}
Resumen de las decisiones y correcciones vigentes (hoja \textit{Estado y cambios} del XLSX).
Léelo antes de armar: aquí está lo que cambió respecto a versiones anteriores de la guía.
\hwtab{%
\begin{tabularx}{\textwidth}{@{}L{2.0cm} L{4.6cm} X@{}}
\toprule
\rowcolor{HelgenIndigo}\textcolor{white}{\textbf{Área}} & \textcolor{white}{\textbf{Cambio / estado}} & \textcolor{white}{\textbf{Detalle}}\\
\midrule
Batería & \textbf{Pack = $\sim$12\,Ah} (2026-06-30) & «40\,Ah» era un error; dimensiona R\textsubscript{PROG} + timer del LTC4040 (2.5\,A máx $\approx$ C/5).\\
Ventilador & 2 hilos (sin tacómetro) & PB10 DNP; el fallo del ventilador se infiere por temperatura (firmware pendiente).\\
Ventilador & 5\,V del ventilador = LM2596 & 24$\rightarrow$5\,V \textbf{separado} (ajustar a 5.0\,V) para no hundir el 5\,V principal (inrush).\\
Ignición & DFR1015 de 4 terminales & IN+/IN$-$/OUT+/OUT$-$; ambos GND al GND del sistema.\\
Ignición & Clamp BAT54 en PA5 & Ánodo = PA5, cátodo = 3V3 $\rightarrow$ PA5 $\le$ 3.3\,V; digital, \textbf{sin divisor} (Finding~2).\\
Batería & \textbf{NTC $\rightarrow$ pin TEMP del cargador} & TP4056 (proto) / LTC4040 (PCB); \textbf{no} va al MCU. El MCU lee temperatura por el TMP102 (I\textsuperscript{2}C).\\
Temperatura & NTC analógico $\rightarrow$ PB1 (si no hay SHT40) & Divisor 3V3 -- 10\,k (1\,\%) -- NTC 10\,k -- GND a PB1 (ADC1\_IN9). Firmware: Beta/Steinhart + posible corte CHRG\_EN. En el punto caliente (batería/módem). Bloque~11.\\
NTRIP & Modo B (relé / inyección \texttt{\$PHLG}) & F9P TX2 $\rightarrow$ PA10 $\rightarrow$ PA9 $\rightarrow$ 4G DIN (inyecta \texttt{\$PHLG}); RTCM3 DOUT $\rightarrow$ RX2 \textbf{directo}; breakout BOB-08276; switch $\rightarrow$ UART1; IOREF 3.3\,V.\\
Batería & Respaldo proto = TP4056 + MT3608 & 2$\times$ 1N5819 en «O» (OR) hacia MAIN5V; el PCB usa el LTC4040.\\
Firmware — pendiente & Gauge PB12--15 · CHRG\_EN · fan-fault por temperatura & \textbf{Bench-test antes de flashear} (el sandbox no compila STM32).\\
PCB — pendiente & Bloque B (LTC4040) + bypass fail-safe UART2 & El bypass \textbf{normalmente cerrado} evita que un MCU ausente/colgado corte las correcciones (Modo~B). Ver Bloque~9.\\
Cobertura de partes & Sección 1 + 3 = suficiente para el core & La sección 2 (TP4056/MT3608) solo hace falta para el respaldo de batería.\\
Temp/RH & \textbf{Suite proto = AHT10 + LM35 + NTC$\rightarrow$PB1} (2026-07-03) & El \textbf{AHT10} (0x38, I\textsuperscript{2}C1, \textbf{solo} en el bus) sustituye al SHT40 (sin stock; SHT40/TMP102 quedan para el PCB). \textbf{LM35 $\rightarrow$ PA7} (único ADC libre, alimentado a 5\,V). \textbf{Triple temperatura} por 3 rutas; humedad = solo AHT10. Firmware: driver AHT10 (0x44$\rightarrow$0x38) + canal PA7.\\
Batería / carga & \textbf{TP4056 sin pin TEMP $\rightarrow$ corte por PA8} (2026-07-03) & El módulo del kit no expone TEMP: su NTC queda \textbf{sin usar} en proto. Nuevo corte de carga: PA8 (\textbf{CHRG\_RUN}) $\rightarrow$ 2N3904 $\rightarrow$ IRF9540 en el IN+ del TP4056. PA8 ALTO = carga; MCU ausente = \textbf{sin carga}. \textbf{Inversión vs PCB} (CHRG\_EN alto = corta) $\rightarrow$ flag en firmware. Bloque~10.\\
Corte general & Apagador SPST tras el nodo OR (2026-07-03) & Nodo SYS (unión de los 2$\times$ 1N5819) $\rightarrow$ \textbf{apagador} $\rightarrow$ riel MAIN5V: mata vehículo \textbf{y} batería (= Bloque E del PCB, P11). Bloque~10.\\
Capacitores & En mano: 100\,nF cer. + 10\,$\mu$F y 100\,$\mu$F elec. (2026-07-03) & Cubren toda la guía. Los 10\,$\mu$F = desacople local opcional en salidas de módulos. \textbf{Electrolíticos CON polaridad.}\\
Vent. / botones & Ventilador 2 hilos + apagador + botones \textbf{en mano} (2026-07-03) & Reset y gauge dejan de ser opcionales: \textbf{todo va en el protoboard}.\\
\bottomrule
\end{tabularx}}
\section{Leyenda de colores de cable}
Los mismos colores de los diagramas CircuiTikZ; úsalos también en el cableado físico.
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l l X@{}}
\toprule
\rowcolor{HelgenIndigo}\textcolor{white}{\textbf{Cable}} & \textcolor{white}{\textbf{Red}} & \textcolor{white}{\textbf{Qué lleva}}\\
\midrule
ROJO & \redV & 5\,V — alimentación principal (MAIN5V) y 5\,V separado del ventilador\\
NARANJA & \redT & 3.3\,V — sale del Blackpill (sensores, pull-ups, ignición, temperatura)\\
NEGRO & \redG & GND — tierra común (todo se une aquí)\\
AZUL & \redS & Señal lógica / digital / UART\\
VERDE & \redA & Sensado analógico ($\div$2, ADC): PA0, PA4, PB1\\
GUINDA & \redI & Ignición cruda 12--24\,V (a la entrada del DFR1015)\\
\bottomrule
\end{tabularx}}
% ===== Catálogo visual de módulos y componentes (v3.0) =====
\input{modulos-pinout}
\section{Mapa de pines del Blackpill (tabla)}
La misma información del dibujo de la sección~\ref{sec:blackpill}, ahora en tabla. Busca
cada etiqueta impresa en la tarjeta. (Hoja \textit{Mapa de pines} del XLSX.)
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l X l l@{}}
\toprule
\rowcolor{HelgenIndigo}\textcolor{white}{\textbf{Pin}} & \textcolor{white}{\textbf{Función}} & \textcolor{white}{\textbf{Tipo}} & \textcolor{white}{\textbf{Bloque(s)}}\\
\midrule
5V / GND / 3V3 & Rieles (3V3 = LDO del Blackpill) & Power & 1\\
PA0 & BAT\_SENSE — batería $\div$2 & ADC & 4, 10\\
PA1 & PWR\_CTRL — interruptor de carga del «stack» & Salida & 3\\
PA2 & USART2 TX $\rightarrow$ F9P UART1 RX (NMEA) & UART & 8, 9\\
PA3 & USART2 RX $\leftarrow$ F9P UART1 TX (NMEA) & UART & 8, 9\\
PA4 & 5V\_SENSE — vehículo $\div$2 & ADC & 4\\
PA5 & IGN\_SENSE — digital, \texttt{INPUT\_PULLDOWN}, \textbf{sin divisor} (máx 3.3\,V) & Entrada dig. & 4\\
PA6 & FAN\_PWM — 25\,kHz (TIM3\_CH1) & PWM & 5\\
PA7 & LM35\_TEMP — 10\,mV/\textdegree C (ADC1\_IN7) & ADC & 11\\
PA8 & CHRG\_RUN (proto) — \textbf{ALTO = carga permitida}; corta el IN+ del TP4056 si la celda está caliente. \textbf{Inversión vs PCB} (CHRG\_EN alto = corta) & Salida & 10\\
PA9 & Modo B: USART1 TX $\rightarrow$ 4G DIN (relé \texttt{\$PHLG}) & UART & 9\\
PA10 & Modo B: USART1 RX $\leftarrow$ F9P TX2 (relé); 22\,k$\Omega \rightarrow$ 3V3 & UART & 9\\
PB0 & EXT\_LED — LED de estado & Salida & 2\\
PB1 & Temperatura analógica (divisor NTC) — ADC1\_IN9 (libre) & ADC & 11\\
PB6 & I\textsuperscript{2}C1 SCL — AHT10 (0x38, \textbf{solo} en el bus; SHT40/TMP102 = PCB) & I\textsuperscript{2}C & 6\\
PB7 & I\textsuperscript{2}C1 SDA — AHT10 (0x38) & I\textsuperscript{2}C & 6\\
PB10 & FAN\_TACH — DNP (ventilador de 2 hilos) & — & 5\\
PB12--PB15 & Gauge de batería (4 LEDs) — firmware pendiente & Salida & 7\\
PC13 & LED onboard (activo-bajo) & Salida & —\\
NRST & Reset (botón a GND) & Reset & 7\\
\bottomrule
\end{tabularx}}
\section{Fuentes y convertidores — ajústalos ANTES de conectar}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}L{2.5cm} X L{3.1cm} L{1.6cm}@{}}
\toprule
\rowcolor{HelgenIndigo}\textcolor{white}{\textbf{Componente}} & \textcolor{white}{\textbf{Qué es / ajuste}} & \textcolor{white}{\textbf{Entrada $\rightarrow$ salida}} & \textcolor{white}{\textbf{Bloque}}\\
\midrule
Mean Well SD-15B-05 & Fuente principal 24$\rightarrow$5\,V (o un banco de 5\,V). Es el riel \textbf{MAIN5V} (módulo industrial). & 18--36\,V $\rightarrow$ 5\,V · 3\,A & 1\\
LM2596 (o MP1584) & 5\,V \textbf{separado} para el ventilador. \textbf{¡Ajústalo a 5.0\,V con el multímetro ANTES de conectar!} Vienen en voltaje aleatorio. En el PCB este papel lo hace el MP1584 (U2). & 24\,V $\rightarrow$ 5.0\,V ajustable & 5\\
DFR1015 & Acondiciona la ignición. Acepta 12 y 24\,V; 4 terminales (IN$\pm$/OUT$\pm$) y \textbf{ambos GND al GND del sistema}. On-board en la v3 (GX16 pin~3 = ignición cruda). & 12--24\,V $\rightarrow$ 5\,V & 4\\
TP4056 & Cargador del 18650 (\textbf{proto}; stand-in de banco). El módulo \textbf{no expone el pin TEMP} $\rightarrow$ corte de carga por PA8 (CHRG\_RUN) en el IN+. El PCB usa el LTC4040. & 5\,V vehículo $\rightarrow$ carga 1S & 10\\
MT3608 & Elevador de respaldo. Ajústalo \textbf{apenas por debajo} del 5\,V del vehículo para que el vehículo tenga prioridad. & 3.6\,V $\rightarrow$ 5\,V & 10\\
LTC4040 (PCB) & Battery-backup manager: carga + power-path + boost + NTC. Carga temp-cualificada por NTC; R\textsubscript{PROG} $\approx$ C/5 $\le$ 2.5\,A para 12\,Ah. & 5\,V vehículo / batería $\rightarrow$ 5\,V & B (por diseñar)\\
18650 1S4P & Pack de respaldo \textbf{$\sim$12\,Ah} («40\,Ah» era un error, corregido 2026-06-30). \textbf{Respeta la polaridad.} & — $\rightarrow$ 3.6\,V · $\sim$12\,Ah & 4, 10\\
\bottomrule
\end{tabularx}}
\section{Conexiones por bloque (1--11)}
\label{sec:bloques}
Cada tabla lista las conexiones como \textbf{desde $\rightarrow$ vía $\rightarrow$ hacia}, con la
red (color de cable) a la izquierda. Arma y prueba \textbf{un bloque a la vez}, en el orden de
la sección~\ref{sec:orden}. La línea «Piezas de este bloque» te lleva al dibujo físico de
cada componente; antes de energizar, corre el checklist de la sección~\ref{sec:protoboard}.
\bloque{1}{Rieles de alimentación}
\queprueba{arma los rieles 5\,V / GND / 3.3\,V que alimentan todo.}
\compbloque{Blackpill (§\ref{sec:blackpill}) · fuente 5\,V · apagador (§\ref{sec:botones}) ·
capacitores 100\,$\mu$F$+$100\,nF (§\ref{sec:diodos}) · protoboard (§\ref{sec:protoboard})}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}}
\toprule
\theadconex
\midrule
\redV & Fuente 5\,V (SD-15B-05 o banco) (+) $\rightarrow$ \textbf{apagador de corte} (SPST) $\rightarrow$ riel MAIN5V & Fuente principal — corte general \textbf{en mano}. Con el Bloque~10 armado, el apagador se recoloca: nodo SYS $\rightarrow$ riel (ver Bloque~10)\\
\redG & Fuente 5\,V ($-$) $\rightarrow$ riel GND & Tierra común\\
\redV & Riel MAIN5V $\rightarrow$ pin 5V del Blackpill & El Blackpill genera el 3.3\,V (LDO interno)\\
\redG & Riel GND $\rightarrow$ pin GND del Blackpill & \\
\redT & Blackpill 3V3 (salida) $\rightarrow$ sensores I\textsuperscript{2}C · pull-ups · ignición & Cargas pequeñas ($\mu$A--mA)\\
\redV & Riel MAIN5V $\rightarrow$ C 100\,$\mu$F + 100\,nF $\rightarrow$ riel GND & Desacople / reserva, cerca de la tarjeta\\
\bottomrule
\end{tabularx}}
\diagramabloque{1}{\blkRieles}
\bloque{2}{LED de estado (PB0)}
\queprueba{los códigos de parpadeo cambian con el estado.}
\compbloque{LED y R 330\,$\Omega$ (§\ref{sec:diodos}, §\ref{sec:resistencias})}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}}
\toprule
\theadconex
\midrule
\redS & PB0 $\rightarrow$ R 330\,$\Omega$ $\rightarrow$ ánodo del LED & LED 3/5\,mm\\
\redG & cátodo del LED $\rightarrow$ GND & códigos de parpadeo\\
\bottomrule
\end{tabularx}}
\diagramabloque{2}{\blkLED}
\bloque{3}{Interruptor de carga del «stack» (PA1) — EL CORAZÓN}
\queprueba{APAGADO al reset (estado seguro), ON cuando PA1 activa.}
\compbloque{2N3904 e IRF9540N (§\ref{sec:transistores}) · R 1\,k y 10\,k (§\ref{sec:resistencias})}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}}
\toprule
\theadconex
\midrule
\redS & PA1 $\rightarrow$ R 1\,k$\Omega$ $\rightarrow$ base 2N3904 (B) & Driver\\
\redG & 2N3904 emisor (E) $\rightarrow$ GND & \\
\redS & 2N3904 colector (C) $\rightarrow$ compuerta IRF9540 (G) & Nodo de compuerta\\
\redV & compuerta IRF9540 (G) $\rightarrow$ R 10\,k$\Omega$ $\rightarrow$ MAIN5V & Pull-up $\rightarrow$ \textbf{OFF por defecto} (estado seguro)\\
\redV & IRF9540 source (S) $\rightarrow$ MAIN5V & P-MOSFET (canal P)\\
\redS & IRF9540 drain (D) $\rightarrow$ SAL (salida conmutada «stack») & $\rightarrow$ Bloques 8/9 (stack RTK)\\
\redS & prueba: SAL $\rightarrow$ LED + R 330\,$\Omega$ $\rightarrow$ GND & Para ver el encendido/apagado\\
\bottomrule
\end{tabularx}}
\noindent{\small\textit{El pull-up de 10\,k$\Omega$ garantiza el invariante «apagado = estado
seguro»: sin MCU (o durante el reset) el stack queda \textbf{apagado}.}}
\diagramabloque{3}{\blkCarga}
\bloque{4}{Sensado: batería / 5\,V / ignición}
\queprueba{\texttt{veh}/\texttt{ign}/\texttt{vbat} cambian en el log (TLM).}
\compbloque{DFR1015 (§\ref{sec:dfr1015}) · diodo clamp 1N5819/BAT54 (§\ref{sec:diodos}) ·
R 10\,k y 100\,$\Omega$ (§\ref{sec:resistencias})}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}}
\toprule
\theadconex
\midrule
\redA & 18650+ (o potenciómetro) $\rightarrow$ R 10\,k$\Omega$ $\rightarrow$ PA0 & Divisor $\div$2 · BAT\_SENSE\\
\redA & PA0 $\rightarrow$ R 10\,k$\Omega$ $\rightarrow$ GND & Pierna inferior del divisor\\
\redA & MAIN5V (lado vehículo) $\rightarrow$ R 10\,k$\Omega$ $\rightarrow$ PA4 & Divisor $\div$2 · 5\,V/vehículo presente\\
\redA & PA4 $\rightarrow$ R 10\,k$\Omega$ $\rightarrow$ GND & \\
\redI & GX16 pin 3 (ignición 12--24\,V) $\rightarrow$ DFR1015 IN+ & Ignición \textbf{cruda} del gabinete\\
\redG & DFR1015 IN$-$ $\rightarrow$ GND & Retorno de ignición = GND del sistema\\
\redS & DFR1015 OUT+ (5\,V) $\rightarrow$ R 100\,$\Omega$ $\rightarrow$ PA5 & Acondiciona a nivel lógico\\
\redG & DFR1015 OUT$-$ $\rightarrow$ GND & \\
\redT & PA5 (ánodo) $\rightarrow$ BAT54 $\rightarrow$ 3V3 (cátodo) & Clamp: PA5 $\le$ 3.3\,V\\
\redG & PA5 $\rightarrow$ C 100\,nF $\rightarrow$ GND & Anti-rebote (con debounce en firmware)\\
\redS & Banco (proto): 3V3 $\rightarrow$ apagador / push-button $\rightarrow$ PA5 & Simula la ignición sin DFR1015. PA5 = digital, \texttt{INPUT\_PULLDOWN}, \textbf{sin divisor}\\
\bottomrule
\end{tabularx}}
\diagramabloque{4}{\blkSensado}
\bloque{5}{Ventilador (2 hilos)}
\queprueba{el ventilador arranca/sube con la temperatura.}
\compbloque{LM2596 «FAN 5.0\,V» (§\ref{sec:lm2596}) · IRLZ44N (§\ref{sec:transistores}) ·
1N5819 (§\ref{sec:diodos}) · R 220 y 100\,k (§\ref{sec:resistencias}) · ventilador (§\ref{sec:botones})}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}}
\toprule
\theadconex
\midrule
\redV & 24\,V (gabinete) $\rightarrow$ LM2596 (buck, ajustar a 5.0\,V) $\rightarrow$ riel 5\,V sep. & Riel \textbf{SEPARADO} para el ventilador (PCB = MP1584)\\
\redG & LM2596 GND (in/out) $\rightarrow$ GND & \\
\redS & PA6 $\rightarrow$ R 220\,$\Omega$ $\rightarrow$ compuerta IRLZ44N (G) & PWM 25\,kHz\\
\redG & IRLZ44N source (S) $\rightarrow$ GND & Low-side switch\\
\redS & compuerta IRLZ44N (G) $\rightarrow$ R 100\,k$\Omega$ $\rightarrow$ GND & Mantiene el FET apagado\\
\redG & IRLZ44N drain (D) $\rightarrow$ ventilador ($-$) & Cable negro\\
\redV & ventilador (+) $\rightarrow$ riel 5\,V sep. & Ventilador de 2 hilos\\
\redV & 1N5819 en paralelo al ventilador (banda $\rightarrow$ +5\,V sep.) & Flyback / anti-retorno inductivo\\
\redN & PB10 (tach) $\rightarrow$ sin usar (DNP) & 2 hilos $\rightarrow$ sin tacómetro; el fallo se infiere por temperatura (firmware)\\
\bottomrule
\end{tabularx}}
\subsubsection*{5b · Protección de polaridad de la fuente 24 V (Q10 $+$ Zener) — ármalo ANTES que el buck}
Entre la fuente de 24\,V y \textbf{todo} lo que cuelga de ella (LM2596 «FAN» y, en banco, el
DFR1015) va un MOSFET-P que \textbf{corta si la fuente se conecta al revés}. En la tarjeta es
Q10; en el protoboard úsalo en TO-220 (IRF9540N). Aquí es donde vive el \textbf{Zener de
15\,V (DzG, 1N4744A)}: protege la compuerta del FET (V$_{GS}$ máx $=$ 20\,V) porque la fuente
es de 24\,V.
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}}
\toprule
\theadconex
\midrule
\redI & Fuente 24\,V ($+$) $\rightarrow$ \textbf{drain (D)} de Q10 (IRF9540N) & La tab metálica $=$ D\\
\redI & \textbf{source (S)} de Q10 $\rightarrow$ nodo «24\,V protegido» $\rightarrow$ LM2596 «FAN» IN$+$ (y DFR1015 IN$+$ si usas la misma fuente para ignición) & Aguas abajo ya nadie ve polaridad inversa\\
\redS & \textbf{gate (G)} de Q10 $\rightarrow$ R 100\,k$\Omega$ $\rightarrow$ GND & Enciende el FET con la polaridad correcta\\
\redS & \textbf{Zener 15\,V 1N4744A entre G y S} (banda/cátodo $\rightarrow$ S) & \textbf{DzG}: limita V$_{GS}$ a 15\,V\\
\redG & Fuente 24\,V ($-$) $\rightarrow$ GND común & \\
\bottomrule
\end{tabularx}}
\textbf{Prueba:} con la fuente al derecho, mide 24\,V en «24\,V protegido»; inviértela a
propósito (sin nada más conectado) y debe medir $\approx$0. Ponle \textbf{disipador} a Q10
(TO-220, clip chico) — barato y va atornillado de todos modos.
\diagramabloque{5}{\blkVent}
\bloque{6}{Sensor de temperatura y humedad I\textsuperscript{2}C — AHT10}
\queprueba{el log reporta temperatura + humedad del aire; al calentar el sensor, el ventilador sube.}
\compbloque{AHT10 (§\ref{sec:aht10}) · R 4.7\,k $\times$2 (§\ref{sec:resistencias})}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}}
\toprule
\theadconex
\midrule
\redT & AHT10 VCC $\rightarrow$ 3V3 & \textbf{1.8--3.6\,V — NUNCA a 5\,V} (el breakout no trae regulador)\\
\redG & AHT10 GND $\rightarrow$ GND & \\
\redS & AHT10 SCL $\rightarrow$ PB6 & I\textsuperscript{2}C1 SCL\\
\redT & SCL $\rightarrow$ R 4.7\,k$\Omega$ $\rightarrow$ 3V3 & Pull-up I\textsuperscript{2}C (muchos breakouts ya lo traen)\\
\redS & AHT10 SDA $\rightarrow$ PB7 & I\textsuperscript{2}C1 SDA\\
\redT & SDA $\rightarrow$ R 4.7\,k$\Omega$ $\rightarrow$ 3V3 & Pull-up I\textsuperscript{2}C\\
\redN & Dirección: AHT10 = \textbf{0x38 (fija)} & Firmware: 0x44 $\rightarrow$ 0x38\\
\redN & \textbf{SOLO el AHT10 en el bus} (restricción Aosong) & SHT40/TMP102 quedan para el PCB; no agregues otro dispositivo I\textsuperscript{2}C\\
\bottomrule
\end{tabularx}}
\noindent{\small\textit{El AHT10 sustituye al SHT40 en el proto (sin stock, entrega larga) y mide
\textbf{temperatura + humedad del aire} del gabinete. Con el LM35 $\rightarrow$ PA7 y el
NTC $\rightarrow$ PB1 (Bloque~11) forman la \textbf{triple ruta de temperatura}; la humedad
la da solo el AHT10.}}
\diagramabloque{6}{\blkTemp}
\bloque{7}{Reset y gauge de batería}
\queprueba{el botón reinicia; los 4 LEDs quedan listos para el firmware. Botones y LEDs \textbf{en mano} — van todos en el protoboard.}
\compbloque{botón de 4 patitas — truco de la diagonal (§\ref{sec:botones}) · LEDs $\times$4 y
R 330\,$\Omega$ (§\ref{sec:diodos}, §\ref{sec:resistencias})}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}}
\toprule
\theadconex
\midrule
\redS & NRST $\rightarrow$ push-button $\rightarrow$ GND & Reset por hardware\\
\redS & PB12 / PB13 / PB14 / PB15 $\rightarrow$ R 330\,$\Omega$ c/u $\rightarrow$ LED $\rightarrow$ GND ($\times$4) & Gauge de batería; \textbf{APAGADOS} hasta firmware\\
\bottomrule
\end{tabularx}}
\diagramabloque{7}{\blkResetGauge}
\bloque{8}{Conexión del stack RTK (modo por defecto)}
\queprueba{el watchdog observa; solo 5 cables al stack.}
\compbloque{simpleRTK2B Pro y 4G NTRIP Master (§\ref{sec:stackfisico}) — en este modo el 4G
va \textbf{dentro del socket XBee del Pro}: aquí NO se necesita el breakout ni ningún adaptador}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}}
\toprule
\theadconex
\midrule
\redV & SAL (5\,V conmutado, Bloque 3) $\rightarrow$ Pro · pin \texttt{5V} & Alimenta el stack RTK\\
\redG & GND del sistema $\rightarrow$ Pro · pin \texttt{GND} & \\
\redT & Blackpill 3V3 $\rightarrow$ Pro · pin \texttt{IOREF} & Fija el nivel (3.3\,V) de los pines
\texttt{TX1/RX1/TX2/RX2} — \textbf{sin este cable los UART del Pro no responden} (fila faltante en v2.2)\\
\redS & PA2 (USART2 TX) $\rightarrow$ Pro · pin \texttt{RX1} (F9P UART1 RX) & NMEA · cruce TX$\rightarrow$RX\\
\redS & PA3 (USART2 RX) $\rightarrow$ Pro · pin \texttt{TX1} (F9P UART1 TX) & NMEA · cruce RX$\leftarrow$TX\\
\redN & 4G NTRIP Master (XBee) $\rightarrow$ socket XBee del Pro · switch en \texttt{UART2} & 3.3\,V + datos se los da el socket (\textbf{no} al Blackpill)\\
\redN & Antena GNSS (SMA) $\rightarrow$ F9P & \\
\redN & 2$\times$ antenas LTE $\rightarrow$ 4G NTRIP Master & Conéctalas \textbf{antes} de energizar\\
\redN & Relé \texttt{\$PHLG} (PA9/PA10) = DNP / apagado & Config por defecto (solo monitor)\\
\bottomrule
\end{tabularx}}
\diagramabloque{8}{\blkStack}
\bloque{9}{Modo B — Diagnóstico por NTRIP (relevo, opcional)}
\queprueba{inyecta \texttt{\$PHLG} al servidor por 4G. Requiere el puente XBee de abajo.}
\compbloque{4G NTRIP Master en breakout XBee (§\ref{sec:stackfisico}) · segunda LM2596 o
MP1584 «MODEM 3.3\,V» (§\ref{sec:lm2596}) · R 22\,k y 1\,k (§\ref{sec:resistencias}) ·
C 100\,$\mu$F$+$100\,nF (§\ref{sec:diodos}) · breakout USB-C (config) · botón $+$ LED del módem}
\subsubsection*{9a · El problema del paso (pitch): el 4G NO entra en la protoboard}
Las patitas del 4G NTRIP Master son formato \textbf{XBee: paso de 2.0\,mm} (de centro a
centro de patita), y la protoboard es de \textbf{2.54\,mm}. Por eso el módulo no encaja: a
la cuarta patita ya perdió medio hoyo. Comprobación rápida con regla: 10 patitas del XBee
ocupan \textbf{18\,mm}; 10 hoyos de la protoboard ocupan \textbf{22.9\,mm}. (Si mides otra
cosa, vuelve a medir de \emph{centro a centro} — el estándar XBee es 2.0\,mm, no 1.27\,mm.)
\textbf{Nunca fuerces el módulo ni sueldes cables directo a sus patitas}: es la pieza más
cara del banco.
\hwtab{%
\begin{tabularx}{\textwidth}{@{}L{0.7cm} L{5.2cm} X L{2.6cm}@{}}
\toprule
\rowcolor{HelgenIndigo}\textcolor{white}{\textbf{Op.}} & \textcolor{white}{\textbf{Solución}} &
\textcolor{white}{\textbf{Notas}} & \textcolor{white}{\textbf{Costo / entrega}}\\
\midrule
\textbf{A} $\star$ & Breakout XBee (SparkFun BOB-08276 o genérico) $+$ 2 headers hembra de
2.0\,mm (10 pos.) $+$ pines macho 2.54\,mm & \textbf{La recomendada.} Requiere soldar los dos
headers y los pines (ver 9b). SANDOROBOTICS (CDMX): BOB-08276 $\approx$MX\$30 $+$ 2$\times$
PRT-08272 $\approx$MX\$35 c/u & $\approx$MX\$100 · 1--2 días\\
\textbf{B} & «Adaptador XBee» genérico ya armado (Amazon MX / MercadoLibre) & Busca
«adaptador XBee 2.54»; verifica en las fotos que traiga las dos filas de pines DIP hacia
abajo. Algunos traen regulador y LEDs (no estorban, pero alimenta VCC igual con 3.3\,V) &
$\approx$MX\$80--250 · 1--3 días\\
\textbf{C} & Shield XBee formato Arduino (p.\,ej.\ HR0440) $+$ cables Dupont H-H & No entra a la
protoboard, pero expone las señales en headers 2.54. Funciona como base fija junto a la
protoboard & $\approx$MX\$50--150 · 1--2 días\\
\textbf{D} & Jumpers hembra-hembra de 2.0\,mm (AliExpress) directo a las patitas & Solo como
último recurso: sin soldar, pero frágil y fácil de conectar corrido. Entrega lenta &
$\approx$MX\$60--120 · 2--4 semanas\\
\bottomrule
\end{tabularx}}
\subsubsection*{9b · Armado del puente (opción A) — se suelda UNA vez}
\begin{enumerate}[itemsep=2pt]
\item Suelda los \textbf{2 headers hembra de 2.0\,mm} (10 posiciones c/u) en las dos filas
\emph{interiores} del breakout, por el lado de arriba (donde está la serigrafía del
contorno XBee). Fíjate en la marca de \textbf{pin 1} (ver dibujo en §\ref{sec:stackfisico}).
\item Suelda \textbf{pines macho de 2.54\,mm} en las dos filas \emph{exteriores}, apuntando
hacia abajo — así el breakout se enchufa a la protoboard como cualquier módulo.
\item Revisa cada punto de soldadura con lupa/luz: brillante y cónico, sin puentes entre
pads vecinos. Con el multímetro en continuidad: cada socket 2.0\,mm debe pitar con su
pin 2.54 de al lado, y \textbf{no} con el vecino.
\item Enchufa el 4G NTRIP Master en los sockets respetando la orientación del contorno
(solo entra bien de una forma si sigues la marca de pin 1).
\item \textbf{Alimentación — la regla dura: el pin 1 (VCC) del XBee es de 3.3\,V. NUNCA le
conectes 5\,V.} Prepara la segunda LM2596/MP1584, ajústala \textbf{en vacío} a
\textbf{3.3\,V} (§\ref{sec:lm2596}), márcala «MODEM 3.3\,V», y ponle a la salida un
capacitor de 100\,$\mu$F $+$ 100\,nF lo más cerca posible del pin VCC (el módem pide
picos de $\sim$1--1.5\,A al transmitir; sin ese capacitor se reinicia solo).
\item La entrada de esa buck viene de \textbf{SAL} (el 5\,V conmutado del Bloque~3), no del
riel fijo: así, cuando el watchdog reinicia el stack, \textbf{también reinicia el
módem} — igual que en el PCB de producción (riel 3V3\_MODEM).
\end{enumerate}
\subsubsection*{9c · Conexiones del Modo B}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}}
\toprule
\theadconex
\midrule
\redV & SAL (Bloque 3) $\rightarrow$ Pro · pin \texttt{5V} (y GND común) & El F9P sí es de 5\,V\\
\redV & SAL $\rightarrow$ LM2596 «MODEM» IN$+$ (ajustada a 3.3\,V) & IN$-$/OUT$-$ al GND común\\
\redT & LM2596 «MODEM» OUT$+$ $\rightarrow$ XBee \textbf{pin 1 (VCC)} & \textbf{3.3\,V — nunca 5\,V} ·
C 100\,$\mu$F$+$100\,nF junto al pin\\
\redG & XBee \textbf{pin 10 (GND)} $\rightarrow$ GND & GND común con todo\\
\redT & Blackpill 3V3 $\rightarrow$ Pro · pin \texttt{IOREF} & Nivel 3.3\,V de los UART del Pro\\
\redN & switch XBee del Pro $\rightarrow$ \texttt{UART1} & Libera UART2 para el relevo (el socket queda vacío)\\
\redS & PA2 $\rightarrow$ Pro · \texttt{RX1} \quad / \quad PA3 $\rightarrow$ Pro · \texttt{TX1} & Monitor de fix (NMEA)\\
\redS & Pro · \texttt{TX2} (F9P UART2) $\rightarrow$ PA10 (USART1 RX) & Relevo: la subida entra al MCU\\
\redS & PA9 (USART1 TX) $\rightarrow$ XBee \textbf{pin 3 (DIN)} & El MCU releva + inyecta \texttt{\$PHLG}\\
\redS & XBee \textbf{pin 2 (DOUT)} $\rightarrow$ Pro · \texttt{RX2} & RTCM3 \textbf{DIRECTO} (no pasa por el MCU) $\rightarrow$ correcciones intactas\\
\redT & PA10 $\rightarrow$ R 22\,k$\Omega$ $\rightarrow$ 3V3 & DFU-safe (idle high)\\
\redT & XBee \textbf{pin 14 (VREF)} $\rightarrow$ VCC del módem (3.3\,V) & \textbf{OBLIGATORIO} — referencia lógica; sin él los datos no valen\\
\redG & XBee \textbf{pin 20 (ON/OFF)} $\rightarrow$ GND & \textbf{OBLIGATORIO} — a GND $=$ siempre encendido; al aire puede NO encender\\
\redG & XBee \textbf{pines 4, 11 y 15 (GND)} $\rightarrow$ GND & Con el pin 10 quedan los \textbf{4 GND} conectados\\
\redS & XBee \textbf{pin 5 (RESET)} $\rightarrow$ botón $\rightarrow$ GND & Opcional (config); \textbf{al aire $=$ encendido}\\
\redS & XBee \textbf{pin 13 (LED)} $\rightarrow$ R 1\,k $\rightarrow$ LED $\rightarrow$ GND & Opcional; tenue — el pin entrega 1.8\,V\\
\redV & Breakout USB-C \textbf{VBUS} $\rightarrow$ XBee \textbf{pin 6 (V\_USB)} & El 5\,V del cable USB habilita el puerto USB del módem\\
\redS & Breakout USB-C \textbf{D$+$ / D$-$} $\rightarrow$ XBee \textbf{pines 7 / 8} & Configurar el módem desde la PC; par corto y parejo\\
\redG & Breakout USB-C \textbf{GND} $\rightarrow$ GND común & \\
\redN & 2$\times$ antenas LTE (u.FL) $\rightarrow$ 4G & \textbf{Antes} de energizar — sin antena el transmisor sufre\\
\redN & 4G NTRIP Master $\rightarrow$ servidor (4G/NTRIP) & \texttt{\$PHLG} llega \textit{en banda} al backend\\
\bottomrule
\end{tabularx}}
\begin{helgennotice}[Fail-safe en el PCB v3: bypass UART2 normalmente cerrado]
En la tarjeta de producción, la bajada RTCM3 (4G DOUT $\rightarrow$ F9P RX2) pasa por un
\textbf{bypass normalmente cerrado}: si el MCU está \textbf{muerto, ausente o colgado}, el
bypass mantiene la ruta conectada y las correcciones \textbf{nunca se cortan} — el MCU solo
se interpone cuando está sano. En el protoboard este fail-safe \textbf{no existe}: si retiras
o cuelgas el Blackpill en Modo~B, regresa el 4G al socket XBee (modo por defecto, Bloque~8)
para no perder RTCM3. (Invariante: las correcciones viajan por el módem 4G; ningún estado del
MCU debe interrumpirlas.)
\end{helgennotice}
\diagramabloque{9}{\blkStackB}
\bloque{10}{Respaldo de batería (proto): TP4056 + MT3608 + corte de carga (PA8) + apagador}
\queprueba{reproduce carga / respaldo; PA8 corta la carga; el apagador mata todo. El PCB usa el LTC4040.}
\compbloque{TP4056 (§\ref{sec:tp4056}) · MT3608 (§\ref{sec:mt3608}) · 2N3904 e IRF9540N
(§\ref{sec:transistores}) · 1N5819 $\times$2 (§\ref{sec:diodos}) · apagador (§\ref{sec:botones}) ·
R 1\,k y 10\,k (§\ref{sec:resistencias})}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}}
\toprule
\theadconex
\midrule
\redV & 5\,V vehículo (SD-15B-05) $\rightarrow$ \textbf{IRF9540 (CHRG\_RUN)} $\rightarrow$ TP4056 IN+ & Camino de carga — \textbf{conmutado por PA8} (el módulo no expone TEMP)\\
\redG & TP4056 IN$-$ $\rightarrow$ GND & \\
\redN & TP4056 BAT+ $\rightarrow$ 18650+ (nodo compartido) & \\
\redN & 18650+ $\rightarrow$ MT3608 IN+ & Nodo compartido (carga + boost)\\
\redG & 18650$-$ $\rightarrow$ GND & \\
\redG & MT3608 IN$-$ / OUT$-$ $\rightarrow$ GND & \\
\redV & MT3608 OUT+ (eleva 3.6$\rightarrow$5\,V) $\rightarrow$ 1N5819 $\rightarrow$ \textbf{nodo SYS} & Respaldo (OR)\\
\redV & 5\,V vehículo $\rightarrow$ 1N5819 $\rightarrow$ \textbf{nodo SYS} & Primario (OR) — el vehículo tiene prioridad\\
\redV & nodo SYS $\rightarrow$ \textbf{apagador de corte} (SPST) $\rightarrow$ riel MAIN5V & \textbf{Corte general}: mata vehículo \textbf{y} batería (= Bloque E del PCB, P11)\\
\redS & PA8 (CHRG\_RUN) $\rightarrow$ R 1\,k$\Omega$ $\rightarrow$ base 2N3904 (B) & Corte de carga por temperatura\\
\redG & 2N3904 emisor (E) $\rightarrow$ GND & \\
\redS & 2N3904 colector (C) $\rightarrow$ compuerta IRF9540 (G) & Mismo patrón que el Bloque~3\\
\redV & compuerta IRF9540 (G) $\rightarrow$ R 10\,k$\Omega$ $\rightarrow$ 5\,V vehículo & Pull-up $\rightarrow$ \textbf{sin carga con MCU ausente}\\
\redV & IRF9540 source (S) $\rightarrow$ 5\,V vehículo · drain (D) $\rightarrow$ TP4056 IN+ & PA8 \textbf{ALTO = carga permitida}\\
\redN & NTC 10\,k del kit: \textbf{SIN USAR en proto} & El módulo TP4056 no expone TEMP; en el PCB va al pin NTC del LTC4040\\
\redA & 18650+ $\rightarrow$ (Bloque 4) $\rightarrow$ PA0 (BAT\_SENSE) & Sensado de voltaje de batería\\
\redN & MT3608: ajustar \textbf{apenas} $<$ 5\,V del vehículo & Prioridad al vehículo; el PCB usa el LTC4040\\
\bottomrule
\end{tabularx}}
\begin{helgennotice}[Corte de carga en el proto: lo hace el MCU (PA8), porque el TP4056 del kit no tiene NTC]
En el PCB, el termistor de la celda va al pin NTC del \textbf{LTC4040} y el cargador
califica la carga por temperatura en hardware. El módulo TP4056 del kit \textbf{no expone
el pin TEMP}, así que en el proto esa protección la hace el \textbf{firmware}: lee la
\textbf{triple ruta de temperatura} (AHT10 · LM35 $\rightarrow$ PA7 · NTC $\rightarrow$ PB1)
y con \textbf{PA8 (CHRG\_RUN)} corta el 5\,V de entrada del TP4056 vía el IRF9540. Con el
MCU ausente o en reset, el pull-up deja el FET \textbf{apagado = sin carga} (estado seguro:
el proto no tiene guardia térmica de hardware). \textbf{Ojo firmware:} la polaridad es
\textbf{inversa} a la del PCB — proto CHRG\_RUN ALTO = carga; PCB CHRG\_EN ALTO = corta
(LTC4040 con pull-down, carga habilitada sin MCU porque su NTC sí vigila). Usa un flag de
compilación.
\end{helgennotice}
\noindent\textbf{Pack:} 1S4P $\sim$\textbf{12\,Ah} — \textit{nunca} 40\,Ah (ese dato fue un
error, corregido el 2026-06-30). Con 12\,Ah, la corriente de carga del LTC4040 se dimensiona
con R\textsubscript{PROG} $\approx$ C/5 $\le$ 2.5\,A.
\diagramabloque{10}{\blkBatt}
\bloque{11}{Temperatura analógica: NTC 10\,k $\rightarrow$ PB1 + LM35 $\rightarrow$ PA7}
\queprueba{dos canales analógicos independientes; con el AHT10 (Bloque~6) completan la triple ruta.}
\compbloque{NTC 10\,k (§\ref{sec:botones}) · LM35 — ¡ojo con la orientación! (§\ref{sec:transistores}) ·
R 10\,k 1\,\% (§\ref{sec:resistencias}) · C 100\,nF (§\ref{sec:diodos})}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}}
\toprule
\theadconex
\midrule
\redT & 3V3 $\rightarrow$ R 10\,k$\Omega$ (1\,\%) $\rightarrow$ nodo & Divisor fijo (superior)\\
\redA & nodo $\rightarrow$ PB1 (ADC1\_IN9) & $\approx$1.65\,V @ 25\,\textdegree C; baja al calentar\\
\redN & nodo $\rightarrow$ NTC 10\,k$\Omega$ $\rightarrow$ GND & Termistor · Beta $\approx$3950\\
\redG & nodo $\rightarrow$ C 100\,nF $\rightarrow$ GND & Filtro\\
\redV & LM35 VCC $\rightarrow$ MAIN5V & \textbf{Necesita $\ge$4\,V $\rightarrow$ al 5\,V, NO al 3V3}\\
\redA & LM35 OUT $\rightarrow$ PA7 (ADC1\_IN7) & 10\,mV/\textdegree C; $\le$1.5\,V a 150\,\textdegree C $\rightarrow$ seguro para el ADC de 3.3\,V\\
\redG & LM35 GND $\rightarrow$ GND & \\
\redG & LM35 VCC $\rightarrow$ C 100\,nF $\rightarrow$ GND & Desacople junto al sensor\\
\redN & Colocación: \textbf{NTC = contacto} en el punto caliente (celda/módem) · \textbf{LM35 = aire/tarjeta} (junto a TP4056/MT3608) · AHT10 = aire + RH & Firmware: Beta/Steinhart (PB1), 10\,mV/\textdegree C (PA7); cualquiera puede disparar CHRG\_RUN\\
\bottomrule
\end{tabularx}}
\noindent{\small\textit{Este NTC es \textbf{distinto} del NTC del kit para el cargador
(Bloque~10, sin usar en proto): este sí va al MCU (PB1) y mide el punto caliente por
contacto. \textbf{Triple temperatura} = AHT10 (I\textsuperscript{2}C) + LM35 (ADC) + NTC
(ADC) — tres tecnologías y tres rutas eléctricas independientes; la \textbf{humedad} la da
solo el AHT10.}}
\diagramabloque{11}{\blkTempA}
\section{Patitas de los componentes (resumen rápido)}
Tabla-resumen para consulta veloz; \textbf{los dibujos} de cada uno están en la
sección~\ref{sec:identifica}. Míralos de frente, patitas hacia abajo.
\hwtab{%
\begin{tabularx}{\textwidth}{@{}L{4.6cm} X@{}}
\toprule
\rowcolor{HelgenIndigo}\textcolor{white}{\textbf{Componente}} & \textcolor{white}{\textbf{Orientación / pines}}\\
\midrule
2N3904 (TO-92) & Cara plana hacia ti, izq $\rightarrow$ der: \textbf{E -- B -- C}\\
IRF9540 (TO-220, canal P) & Metal atrás, izq $\rightarrow$ der: \textbf{G -- D -- S}. Metal = Drain\\
IRLZ44N (TO-220, lógico) & Metal atrás, izq $\rightarrow$ der: \textbf{G -- D -- S}. Debe ser «lógico» (\textbf{NO} IRF540/IRFZ44)\\
BAT54 · 1N5819 (diodos) & La banda impresa = \textbf{cátodo (K)}\\
NTC 10\,k (termistor) & Sin polaridad. Divisor con R 10\,k (1\,\%) a 3V3\\
LM35 (TO-92) & Cara plana hacia ti, izq $\rightarrow$ der: \textbf{+V\textsubscript{S} -- OUT -- GND}. \textbf{Al revés se quema}\\
AHT10 (tarjetita I\textsuperscript{2}C) & 4 pines rotulados: VCC (\textbf{a 3V3}) · GND · SCL · SDA\\
Capacitor electrolítico & \textbf{CON polaridad}: la franja/pata corta = negativo ($-$) $\rightarrow$ GND\\
\bottomrule
\end{tabularx}}
\section{Orden de armado (sigue este orden)}
\label{sec:orden}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}c L{3.2cm} X@{}}
\toprule
\rowcolor{HelgenIndigo}\textcolor{white}{\textbf{\#}} & \textcolor{white}{\textbf{Paso}} & \textcolor{white}{\textbf{Acción}}\\
\midrule
1 & Solo USB & Compila y flashea el firmware v2.3 (Arduino/STM32duino, F411CE, DFU con BOOT0). Serial 115200: confirma \texttt{BOOT}/\texttt{COLS}/\texttt{TLM} y un \texttt{\$PHLG} cada 30\,s. Si falla, arregla el firmware antes de seguir.\\
2 & LED de estado & Bloque 2. Verás parpadeos.\\
3 & Interruptor de carga & Bloque 3. Confirma: \textbf{APAGADO al reset}, ON cuando PA1 activa.\\
4 & Sensado & Bloque 4. Divisores PA0/PA4; ignición por DFR1015 (12/24\,V) o el apagador a 3V3.\\
5 & Ventilador & Bloque 5. \textbf{Primero} arma \textbf{5b} (Q10 $+$ Zener 15\,V en la línea de 24\,V), ajusta el LM2596 a 5.0\,V, y al final conecta el ventilador.\\
6 & Temperatura / humedad & Bloques 6 y 11: AHT10 (0x38, \textbf{solo} en el bus) + LM35 $\rightarrow$ PA7 + NTC $\rightarrow$ PB1. Verifica las tres lecturas en el log.\\
7 & Respaldo de batería & Bloque 10. TP4056 + MT3608 (ajusta el MT3608 apenas $<$ 5\,V del vehículo) + corte de carga PA8 (CHRG\_RUN) + \textbf{apagador} SYS $\rightarrow$ MAIN5V. Prueba: PA8 en bajo = el LED CHRG del TP4056 se apaga; el apagador mata todo.\\
8 & Stack RTK & Bloque 8. Solo 4 cables (SAL, GND, PA2, PA3); el 4G va en el socket XBee del Pro.\\
9 & (Opcional) Modo B & Bloque 9. Relevo por breakout XBee — solo si vas a probar el
diagnóstico por NTRIP. \textbf{Prepara antes el puente 2.0$\rightarrow$2.54\,mm} (compra y
soldadura de la sección 9a/9b), la buck «MODEM 3.3\,V», y \textbf{no olvides los pines
obligatorios} VREF(14)$\rightarrow$VCC · ON/OFF(20)$\rightarrow$GND · GND$\times$4 $+$ el USB de config (9c).\\
\bottomrule
\end{tabularx}}
\section{Avisos importantes}
\begin{itemize}
\item El IRLZ44N debe ser «lógico» (\textbf{no} IRF540/IRFZ44). Si usaron TIP120, avísale a Leo.
\item \textbf{Nunca 5\,V directo a PA0/PA4/PA5.} PA0/PA4 por divisor $\div$2; PA5 lógico
$\le$ 3.3\,V (\texttt{INPUT\_PULLDOWN}, clamp Schottky \textbf{1N5819} del kit — en el PCB es BAT54 —, \textbf{sin divisor}).
\item LM2596: ajústalo a \textbf{5.0\,V con el multímetro ANTES de conectar} (vienen aleatorios).
\item El ventilador va en el 5\,V del LM2596 (\textbf{separado}), no en la salida «stack» ni en el 5\,V principal.
\item MT3608: ajústalo \textbf{apenas} $<$ 5\,V del vehículo (para que el vehículo tenga prioridad).
\item Ventilador de 2 hilos $\rightarrow$ sin tacómetro (PB10 sin usar).
\item El DFR1015 acepta 12 y 24\,V; su GND (IN$-$/OUT$-$) va al GND del sistema.
\item El 4G va en el \textbf{socket XBee del Pro} (no al Blackpill), salvo el Modo B.
En el PCB v3, el bypass UART2 \textbf{normalmente cerrado} garantiza que un MCU
muerto/ausente nunca corte el RTCM3 (ver Bloque~9).
\item \textbf{Fuera del socket, el 4G se alimenta con 3.3\,V — NUNCA 5\,V} (pin 1 del
XBee), desde la buck «MODEM 3.3\,V» con su capacitor de 100\,$\mu$F al lado, y sus
patitas son de paso \textbf{2.0\,mm}: usa el puente de la sección 9a/9b, no lo
fuerces en la protoboard. Antenas LTE conectadas \textbf{antes} de energizar.
\item \textbf{USB del Blackpill y riel 5\,V nunca al mismo tiempo}: el pin \texttt{5V} está
unido directo al USB. Para flashear, desconecta el riel; para operar, desconecta el USB.
\item El pin \texttt{IOREF} del Pro debe ir al 3V3 del Blackpill en los Bloques 8 y 9 —
sin él, los pines \texttt{TX1/RX1/TX2/RX2} del Pro no responden.
\item \textbf{AHT10 solo a 3V3} (1.8--3.6\,V, se quema a 5\,V) y \textbf{solo él} en el bus
I\textsuperscript{2}C (restricción Aosong); dirección \textbf{0x38 fija}.
\textbf{LM35 al revés:} necesita $\ge$4\,V $\rightarrow$ va al \textbf{5\,V}, nunca al 3V3.
\item El TP4056 del kit \textbf{no expone el pin TEMP} $\rightarrow$ el corte de carga lo hace
\textbf{PA8 (CHRG\_RUN)} sobre el IN+ (Bloque~10). \textbf{Polaridad inversa al PCB}:
proto ALTO = carga; PCB (CHRG\_EN) ALTO = corta — flag en firmware. El NTC del kit
queda sin usar en proto (en el PCB va al LTC4040).
\item \textbf{Disipadores TO-220:} obligatorio en \textbf{Q10} y recomendado en el
\textbf{IRF9540N del interruptor de carga}; opcional en el IRLZ44N y el IRF9540N de
CHRG\_RUN. \textbf{La tab metálica $=$ DRAIN}: dos transistores \textbf{nunca}
comparten disipador sin mica/aislante.
\item \textbf{Placa perforada 10$\times$10\,cm — plano sugerido} (igual que el Diagrama
Único): \textbf{potencia a la izquierda} (Q10, bucks, TP4056/MT3608, pila),
\textbf{Blackpill al centro} sobre headers hembra, \textbf{stack RTK a la derecha}
(Pro, XBee/breakout, USB-C al borde). Módulos SIEMPRE sobre headers hembra — nunca
soldados directo. Deja pasillo de GND alrededor y cablea con 22\,AWG sólido.
\item Capacitores electrolíticos (10\,$\mu$F / 100\,$\mu$F) \textbf{con polaridad}: negativo
a GND. Los 100\,nF cerámicos no tienen polaridad.
\item 18650: respeta la polaridad; pack 1S4P $\sim$\textbf{12\,Ah} (nunca 40\,Ah).
\textbf{Bench-test} el firmware antes de flashear en campo.
\item Cobertura de partes: \textbf{Sección 1 + 3} de la lista de compras = suficiente para
el core; la Sección 2 (TP4056/MT3608) solo para el respaldo de batería.
\end{itemize}
\section{Historial del documento}
\hwtab{%
\begin{tabularx}{\textwidth}{@{}l l X@{}}
\toprule
\rowcolor{HelgenIndigo}\textcolor{white}{\textbf{Versión}} & \textcolor{white}{\textbf{Fecha}} & \textcolor{white}{\textbf{Cambios}}\\
\midrule
v2 & 2026-07-02 & Guía original (bloques 1--11), publicada solo como PDF (fuente perdida).\\
v2.1 & 2026-07-02 & Fuente LaTeX reconstruida y mantenida en el repo
(\texttt{03-Architecture-Hardware/}\allowbreak\texttt{Guia-Conexion-Protoboard/}). Contenido realineado al XLSX
autoritativo: mapa de pines completado (\textbf{PA8}, \textbf{PC13}), Bloque 9 con las filas
faltantes (alimentación, monitor PA2/PA3, ruta al servidor), fila LTC4040 en «Fuentes y
convertidores». Nuevo: tabla «Estado y cambios», aviso del \textbf{bypass UART2 normalmente
cerrado} del PCB (Bloque 9), aclaración \textbf{NTC del cargador vs TMP102 vs NTC$\rightarrow$PB1},
pack 1S4P $\sim$12\,Ah (nunca 40\,Ah), leyenda con colores de los diagramas CircuiTikZ,
figura del Bloque 3 y referencias cruzadas.\\
v3.1 & 2026-07-20 & \textbf{Bloque 5b}: protección de polaridad 24\,V (Q10 $+$ DzG 15\,V
1N4744A) — por fin dibujada y explicada. \textbf{Bloque 9c}: pines \textbf{obligatorios} del
XBee según datasheet — VREF(14)$\rightarrow$VCC, ON/OFF(20)$\rightarrow$GND, GND 4·10·11·15 —
$+$ USB de configuración (V\_USB/D$\pm$ $\rightarrow$ breakout USB-C), botón RESET y LED.
Clamp de PA5 $=$ 1N5819 del kit (PCB: BAT54). Avisos: disipadores TO-220 (tab $=$ drain) y
plano sugerido para placa perforada 10$\times$10. Lista de compras reconstruida \textbf{desde
cero} (1 tarjeta, con disipadores y consumibles).\\
v3.0 & 2026-07-08 & \textbf{Catálogo visual de piezas} (sección~\ref{sec:identifica}): vista
física con patitas rotuladas de los módulos con CI (LM2596, MT3608, TP4056, AHT10, DFR1015),
pinout completo del Blackpill de frente (40 pines, usados en color), simpleRTK2B Pro con sus
rótulos \texttt{RX1/TX1/RX2/TX2/IOREF}, 4G NTRIP Master + breakout, transistores TO-92/TO-220,
diodos, LEDs, capacitores, código de colores de resistencias, protoboard por dentro y
checklist antes de energizar. Línea «Piezas de este bloque» en los 11 bloques. \textbf{Bloque
9 rehecho:} el 4G es paso \textbf{2.0\,mm} (no cabe en protoboard 2.54\,mm) $\rightarrow$
opciones de puente (breakout $+$ sockets $\approx$MX\$100), armado 9b, y alimentación del
módem \textbf{3.3\,V desde SAL} vía buck dedicada (espejo del riel 3V3\_MODEM del PCB) con
capacitor de ráfaga. Nuevo en tablas 8/9: fila \texttt{IOREF} $\rightarrow$ 3V3 (faltaba) y
números de pin XBee (1 VCC · 2 DOUT · 3 DIN · 10 GND). Aviso USB$+$riel 5\,V simultáneos.\\
v2.2 & 2026-07-03 & \textbf{Suite de sensores realineada a las partes en mano:} AHT10
(0x38, solo en el bus, a 3V3) sustituye al SHT40 en el Bloque 6 (SHT40/TMP102 quedan para
el PCB); \textbf{LM35 $\rightarrow$ PA7} nuevo en el Bloque 11 $\rightarrow$ \textbf{triple
temperatura} (AHT10 + LM35 + NTC$\rightarrow$PB1), humedad = solo AHT10. \textbf{Corte de
carga por PA8 (CHRG\_RUN)} sobre el IN+ del TP4056 (el módulo no expone TEMP; inversión de
polaridad vs PCB) y \textbf{apagador de corte general} nodo SYS $\rightarrow$ MAIN5V
(= Bloque E del PCB) en el Bloque 10. Reset/gauge dejan de ser opcionales; patitas del LM35,
AHT10 y electrolíticos; capacitores en mano (100\,nF / 10\,$\mu$F / 100\,$\mu$F).
\textbf{Diagramas CircuiTikZ incrustados} al final de cada uno de los 11 bloques.\\
\bottomrule
\end{tabularx}}
\vspace{6pt}
\noindent{\footnotesize Helgen Technologies · Proyecto Drogheda · Guía de conexión en
protoboard v3.1 (bloques 1--11) · Firmware v2.3 · Documento para el técnico de armado.
Datos de conexión: \texttt{Drogheda\_Conexiones-por-Bloque\_Proto\_v1.xlsx} · Diagramas:
\texttt{circuitikz-wiring/}.}