Sensor Device BOM Design

Working for 2 days 22 hrs...
Thought for 10 sec
1/4 Check and clean dangling traces before routing
Accessed knowledge for the next task.
Thought for 3 sec
Completed Dangling Traces check — found 270 issues.
Thought for 4 sec
2/4 Run auto-route
Accessed knowledge for the next task.
Thought for 5 sec
Routing complete!
Thought for 6 sec
3/4 Run DRC focused on airwires and clearance after routing

Check and clean dangling traces before routing

Run auto-route

Run DRC focused on airwires and clearance after routing

Summarize routing DRC issues and next fixes

Accessed knowledge for the next task.
Thought for 4 sec
Checking 8 design areas.
Getting a layout overview...
continue routing
Route all unrouted nets on this PCB

On it...

Refine this doc
Ask about this doc
Firmware Starter — STM32WBA55 Sensor Node
Platform & Toolchain
  • MCU: STM32WBA55UGI6 substitute for STM32WBA65PII7.
  • Framework: STM32Cube HAL.
  • Build system: STM32CubeIDE or STM32CubeMX generated CMake project.
  • Wireless stack: ST STM32WBA BLE/802.15.4 middleware. Add application-specific advertising/commissioning after basic sensor bring-up.
Pin Mapping From Schematic

Table


FunctionMCU PinNetConnected ToDirectionNotes
I2C SCLPB6I2C_SCLBME280, BME688, LIS2DW12, TSL25911, SCD41, camera placeholderAF OD4.7 kΩ pull-up to 3V3.
I2C SDAPB7I2C_SDABME280, BME688, LIS2DW12, TSL25911, SCD41, camera placeholderAF OD4.7 kΩ pull-up to 3V3.
SPI SCKPA5SPI_SCKBGT60TR13C, camera placeholderAF push-pullKeep short in layout.
SPI MISOPA6SPI_MISOBGT60TR13C, camera placeholderInput AFShared SPI data in.
SPI MOSIPA7SPI_MOSIBGT60TR13C, camera placeholderAF push-pullShared SPI data out.
Radar CSPB0RADAR_CSBGT60TR13C CS_NGPIO outActive low, pulled up.
Radar IRQPB1RADAR_IRQBGT60TR13C IRQGPIO interruptRising/falling edge per driver.
Radar resetPB2RADAR_RESETBGT60TR13C DIO3/resetGPIO outPulse per Infineon driver requirements.
PM UART TXPA2UART_TX_MCUPMS5003 RX, debug J2UART TX9600 8N1 for PMS5003.
PM UART RXPA3UART_RX_MCUPMS5003 TX, debug J2UART RX9600 8N1 for PMS5003.
PDM clockPB13PDM_CLKIM69D130 clockPDM clockConfigure SAI/DFSDM/PDM peripheral as supported by STM32WBA.
PDM dataPB14PDM_DATAIM69D130 dataPDM data inMono microphone.
IR PWMPA4IR_PWMAO3400A gate through R25Timer PWMDrives four SFH 4045N IR LEDs through MOSFET.
Light interruptPC13LIGHT_INTTSL25911 INTGPIO interruptPull-up to 3V3.
Accelerometer INT1PB8ACCEL_INT1LIS2DW12 INT1GPIO interruptWake/tamper interrupt.
Accelerometer INT2PB9ACCEL_INT2LIS2DW12 INT2GPIO interruptOptional secondary interrupt.
NH3 ADCPA0NH3_ADCMiCS-6814 NH3 dividerADC inputRequires calibration.
RED gas ADCPA1RED_GAS_ADCMiCS-6814 RED dividerADC inputRequires calibration.
OX gas ADCPA11OX_GAS_ADCMiCS-6814 OX dividerADC inputRequires calibration.
Camera resetPB3CAM_RESETJ1 camera placeholderGPIO outPlaceholder until exact VD55G4 module is defined.
Camera syncPA15CAM_FRAME_SYNCJ1 camera placeholderGPIO in/outPlaceholder frame/strobe sync.
SWDIOPA13SWDIOJ2DebugSWD.
SWCLKPA14SWCLKJ2DebugSWD.
ResetNRSTNRSTJ2 and pull-upResetActive low.
Boot modePH3_BOOT0BOOT010 kΩ pulldownBoot strapLow = normal boot.
USB debug UART TXPA9DBG_UART_TX_MCUCP2102N RXDUART TXDedicated USB-C debug console path.
USB debug UART RXPA10DBG_UART_RX_MCUCP2102N TXDUART RXDedicated USB-C debug console path.
Status LEDPA8STATUS_LEDR32 + LED2GPIO outputUser firmware status indicator.
I2C Device Address Plan
  • BME280: 0x76.
  • BME688: 0x77.
  • LIS2DW12: verify SA0 selection in final firmware; schematic straps SA0 low.
  • TSL25911: fixed by device family, typically 0x29.
  • SCD41: fixed by Sensirion driver.
