What is the STM32F407ZGT6?
The STM32F407ZGT6 is a high-performance ARM Cortex-M4 microcontroller running at 168 MHz. It is widely used for industrial, IoT, and embedded applications due to its powerful peripherals and real-time capabilities.
Key Features of STM32F407ZGT6:
✅ ARM Cortex-M4 Core @ 168 MHz
✅ 1 MB Flash, 192 KB RAM
✅ Multiple GPIOs, ADC, UART, SPI, I²C, CAN
✅ Low-power sleep modes
✅ Ideal for real-time, embedded, and sensing applications
The STM32F4 is a great platform for designing weather stations, environmental monitors, or any system requiring sensor reading + data display + communication.
The Embedded Weather Station measures:
✅Temperature
✅Relative Humidity
✅Real-time Display on 16x2 LCD I2C
✅Serial Output via UART that can be shown in the TerminalBPP
Hardware and Software Components:
✅Computer/Laptop
✅STM32F407ZGT6 Board
✅STM32CubeIDE
✅TerminalBPP
✅DHT11 Sensor
✅I2C LCD/OLED
✅USB Type-C Cable (Not a Power Cable)
I. Setting Up STM32CubeIDE
A. System Requirements
Before installing STM32CubeIDE, ensure your system meets the requirements:
✅ Operating System: Windows, Linux, or macOS
✅ RAM: 4 GB or higher
✅ Disk Space: At least 3–5 GB free
Please be guided that in this procedure, we will be using a Windows 10 Operating System.
B. Install STM32CubeIDE
1. Download STM32CubeIDE from: https://www.st.com/en/development-tools/stm32cubeide.html
2. Run the installer (.exe) and follow the setup instructions.
3. Wait for installation to finish.
4. Launch STM32CubeIDE.
II. Wiring Diagram
III. Creating the Weather Station Project
1. Open STM32CubeIDE and create a new STM32 project.
2. Select your MCU:
👉 STM32F407ZGT6
3. Configure the Peripherals:
Inside the.ioc file:
1. In the Pinout Configuration, click GPIO, and select one pin for DHT11 data ( in this we use PA1) and set it to GPIO_Output
2. For 16x2 LCD I2C:
- Mode:✅ I2C (check the box)
Configuration → Parameter Settings:
- I2C Speed Mode: Standard Mode
- I2C Clock Speed: 100000 Hz (100 kHz)
- Duty Cycle: 2
- Own Address: 0
- Addressing Mode: 7-bit
- Dual Address Mode: Disabled
- General Call Mode: Disabled
- No Stretch Mode: Disabled
Pins (should auto-assign):
- PB6: I2C1_SCL
- PB7: I2C1_SDA
3. For UART, enable USART1 (PA9 [TX], PA10 [RX]):
- Mode:✅ Asynchronous
Configuration → Parameter Settings:
- Baud Rate: 115200 Bits/s
- Word Length: 8 Bits (including Parity)
- Parity: None
- Stop Bits: 1
- Data Direction: Receive and Transmit
- Over Sampling: 16 Samples
Pins (should auto-assign):
- PA9: USART1_TX
- PA10: USART1_RX
4. In the Clock Configuration, set system clock to 16 MHz (CubeMX auto-configuration works).
5. For the Timers, select TIM2:
- Clock Source: Internal Clock ✅
Configuration → Parameter Settings:
- Prescaler (PSC):83
- Counter Mode: Up
- Counter Period (AutoReload Register - ARR):65535 (or 0xFFFF)
- Internal Clock Division (CKD): No Division
- auto-reload preload: Enable
NVIC Settings: (optional)
- You can leave TIM2 global interrupt unchecked (we don't use interrupts)
4. Save and Generate Code
IV. CONFIGURING TERMINALBPP:
Download:- Download from: https://sites.google.com/site/terminalbpp/
- Open PuTTY
- Connection type: Serial
- Serial line: COM3 (or your port - check Device Manager)
- Speed: 115200
- Click "Open"
Go to Category → Connection → Serial:
- Serial line to connect to: COM3 (your port)
- Speed (baud): 115200
- Data bits: 8
- Stop bits: 1
- Parity: None
- Flow control: None
V. IMAGE AND VIDEO DEMONSTRATION:
Video:
https://drive.google.com/file/d/17yYLOMNkqSIrtIMu7vn-HiZUR8SA2lC0/view?usp=sharing







Comments