# ⚡ Industrial IoT Gateway PCB (ESP32 & STM32)

![PCB Design](https://img.shields.io/badge/Design-PCB-green)
![Architecture](https://img.shields.io/badge/Architecture-Dual_MCU-blue)
![Input Voltage](https://img.shields.io/badge/Input-24V_DC-red)
![Status](https://img.shields.io/badge/Status-Completed-success)

## 📖 Overview
This repository contains the schematic and PCB layout for an **Industrial-grade IoT Gateway**. The board features a **Dual-MCU chip-down architecture**, integrating bare ESP32 and STM32 microcontrollers directly onto the PCB without relying on pre-assembled modules. 

The design is engineered for reliability in industrial environments, featuring a robust power tree, isolated control circuits, and high-speed signal integrity techniques.

## ✨ Hardware Highlights

### 🔋 Power Management (Power Tree)
Designed to accept standard industrial 24V DC input:
*   **Step-Down 1 (Buck)**: `LM2596` switching regulator efficiently drops 24V down to 5V.
*   **Step-Down 2 (LDO)**: `AMS1117-3.3` linear regulator provides clean, low-noise 3.3V power specifically for the sensitive MCU and sensor logic.

### 🧠 Dual-MCU Chip-down Architecture
*   **ESP32**: Handles Wi-Fi/MQTT connectivity and drives the high-speed UI display.
*   **STM32**: Dedicated co-processor for real-time sensor polling and hardware execution.
*   *Note: Both MCUs are designed as raw SMD components placed directly on the board, heavily reducing the footprint compared to using dev-board modules.*

### 📺 High-Speed SPI Display & Signal Integrity
*   Drives a **2.8-inch TFT Display** via the ESP32.
*   **Length Matching (Meander Routing)**: The SPI traces (SCK, MOSI, MISO) are carefully routed using meander patterns to achieve exact length matching. This ensures all high-frequency signals arrive simultaneously, eliminating phase shift and data corruption.

### ⚙️ Actuator & Control Circuits
*   **Custom Isolated MOSFET Drivers**: Opto-isolated circuitry to safely drive high-current loads without damaging the logic level MCUs.
*   **Solid State Relay (SSR) Control**: Zero-crossing/fast-switching control for AC loads.

### 📡 Integrated Sensors
*   **INA219**: High-precision I2C current/power monitor to measure the load consumption of the system.
*   **Smoke Sensor**: Integrated circuitry for smoke/gas detection.
*   **Environmental**: Temperature and Humidity sensor interfaces.

## 📂 Repository Contents
*   `/Schematics`: PDF versions of the circuit design.
*   `/Gerber`: Manufacturing files ready for JLCPCB/PCBWay.
*   `/BOM`: Bill of Materials and Pick & Place files for SMT assembly.
*   `/3D_Models`: 3D STEP files of the assembled PCB.

## 📐 PCB Specifications
*   **Layers**: 2 or 4 Layers (Specify based on your design)
*   **Thickness**: 1.6mm
*   **Impedance Control**: Applied on SPI and RF traces.

  
<img width="680" height="446" alt="2df3d72162b6e3e8baa7" src="https://github.com/user-attachments/assets/e859d053-7dde-4321-827f-0540ddf53e95" />
<img width="828" height="652" alt="8ecf140da19a20c4798b" src="https://github.com/user-attachments/assets/5dcd7633-66e1-4082-b381-1367b46bdb03" />


<img width="613" height="619" alt="image" src="https://github.com/user-attachments/assets/b7e0c302-8b7e-45bd-acbe-60cad714e58f" />
<img width="607" height="600" alt="image" src="https://github.com/user-attachments/assets/81aab809-6128-4286-8151-b11e96a33b3b" />
<img width="618" height="609" alt="image" src="https://github.com/user-attachments/assets/d1674612-1cc8-44c6-9c0a-675997cfa4dc" />



