

An open-source STM32F103C8T6 development board designed for environmental monitoring, featuring integrated Li-Ion battery management, USB-C, MicroSD data logging, and onboard I2C sensors for temperature, humidity, and ambient light.
- Size
- 40 × 58 mm
- Copper layers
- 4
- Thickness
- 1.6 mm
- Parts
- 59
- Nets
- 69
- Pads
- 254
- Tracks, vias
- 697, 135
- Pours
- 1
- Routed
- Yes
- KiCad
- KiCad 9.0 (file 20241229)
- Created
- 12 Jul 2026
- Updated
- 3 Sep 2026
Overview
STM32-S Plant is an open-source printed circuit board by Fred98246, from the Fred98246/STM32-Environmental-Sensor-and-Datalogging-Board repository on GitHub, published under the MIT licence. It is a 4-layer board of 40 × 58 mm with 59 parts on 69 nets, routed with 697 tracks and 135 vias.
It is built around the STM32F103C8T6, OPT3001DNPRQ1 and AP2112K-3.3TRG1, with the AP9101CAK-AKTRG1, D3V3XA4B10LP-7(ES) and ZXMN3B14FTA among its other parts. Its parts include 22 capacitors, 17 resistors, 6 ICs, 5 connectors and 4 diodes. It belongs with the sensors and measurement and microcontroller boards boards and the STM32 boards of this library.
Main components
9STM32F103C8T6
LQFP-48(7x7)-40℃~+85℃ 12bit 20KB 2V~3.6V 32 Bit 37 64KB 72MHz ARM Cortex-M3 Built-in FLASH LQFP-48(7x7) Microcontrollers (MCU/MPU/SOC) ROHSSTMicroelectronicsMicrocontrollers (MCU/MPU/SOC)OPT3001DNPRQ1
USON-6-EP(2.1x2.1)-40℃~+105℃ 0.65mm 1.6V~3.6V 2mm 2mm 83klx I2C Light Intensity USON-6-EP(2.1x2.1) Ambient Light Sensors ROHSTexas InstrumentsAmbient Light SensorsAP2112K-3.3TRG1
SOT-25-5-40℃~+85℃@(Ta) 1 250mV@(600mA) 3.3V 50uVrms 55uA 600mA 65dB@(1kHz) 6V Fixed Over Current Protection、Thermal Shutdown、Enable control Positive SOT-25-5 Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHSDiodes IncorporatedVoltage Regulators - Linear, Low Drop Out (LDO) RegulatorsAP9101CAK-AKTRG1
SOT-25-5-40℃~+85℃ 1 1.5V~5.5V 10nA 2.4V 4.25V Lithium Battery Not supported Overcharge protection、Over-discharge protection、Overcurrent Protection、Short-Circuit Protection、Overvoltage Protection Protection IC Support SOT-25-5 Battery Management ROHSDiodes IncorporatedBattery ManagementD3V3XA4B10LP-7(ES)
DFN2510-10L-40℃~+125℃ 0.18pF 1nA 3.3V 7V 8V IEC 61000-4-2 TVS DFN2510-10L ESD and Surge Protection (TVS/ESD) ROHSElecSuperUncategorisedZXMN3B14FTA
SOT-23-55℃~+150℃ 1 N-channel 1.5W 3.5A 30V 568pF 6.7nC@4.5V 66pF 700mV 80mΩ@4.5V SOT-23 MOSFETs ROHSDiodes IncorporatedMOSFETsAO3401A
SOT-231 P-Channel 14nC@10V 30V 47mΩ@10V、60mΩ@4.5V、85mΩ@2.5V 4A 55pF 645pF 80pF 900mV SOT-23 MOSFETs ROHSAlpha & Omega SemiconductorMOSFETsLFXTAL085871
-- Crystals ROHSIQDCrystalsSS14
SMA(DO-214AC)-55℃~+150℃ 1A 25A 300uA@40V 40V 550mV@1A Independent SMA(DO-214AC) Schottky Diodes ROHSMDDSchottky Diodes
README
README.mdCustom STM32 Environmental Sensor & Datalogging Board
Project Overview
This repository contains the complete design files and source code for a custom, battery-powered STM32 microcontroller board designed for environmental monitoring and data logging. Measuring at a compact 40 x 58 mm, the board features integrated temperature, humidity, and ambient light sensors, alongside an SD card slot for local data storage. It includes a complete Li-Ion power management system with USB-C charging, load sharing, and battery protection.
The user interface is driven by a rotary encoder and an external SPI display, making it suitable for standalone automated environments like humidity control or ambient monitoring.
Repository Structure
- Hardware: Contains the complete KiCad E.D.A. project files, including the schematic and the 4-layer PCB layout.
- Manufacturing: Includes the generated Gerber files, Drill files, and sheets with the Bill of Materials (BOM) required for PCB fabrication and assembly.
- Firmware: Contains the
STM32CubeMX(.ioc) configuration file for peripheral initialization and the C/C++ code with the needed drivers. - docs: Contains component datasheets and a detailed Bill of Materials (BOM) spreadsheet
Hardware Implementation Details
Core Processing
- Microcontroller: The board is powered by the STM32F103C8T6 ARM Cortex-M3 MCU.
- Clocking: A 16MHz crystal oscillator (LFXTAL085871) is implemented to provide the precise clocking required for stable USB communication.
- Debugging/Programming: Connector for SWD programming, via ST-Link V2.
Power Management
The power architecture is designed for safe, continuous operation whether plugged in or running on battery:
- Battery Charging: Handled by the MCP73831/2 IC, drawing 5V from the USB-C port to charge a connected Li-Ion cell.
- Battery Protection: An AP9101C IC, paired with dual ZXMN3B14F N-Channel MOSFETs, protects the battery from overcharge, overdischarge, and overcurrent scenarios.
- Load Sharing: An AO3401A P-Channel MOSFET and an SS14 Schottky diode create a seamless load-sharing circuit. This ensures the system runs directly off USB power when plugged in, allowing the battery to charge optimally without system load interference.
- Regulation: An AP2112K-3.3TRG1 LDO provides a stable 3.3V supply for the MCU and logic.
Sensors & Interfaces
- Environmental Sensing: Utilizes the SHT3x-DIS for high-precision temperature and humidity tracking via I2C.
- Light Sensing: Incorporates the OPT3001DNPRQ1 ambient light sensor, also operating on the I2C bus.
- Storage: A Molex 47219-2001 MicroSD card receptacle is routed via high-speed SPI for data logging in txt file.
- Connectivity: USB-C port configured for USB 2.0 data and power. D3V3XA4B10LP TVS diode arrays are placed on both the USB data lines and the SD card lines to protect against electrostatic discharge (ESD).
- USB-CDC Virtual COM Port Interface: Integrated full-speed USB communication between the STM32 and host PC, enabling real-time serial telemetry and diagnostic logging for hardware bring-up and physical fault isolation.
- User Input: Hardware debounced rotary encoder footprint with integrated push-button functionality.
Design Challenges & Signal Integrity
Designing this board within a 40x58mm footprint required careful attention to PCB stackup and signal routing:
- Component Footprints & Tolerances: Extensive review of manufacturer datasheets was required to ensure precise footprint creation and component placement within the restricted 40x58mm board area.
- 4-Layer Stackup: To accommodate the component density and maintain strict signal integrity, a 4-layer PCB was utilized (Top Signal, Ground Plane, Power Plane, Bottom Signal). This continuous internal ground plane is critical for providing short return paths for high-frequency signals and minimizing electromagnetic interference (EMI).
- USB Differential Routing: The USB D+ and D- lines require 90-ohm differential impedance matching. The 4-layer stackup allowed for calculating precise trace widths and spacing over the internal ground plane to hit this impedance target, ensuring reliable USB enumeration and data transfer.
- MicroSD SPI Speeds: Because SD card SPI operates at moderate speeds, it does not require strict impedance matching or length tuning. The 4-layer stackup provided the flexibility to route these signals easily through vias while maintaining a solid ground reference to minimize general EMI.
- Mixed-Signal Placement: Analog sensor lines (I2C for SHT3x and OPT3001) are physically separated from high-speed digital traces (USB, SPI, and the 16MHz crystal) to prevent digital switching noise from coupling into the sensitive environmental readings.
- Firmware Architecture: The C/C++ codebase leverages STM32 HAL libraries, structured with modular driver functions and a streamlined main loop to ensure non-blocking sensor reads and efficient peripheral management.
Operational Flow & User Interface:
The firmware is structured around an event-driven state machine that handles user interaction, data logging, and strict power efficiency:
- Startup & Menu Navigation: The system is awakened by a physical press of the rotary encoder. The TFT display initializes and presents an interactive menu where the user can select to view Temperature, Humidity, or Ambient Light.
- Active Monitoring: Upon selection, the screen continuously updates with real-time readings from the designated I2C sensor.
- Concurrent Datalogging & Telemetry: While the system is awake, it automatically mounts the FATFS file system and appends the sensor readings to a
.txtfile on the MicroSD card at strict 10-second intervals. Simultaneously, this data is continuously broadcast over the USB-CDC COM port to a connected PC for live monitoring. - Low-Power Sleep Mode: To conserve battery, if the system detects no rotary encoder rotation or button clicks for 2 minutes, it automatically gracefully closes the SD card file, powers down the display, and puts the STM32 into a low-power
STOPstate. A subsequent button press triggers an EXTI hardware interrupt, waking the system back to full operation instantly.
🚀 Future Scope: Closed-Loop Automation
While currently operating as a standalone datalogger, this board was engineered to serve as the precision sensor node for future automated control systems. By linking the onboard environmental telemetry to external physical actuators (such as fans, humidifiers, or motorized blinds), the hardware will transition into a dynamic closed-loop control environment.
The high-resolution empirical data currently gathered via the SD card and USB interface provides the foundation for mathematical system identification. This allows the physical environment's behavior to be accurately modeled in software like MATLAB, enabling the future calculation of transfer functions and the implementation of tuned PID or automated sequential control logic directly onto the STM32.
- Schematic:
- PCB:
- 3D View:
Parts
59| Qty | Value | Footprint | References |
|---|---|---|---|
| 10 | 100n | Capacitor_SMD:C_0402_1005Metric | C5, C7, C8, C9, C11, C12, C16, C17, C18, C24 |
| 6 | 10K | Resistor_SMD:R_0603_1608Metric | R1, R9, R19, R20, R21, R22 |
| 4 | 10k | Resistor_SMD:R_0603_1608Metric | R10, R16, R17, R18 |
| 3 | 10n | Capacitor_SMD:C_0402_1005Metric | C19, C20, C21 |
| 3 | 10u | Capacitor_SMD:C_0805_2012Metric | C6, C10, C15 |
| 2 | 10p | Capacitor_SMD:C_0402_1005Metric | C22, C23 |
| 2 | 1u | Capacitor_SMD:C_0402_1005Metric | C1, C2 |
| 2 | 4.7u | Capacitor_SMD:C_0805_2012Metric | C3, C4 |
| 2 | 5.1K | Resistor_SMD:R_0603_1608Metric | R7, R8 |
| 2 | D3V3XA4B10LP-7 | SamacSys_Parts:D3V3XA4B10LP7 | D1, D6 |
| 2 | ZXMN3B14FTA | SamacSys_Parts:ZXMN3B14FTA | Q2, Q3 |
| 1 | 100K | Resistor_SMD:R_0603_1608Metric | R6 |
| 1 | 2.7K | Resistor_SMD:R_0603_1608Metric | R5 |
| 1 | 2K | Resistor_SMD:R_0603_1608Metric | R3 |
| 1 | 330 | Resistor_SMD:R_0603_1608Metric | R4 |
| 1 | 470 | Resistor_SMD:R_0603_1608Metric | R2 |
| 1 | 47219-2001 | SamacSys_Parts:472192001 | J4 |
| 1 | AO3401A | SamacSys_Parts:SOT95P280X125-3N | Q1 |
| 1 | AP2112K-3.3TRG1 | SamacSys_Parts:SOT95P270X145-5N | IC1 |
| 1 | AP9101CAK-AKTRG1 | SamacSys_Parts:SOT95P270X145-5N | IC2 |
| 1 | Battery Connector | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J1 |
| 1 | Charging LED | Capacitor_SMD:C_0603_1608Metric | D4 |
| 1 | DEBUG CONNECTOR ST-LINK | Connector_PinHeader_2.54mm:PinHeader_1x07_P2.54mm_Vertical | J5 |
| 1 | DISPLAY | Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_Vertical | J3 |
| 1 | LFXTAL085871 | SamacSys_Parts:LFXTAL085871 | Y2 |
| 1 | MCP73831-2ATI_OT | SamacSys_Parts:SOT95P270X145-5N | IC4 |
| 1 | OPT3001DNPRQ1 | SamacSys_Parts:SON65P200X200X65-7N-D | IC6 |
| 1 | RotaryEncoder_Switch | Rotary_Encoder:RotaryEncoder_Alps_EC11E-Switch_Vertical_H20mm_MountingHoles | SW1 |
| 1 | SHT3X-DIS | SamacSys_Parts:SON50P250X250X100-9N-D | IC7 |
| 1 | SS14 | SamacSys_Parts:DIOM5026X230N | D5 |
| 1 | STM32F103C8T6 | SamacSys_Parts:QFP50P900X900X160-48N | IC8 |
| 1 | USB_C_Receptacle_USB2.0_16P | Connector_USB:USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_Horizontal | J2 |
Similar boards
- 4 layers90 × 50 mm