Bring-Up Sequence
  1. Initialize clocks, GPIO, and watchdog.
  2. Bring up UART console and PMS5003 UART.
  3. Initialize I2C bus and scan addresses.
  4. Initialize BME280, BME688, LIS2DW12, TSL25911, SCD41.
  5. Initialize ADC channels for MiCS-6814 analog outputs.
  6. Initialize SPI and reset/configure BGT60TR13C.
  7. Initialize PDM microphone capture.
  8. Initialize IR PWM at safe low duty cycle.
  9. Start BLE/802.15.4 stack and publish telemetry.
STM32Cube Configuration Checklist
  • PB6/PB7: I2C, open-drain, pull-ups external.
  • PA5/PA6/PA7: SPI master.
  • PA2/PA3: USART at 9600 for PMS5003; optional debug output on same header only if firmware arbitrates usage.
  • PA9/PA10: dedicated UART for USB-C debug console through CP2102N.
  • PA8: GPIO output for status LED.
  • PA0/PA1/PA11: ADC inputs, sample time high enough for external sensor source impedance.
  • PA4: timer PWM output.
  • PC13/PB8/PB9/PB1: EXTI inputs.
  • PB0/PB2/PB3: GPIO outputs.
  • PA13/PA14: SWD enabled.
  • PH3_BOOT0: normal boot pulled low.
Minimal HAL Skeleton

C


#include "main.h"
#include <string.h>
#include <stdio.h>

I2C_HandleTypeDef hi2c1;
SPI_HandleTypeDef hspi1;
UART_HandleTypeDef huart2;
UART_HandleTypeDef huart1;
ADC_HandleTypeDef hadc1;
TIM_HandleTypeDef htim2;

#define RADAR_CS_GPIO_Port      GPIOB
#define RADAR_CS_Pin            GPIO_PIN_0
#define RADAR_RESET_GPIO_Port   GPIOB
#define RADAR_RESET_Pin         GPIO_PIN_2
#define CAM_RESET_GPIO_Port     GPIOB
#define CAM_RESET_Pin           GPIO_PIN_3
#define IR_PWM_TIMER            htim2
#define IR_PWM_CHANNEL          TIM_CHANNEL_1
#define STATUS_LED_GPIO_Port    GPIOA
#define STATUS_LED_Pin          GPIO_PIN_8

#define BME280_ADDR             (0x76 << 1)
#define BME688_ADDR             (0x77 << 1)
#define TSL2591_ADDR            (0x29 << 1)

static void Error_Handler_User(const char *msg) {
    HAL_UART_Transmit(&huart2, (uint8_t*)msg, strlen(msg), HAL_MAX_DELAY);
    HAL_UART_Transmit(&huart2, (uint8_t*)"\r\n", 2, HAL_MAX_DELAY);
}

static uint8_t i2c_read_u8(uint16_t addr, uint8_t reg) {
    uint8_t value = 0;
    HAL_I2C_Mem_Read(&hi2c1, addr, reg, I2C_MEMADD_SIZE_8BIT, &value, 1, 100);
    return value;
}

static void i2c_write_u8(uint16_t addr, uint8_t reg, uint8_t value) {
    HAL_I2C_Mem_Write(&hi2c1, addr, reg, I2C_MEMADD_SIZE_8BIT, &value, 1, 100);
}

static void init_environment_sensors(void) {
    uint8_t id_bme280 = i2c_read_u8(BME280_ADDR, 0xD0);
    uint8_t id_bme688 = i2c_read_u8(BME688_ADDR, 0xD0);
    char msg[64];
    snprintf(msg, sizeof(msg), "BME280 ID=0x%02X BME688 ID=0x%02X", id_bme280, id_bme688);
    Error_Handler_User(msg);

    /* Basic forced-mode examples; replace with Bosch/Sensirion/ST production drivers. */
    i2c_write_u8(BME280_ADDR, 0xF4, 0x25);
    i2c_write_u8(BME688_ADDR, 0xF4, 0x25);
}

static void init_radar(void) {
    HAL_GPIO_WritePin(RADAR_CS_GPIO_Port, RADAR_CS_Pin, GPIO_PIN_SET);
    HAL_GPIO_WritePin(RADAR_RESET_GPIO_Port, RADAR_RESET_Pin, GPIO_PIN_RESET);
    HAL_Delay(10);
    HAL_GPIO_WritePin(RADAR_RESET_GPIO_Port, RADAR_RESET_Pin, GPIO_PIN_SET);
    HAL_Delay(50);
}

