
Zigbee led
agendek78/zigbee_led_driver
Zigbee 3.0 4-channel LED strip driver (MGM210L)

La Carrier Board STM32G474 es una plataforma de desarrollo modular de alto rendimiento basada en el microcontrolador ARM Cortex-M4F STM32G474RET6 (LQFP-64, hasta 170 MHz con FPU y DSP).
Carrier board is an open-source printed circuit board by AntonioTRT, from the AntonioTRT/TRT_HW repository on GitHub. It is a 4-layer board of 50 × 50 mm with 54 parts on 112 nets.
It is built around the AMS1117-3.3, 1N5819HW and AO3400A. Its parts include 16 resistors, 13 capacitors, 7 connectors, 3 ICs and 3 diodes. It belongs with the computers and single-board computers boards and the STM32 boards of this library.
La Carrier Board STM32G474 es una plataforma de desarrollo modular de alto rendimiento basada en el microcontrolador ARM Cortex-M4F STM32G474RET6 (LQFP-64, hasta 170 MHz con FPU y DSP). Diseñada específicamente para fabricación y ensamblaje SMT en JLCPCB, utiliza encapsulados estándar fáciles de inspeccionar y soldar (0805 pasivos, SOT-23, SOD-123 y LQFP-64).
La tarjeta se interconecta con placas hijas (daughterboards) a través del conector Board-to-Board principal J2 (2x8 pines, numeración estándar 1 a 16), integrando buses de comunicación (SPI1, I2C1 con gestión de energía), control de potencia (driver de motor PWM con MOSFET AO3400A) e identificación de hardware digital (HWID de 4 bits).
CC1 y CC2 para compatibilidad completa con fuentes y cables USB-C a USB-C (Power Delivery Sink 5V/3A máx).VDD/VSS adyacente a los pines, complementados por un capacitor de carga de 10 µF.VDDA y VREF+, aislando el dominio analógico de ruidos digitales.VBAT unificado directamente al riel de +3.3V.OSC_IN (PF0) y OSC_OUT (PF1).SWDIO en PA13SWCLK en PA14SWO en PB3 (Asynchronous Trace)NRST para hardware reset por depurador+3.3V (VTref) y GNDPB9 (SDA) y PB8 (SCL).I2C_PU_EN).PA5 (SCK), PA6 (MISO), PA7 (MOSI), PB6 (CS).TIM3_CH1).+5V, Pin 2 = Drain del MOSFET.LED_PWR (Verde): Polarizado a +3.3V mediante resistencia de 1 kΩ ($I_F \approx 1.3\text{ mA}$).LED_USER (Azul): Conectado al pin PA5 (SPI_SCK) mediante resistencia de 470 Ω (emula el LED_BUILTIN de Arduino Pin 13).El conector principal J2 utiliza una huella estándar de doble hilera (paso 2.00 mm / 2.54 mm) con numeración numérica consecutiva (Pines 1 al 16), organizada en fila impar (señales SPI / HWID) y fila par (alimentación / I2C / GPIOs):
| Pin Físico J2 | Fila | Etiqueta de Red | Pin STM32G474 | Funciones Nativas STM32 | Equivalente Arduino | Descripción |
|---|---|---|---|---|---|---|
| Pin 1 | Impar | SPI_CS / PWM | PB6 | TIM4_CH1, TIM16_CH1N, USART1_TX | D10 / PWM | Chip Select SPI o PWM auxiliar |
| Pin 2 | Par | GND | — | Riel de Masa común (0V) | GND | Masa de alimentación |
| Pin 3 | Impar | SPI_MOSI / PWM | PA7 | SPI1_MOSI, TIM3_CH2, TIM1_CH1N | D11 / PWM | Datos MOSI o salida PWM |
| Pin 4 | Par | +5V | — | Riel de entrada USB VBUS | 5V | Alimentación de potencia principal |
| Pin 5 | Impar | SPI_MISO / PWM | PA6 | SPI1_MISO, TIM3_CH1, TIM16_CH1, ADC2_IN3 | D12 / PWM | Datos MISO o entrada ADC / PWM |
| Pin 6 | Par | TRT_GPIO_1 | PA1 | TIM2_CH2, USART2_RTS, ADC1_IN2 | D2 / A4 | GPIO / Entrada Analógica / Timer |
| Pin 7 | Impar | SPI_SCK / PWM | PA5 | SPI1_SCK, TIM2_CH1, ADC2_IN2 | D13 / SCK | Reloj SPI / LED Builtin / PWM |
| Pin 8 | Par | +3.3V | — | Salida del LDO AMS1117-3.3 | 3.3V | Lógica y alimentación de sensores |
| Pin 9 | Impar | HWID_0 | PC0 | ADC1_IN6, ADC2_IN6, LPTIM1_IN1 | A0 | Identificación Hardware Bit 0 (ADC/Digital) |
| Pin 10 | Par | TRT_GPIO_2 | PA4 | DAC1_OUT1, SPI1_NSS, ADC2_IN1 | A5 / DAC | GPIO / Salida Analógica Pura DAC |
| Pin 11 | Impar | HWID_1 | PC1 | ADC1_IN7, ADC2_IN7, LPTIM1_OUT | A1 | Identificación Hardware Bit 1 (ADC/Digital) |
| Pin 12 | Par | SDA | PB9 | I2C1_SDA, TIM4_CH4, FDCAN1_TX | D14 / SDA | Datos I2C1 (Pull-up conmutable vía PC15) |
| Pin 13 | Impar | HWID_2 | PC2 | ADC1_IN8, ADC2_IN8, LPTIM1_IN2 | A2 | Identificación Hardware Bit 2 (ADC/Digital) |
| Pin 14 | Par | SCL | PB8 | I2C1_SCL, TIM4_CH3, FDCAN1_RX | D15 / SCL | Reloj I2C1 (Compartido con BOOT0) |
| Pin 15 | Impar | HWID_3 | PC3 | ADC1_IN9, ADC2_IN9, LPTIM1_ETR | A3 | Identificación Hardware Bit 3 (ADC/Digital) |
| Pin 16 | Par | TRT_GPIO_3 | PB0 | TIM1_CH2N, TIM3_CH3, ADC1_IN15 | D3 / PWM | GPIO / PWM auxiliar / ADC |
+-------------------+
SPI_CS (PB6) | [ 1] [ 2] | GND
SPI_MOSI (PA7) | [ 3] [ 4] | +5V
SPI_MISO (PA6) | [ 5] [ 6] | TRT_GPIO_1 (PA1)
SPI_SCK (PA5) | [ 7] [ 8] | +3.3V
HWID_0 (PC0) | [ 9] [10] | TRT_GPIO_2 (PA4)
HWID_1 (PC1) | [11] [12] | SDA (PB9)
HWID_2 (PC2) | [13] [14] | SCL (PB8)
HWID_3 (PC3) | [15] [16] | TRT_GPIO_3 (PB0)
+-------------------+
Conector J2| Función | Pin STM32G474 | Características |
|---|---|---|
| Driver Motor (GATE) | PB4 | TIM3_CH1 (PWM Low-Side, MOSFET AO3400A a conector J1) |
| Habilitador Pull-Up I2C | PC15 | Control digital de polarización para resistencias I2C1 (Push-Pull HIGH = ON, High-Z = OFF) |
| LED Usuario (Azul) | PA5 | Compartido con SPI1_SCK (R=470Ω a GND) |
| USB D- | PA11 | USB 2.0 Full Speed Data - |
| USB D+ | PA12 | USB 2.0 Full Speed Data + |
| SWDIO | PA13 | Tag-Connect Pin 4 |
| SWCLK | PA14 | Tag-Connect Pin 2 |
| SWO | PB3 | Tag-Connect Pin 6 (Asynchronous SWO Trace) |
El microcontrolador STM32G474RET6 multiplexa el pin físico 60 entre PB8 y la señal de selección de arranque BOOT0.
nBOOT0_SEL = 1, en cada reinicio el hardware muestrea el pin PB8. Dado que PB8 está conectado a la línea I2C SCL con una resistencia de pull-up, el MCU detectará un nivel alto (BOOT0 = 1) y entrará en el bootloader DFU de ST en lugar de ejecutar la memoria Flash.FLASH_OPTR:
nBOOT0_SEL = 0 (Bit 27): El valor de BOOT0 es ignorado desde el pin físico PB8 y se toma del bit de software nBOOT0.nBOOT0 = 1 (Bit 26): En lógica invertida, un valor de 1 equivale a BOOT0 = 0, forzando el arranque directo desde la Flash Principal.void Configure_Boot_OptionBytes(void) {
FLASH_OBProgramInitTypeDef obInit = {0};
HAL_FLASH_Unlock();
HAL_FLASH_OB_Unlock();
HAL_FLASHEx_OBGetConfig(&obInit);
// Si nBOOT0_SEL está en 1 (muestreo por pin físico PB8), cambiar a software
if ((obInit.UserConfig & FLASH_OPTR_nBOOT0_SEL) != 0) {
obInit.OptionType = OPTIONBYTE_USER;
obInit.UserType = OB_USER_nBOOT0_SEL | OB_USER_nBOOT0;
// nBOOT0_SEL = 0 (software), nBOOT0 = 1 (arranque en Flash)
obInit.UserConfig = OB_nBOOT0_SEL_DISABLE | OB_nBOOT0_SET;
HAL_FLASHEx_OBProgram(&obInit);
HAL_FLASH_OB_Launch(); // Aplica cambios y reinicia el MCU
}
HAL_FLASH_OB_Lock();
HAL_FLASH_Lock();
}I2C_PU_EN)Las resistencias de 2.2 kΩ están conectadas al pin PC15.
[!WARNING] Regla de Oro de Firmware para PC15:
- Para ACTIVAR el bus I2C: Configurar
PC15como Salida Push-Pull en nivel ALTO (GPIO_PIN_SET= 3.3V).- Para DESACTIVAR el bus I2C: Configurar
PC15como Entrada Flotante (High-Z / No-Pull).- NUNCA configurar
PC15como salida en nivel BAJO (0V), ya que esto forzaría a masa las líneasSDAySCLmediante 2.2 kΩ, bloqueando la comunicación y consumiendo corriente innecesaria.
// Activa las resistencias de pull-up (Bus I2C operativo)
void I2C_Pullups_Enable(void) {
GPIO_InitTypeDef GPIO_InitStruct = {0};
__HAL_RCC_GPIOC_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_15, GPIO_PIN_SET); // Alimenta +3.3V al nodo
}
// Desconecta las resistencias de pull-up (Modo bajo consumo)
void I2C_Pullups_Disable(void) {
GPIO_InitTypeDef GPIO_InitStruct = {0};
__HAL_RCC_GPIOC_CLK_ENABLE();
// Configurar en entrada de alta impedancia (High-Z)
GPIO_InitStruct.Pin = GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
}El MOSFET AO3400A es activado directamente por lógica de 3.3V desde PB4.
TIM3CLK) = 170 MHz.
Prescaler = 16 $\rightarrow$ Frecuencia de conteo = 10 MHz.Period (ARR) = 999 $\rightarrow$ Frecuencia PWM = 10 kHz ($10\text{ MHz} / 1000$).// Iniciar señal PWM
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);
// Modificar velocidad del motor (0 a 1000)
void Motor_SetSpeed(uint16_t speed) {
if (speed > 1000) speed = 1000;
__HAL_TIM_SET_COMPARE(&htim3, TIM_CHANNEL_1, speed);
}J1 Pin 1 (+5V) $\rightarrow$ Motor $\rightarrow$ J1 Pin 2 $\rightarrow$ Diodo 1N5819HW debe colocarse lo más compacto posible para minimizar la radiación EMI.J1, el Drain del MOSFET y el Source a GND con un ancho mínimo de 1.2 mm a 1.5 mm (o polígono de cobre).VDD, conectando primero el pad del capacitor antes de la vía hacia el plano interno.FB1 y su capacitor de 100 nF para VDDA/VREF+ deben ubicarse pegados a los pines 18 y 19.GND guard ring) alrededor del cristal y sus capacitores de 22 pF.| Qty | Value | Footprint | References |
|---|---|---|---|
| 9 | 10k | Resistor_SMD:R_0805_2012Metric | R1, R2, R3, R4, R5, R6, R7, R12, R15 |
| 6 | 100nF | Capacitor_SMD:C_0805_2012Metric | C6, C7, C8, C9, C11, C12 |
| 4 | MountingHole:MountingHole_2.7mm_M2.5_Pad | , , , | |
| 4 | TestPoint | TestPoint:TestPoint_Pad_D1.0mm | TP1, TP2, TP3, TP4 |
| 3 | 10uF | Capacitor_SMD:C_0805_2012Metric | C4, C5, C10 |
| 2 | 100nf | Capacitor_SMD:C_0603_1608Metric | C3, C13 |
| 2 | 2.2K | Resistor_SMD:R_0805_2012Metric | R10, R11 |
| 2 | 22pf | Capacitor_SMD:C_0805_2012Metric | C1, C2 |
| 2 | 5.1k | Resistor_SMD:R_0805_2012Metric | R8, R9 |
| 2 | LED | LED_SMD:LED_0805_2012Metric | D1, D2 |
| 1 | 100 | Resistor_SMD:R_0805_2012Metric | R16 |
| 1 | 1N5819HW | Diode_SMD:D_SOD-123 | D3 |
| 1 | 1k | Resistor_SMD:R_0805_2012Metric | R13 |
| 1 | 470 | Resistor_SMD:R_0805_2012Metric | R14 |
| 1 | AMS1117-3.3 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U2 |
| 1 | AO3400A | Package_TO_SOT_SMD:SOT-23 | Q1 |
| 1 | Conn_01x02_Pin | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J1 |
| 1 | Conn_01x04_Pin | Connector_PinHeader_2.00mm:PinHeader_1x04_P2.00mm_Horizontal | J5 |
| 1 | Conn_01x04_Socket | Connector_PinHeader_2.00mm:PinHeader_1x04_P2.00mm_Horizontal | J4 |
| 1 | Crystal_GND3 | Crystal:Crystal_SMD_5032-4Pin_5.0x3.2mm | Y1 |
| 1 | DIN41612_02x08_AB_EvenPins | Connector_PinHeader_2.00mm:PinHeader_2x08_P2.00mm_Vertical_SMD | J2 |
| 1 | DIN41612_02x08_AB_EvenPins | Connector_PinSocket_2.00mm:PinSocket_2x08_P2.00mm_Vertical_SMD | J2 |
| 1 | FerriteBead | Inductor_SMD:L_0805_2012Metric | FB1 |
| 1 | STM32F411CEUx | Package_DFN_QFN:QFN-48-1EP_7x7mm_P0.5mm_EP5.6x5.6mm | U3 |
| 1 | STM32G474RETx | Package_QFP:LQFP-64_10x10mm_P0.5mm | U1 |
| 1 | SW_Push | Button_Switch_SMD:SW_SPST_B3U-1000P-B | SW1 |
| 1 | TC2030 | Connector:Tag-Connect_TC2030-IDC-NL_2x03_P1.27mm_Vertical | J3 |
| 1 | USB_C_Receptacle_USB2.0_16P | Connector_USB:USB_C_Receptacle_HRO_TYPE-C-31-M-12 | J6 |
It measures 50 × 50 mm and has 4 copper layers, 1.6 mm thick.
54 parts, built around the AMS1117-3.3, 1N5819HW and AO3400A. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the AntonioTRT/TRT_HW repository on GitHub, at the commit this page was made from: the board is hardware/carrier-board/carrier-board.kicad_pcb and its schematic hardware/carrier-board/carrier-board.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask AntonioTRT before reusing the design.

agendek78/zigbee_led_driver
Zigbee 3.0 4-channel LED strip driver (MGM210L)


zenitheesc/ZenSat-V3-EPS
Repositório para o desenvolvimento do sistema de EPS do CubeSat ZenSat V3


NuttyShell/NuttyBadge
NuttyBadge: A NuttyShell crafted multi-tool. Opensourced Hardawre and Software



0xjmux/iot_leddriver_hw
ESP32-based WS2812B LED Strip Driver PCB, designed for music visualization