- 2 layers21.2 × 77.6 mm

- 2 layers45 × 45 mm

Watch
DINDIN2007/Blystwatch
This is a demo board to showcase development with both the BlystL15 (based on the nrf54L15) and the IOComposer AI from I-Syst.inc.
47 parts - 4 layers160 × 90 mm

- 6 layers76.5 × 339.8 mm

Fmc host
open-ephys/onix-fmc-host
FMC board to acquire from ONIX headstages and breakout boards
320 parts5 - 8 layers58 × 117 mm

- 2 layers65 × 40 mm

RS485 V4
jiazhengfu912-lang/STM32-Isolated-RS485-DevBoard
STM32F103C8T6 isolated RS485 development board: KiCad schematic, PCB, 3D previews and engineering validation
63 parts - 2 layers304.8 × 95.3 mm

Questions
How big is the STM32-S Plant PCB?
It measures 40 × 58 mm and has 4 copper layers, 1.6 mm thick.
What parts does the STM32-S Plant use?
59 parts, built around the STM32F103C8T6, OPT3001DNPRQ1, AP2112K-3.3TRG1 and AP9101CAK-AKTRG1. 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.
Where can I download the STM32-S Plant KiCad files?
From the Fred98246/STM32-Environmental-Sensor-and-Datalogging-Board repository on GitHub, at the commit this page was made from: the board is hardware/STM32-S-Plant.kicad_pcb and its schematic hardware/STM32-S-Plant.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the STM32-S Plant design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).