static void read_pms5003_frame(void) {
    uint8_t frame[32];
    if (HAL_UART_Receive(&huart2, frame, sizeof(frame), 1000) == HAL_OK) {
        if (frame[0] == 0x42 && frame[1] == 0x4D) {
            uint16_t pm25 = ((uint16_t)frame[12] << 8) | frame[13];
            char msg[64];
            snprintf(msg, sizeof(msg), "PM2.5=%u ug/m3", pm25);
            Error_Handler_User(msg);
        }
    }
}

static uint32_t read_adc_channel(uint32_t channel) {
    ADC_ChannelConfTypeDef sConfig = {0};
    sConfig.Channel = channel;
    sConfig.Rank = ADC_REGULAR_RANK_1;
    sConfig.SamplingTime = ADC_SAMPLETIME_247CYCLES_5;
    HAL_ADC_ConfigChannel(&hadc1, &sConfig);
    HAL_ADC_Start(&hadc1);
    HAL_ADC_PollForConversion(&hadc1, 100);
    uint32_t value = HAL_ADC_GetValue(&hadc1);
    HAL_ADC_Stop(&hadc1);
    return value;
}

static void set_ir_strobe_duty(uint16_t duty) {
    __HAL_TIM_SET_COMPARE(&IR_PWM_TIMER, IR_PWM_CHANNEL, duty);
}

int main(void) {
    HAL_Init();
    SystemClock_Config();
    MX_GPIO_Init();
    MX_I2C1_Init();
    MX_SPI1_Init();
    MX_USART2_UART_Init();
    MX_USART1_UART_Init();
    MX_ADC1_Init();
    MX_TIM2_Init();

    HAL_TIM_PWM_Start(&IR_PWM_TIMER, IR_PWM_CHANNEL);
    set_ir_strobe_duty(0);

    Error_Handler_User("STM32WBA sensor node boot");
    HAL_GPIO_WritePin(STATUS_LED_GPIO_Port, STATUS_LED_Pin, GPIO_PIN_SET);
    init_environment_sensors();
    init_radar();

    while (1) {
        read_pms5003_frame();

        uint32_t nh3 = read_adc_channel(ADC_CHANNEL_0);   /* PA0 */
        uint32_t red = read_adc_channel(ADC_CHANNEL_1);   /* PA1 */
        uint32_t ox  = read_adc_channel(ADC_CHANNEL_15);  /* PA11 on many STM32 variants; verify CubeMX mapping */

        char msg[96];
        snprintf(msg, sizeof(msg), "ADC NH3=%lu RED=%lu OX=%lu", nh3, red, ox);
        Error_Handler_User(msg);

        HAL_Delay(5000);
        HAL_GPIO_TogglePin(STATUS_LED_GPIO_Port, STATUS_LED_Pin);
    }
}
Build & Flash
  1. Create an STM32CubeMX project for STM32WBA55UGI6.
  2. Assign the pins from the mapping table.
  3. Generate STM32 HAL project.
  4. Add vendor drivers for Bosch BME280/BME688, ST LIS2DW12, Sensirion SCD4x, TSL2591, and Infineon BGT60TR13C.
  5. Build in STM32CubeIDE or CMake.
  6. Flash via SWD connector J2.
Notes Before Production Firmware
  • Replace the register-level placeholder reads with vendor drivers.
  • Route debug logs to the CP2102N USB-C console on PA9/PA10; keep PA2/PA3 dedicated to PMS5003 unless firmware explicitly arbitrates both uses.
  • Add calibration routines for MiCS-6814; raw ADC values are not calibrated gas concentrations.
  • Add sensor duty cycling to meet the 30-day energy budget.
  • Add power-fault and brownout logging.
  • Add BLE/802.15.4 telemetry format and security model.
  • Platform & Toolchain

  • Pin Mapping From Schematic

  • I2C Device Address Plan

  • Bring-Up Sequence

  • STM32Cube Configuration Checklist

  • Minimal HAL Skeleton

  • Build & Flash

  • Notes Before Production Firmware

EU Smart Environmental Sensor Node

EU Smart Environmental Sensor Node thumbnail
Battery-powered EU-component environmental sensor node using STM32WBA BLE/802.15.4 MCU, gas/particle/CO2/environment/light/audio/camera/radar/tamper sensors, and 14.4V smart Li-ion power.

Properties

Properties describe core aspects of the project.

Pricing & Availability

Distributor

Qty 1

Arrow

$59.48–$87.96

Digi-Key

$61.63–$78.40

HQonline

$23.67–$23.80

LCSC

$121.14–$143.52

Mouser

$80.39

TME

$3.58

Verical

$57.86–$119.80

Controls