% cuerpo.tex — Guía de Conexión en Protoboard v2.2 (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) \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). \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 (v2.2). 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{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}} \section{Mapa de pines del Blackpill} Busca cada etiqueta impresa en la tarjeta. (Hoja \textit{Mapa de pines} del XLSX; incluye PA8 y PC13, que no aparecían en la guía v2.) \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)} 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}. \bloque{1}{Rieles de alimentación} \queprueba{arma los rieles 5\,V / GND / 3.3\,V que alimentan todo.} \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.} \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.} \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).} \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.} \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}} \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.} \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.} \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 4 cables al stack.} \hwtab{% \begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}} \toprule \theadconex \midrule \redV & SAL (5\,V conmutado, Bloque 3) $\rightarrow$ simpleRTK2B Pro · 5V & Alimenta el stack RTK\\ \redG & GND del sistema $\rightarrow$ simpleRTK2B Pro · GND & \\ \redS & PA2 (USART2 TX) $\rightarrow$ F9P UART1 RX & NMEA · cruce TX$\rightarrow$RX\\ \redS & PA3 (USART2 RX) $\rightarrow$ F9P UART1 TX & NMEA · cruce RX$\leftarrow$TX\\ \redN & 4G NTRIP Master (XBee) $\rightarrow$ socket XBee del Pro (UART2) & 5\,V + datos por el socket (\textbf{no} al Blackpill)\\ \redN & Antena GNSS (SMA) $\rightarrow$ F9P & \\ \redN & 2$\times$ antenas LTE $\rightarrow$ 4G NTRIP Master & \\ \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 (relé, opcional)} \queprueba{inyecta \texttt{\$PHLG} al servidor por 4G. Requiere breakout XBee.} \hwtab{% \begin{tabularx}{\textwidth}{@{}l X L{4.4cm}@{}} \toprule \theadconex \midrule \redV & SAL / GND (Bloque 3) $\rightarrow$ F9P · watchdog · 4G & IOREF = 3.3\,V (nivel de los UART del F9P)\\ \redN & switch XBee del Pro $\rightarrow$ UART1 & Libera UART2 para el relé\\ \redS & PA2 $\rightarrow$ F9P UART1 RX & Monitor de fix\\ \redS & PA3 $\rightarrow$ F9P UART1 TX & Monitor de fix\\ \redS & F9P TX2 (UART2) $\rightarrow$ PA10 (USART1 RX) & Relé: la subida entra al MCU\\ \redS & PA9 (USART1 TX) $\rightarrow$ 4G DIN & El MCU releva + inyecta \texttt{\$PHLG}\\ \redS & 4G DOUT $\rightarrow$ F9P RX2 (UART2) & RTCM3 \textbf{DIRECTO} (no pasa por el MCU) $\rightarrow$ correcciones intactas\\ \redT & PA10 $\rightarrow$ R 22\,k$\Omega$ $\rightarrow$ 3V3 & DFU-safe (idle high)\\ \redN & 4G NTRIP Master $\rightarrow$ breakout XBee (SparkFun BOB-08276), fuera del socket & Para interponer el MCU\\ \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.} \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.} \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} 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} ajusta el LM2596 a 5.0\,V, luego 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. Relé por breakout XBee — solo si vas a probar el diagnóstico por NTRIP.\\ \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 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{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 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.\\ 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 v2.2 (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/}.}