# ESP32 4-Channel Lock Driver
## Description
Mạch điều khiển 4 khóa điện tử dùng ESP32, optocoupler chống nhiễu/cách ly tín hiệu, MOSFET low-side, đầu nạp UART riêng và domino nguồn/tải.
## Project Details
- **Owner:** lamtd
- **Created:** 7/20/2026
- **Last Updated:** 7/20/2026
- **Visibility:** Public
## Key Components
### D1 — [1N4007RLG](https://www.flux.ai/jecstronic/1n4007rlg~07j.md)
- Role Details: Clamp inductive kick from lock coil
- Manufacturer Name: onsemi
- Part Type: Diode
- Role: Flyback Protection
- License: https://creativecommons.org/licenses/by/4.0/
- Datasheet URL: https://www.onsemi.com/pdf/datasheet/1n4001-d.pdf
- Manufacturer Part Number: 1N4007RLG
**Pins:**
- anode [pin 2]
- cathode [pin 1]
### D2 — [1N4007RLG](https://www.flux.ai/jecstronic/1n4007rlg~07j.md)
- License: https://creativecommons.org/licenses/by/4.0/
- Manufacturer Part Number: 1N4007RLG
- Datasheet URL: https://www.onsemi.com/pdf/datasheet/1n4001-d.pdf
- Role Details: Clamp inductive kick from lock coil
- Part Type: Diode
- Manufacturer Name: onsemi
- Role: Flyback Protection
**Pins:**
- anode [pin 2]
- cathode [pin 1]
### D3 — [1N4007RLG](https://www.flux.ai/jecstronic/1n4007rlg~07j.md)
- Part Type: Diode
- Manufacturer Name: onsemi
- Role Details: Clamp inductive kick from lock coil
- Role: Flyback Protection
- License: https://creativecommons.org/licenses/by/4.0/
- Datasheet URL: https://www.onsemi.com/pdf/datasheet/1n4001-d.pdf
- Manufacturer Part Number: 1N4007RLG
**Pins:**
- anode [pin 2]
- cathode [pin 1]
### D4 — [1N4007RLG](https://www.flux.ai/jecstronic/1n4007rlg~07j.md)
- Manufacturer Part Number: 1N4007RLG
- Datasheet URL: https://www.onsemi.com/pdf/datasheet/1n4001-d.pdf
- License: https://creativecommons.org/licenses/by/4.0/
- Role: Flyback Protection
- Role Details: Clamp inductive kick from lock coil
- Manufacturer Name: onsemi
- Part Type: Diode
**Pins:**
- anode [pin 2]
- cathode [pin 1]
### D5 — [SS34](https://www.flux.ai/lcsc/ss34~6q67.md)
- Datasheet URL: https://www.lcsc.com/datasheet/C2758511.pdf
- Role Details: SS34 series Schottky reverse polarity protection from fused VIN to protected VIN
- Reverse Voltage: 40V
- Manufacturer Name: UMW(友台半导体)
- Role: Protection
- Part Type: Schottky Barrier Diodes (SBD)
- JLCPCB Part Class: Extended Part
- Package or Case Code: SMB_L4.3-W3.6-LS5.4-RD
- Diode Type: Schottky
- Forward Voltage: 0.3V to 0.45V
- LCSC Part Number: C2758511
- Manufacturer Part Number: SS34
**Pins:**
- A [pin 2]
- K [pin 1]
### F1 — [0ZCF0200AF2C](https://www.flux.ai/adrian95/0zcf0200af2c~eal.md)
- Manufacturer Part Number: 0ZCF0200AF2C
- Role Details: 2A PTC input over-current protection before reverse-polarity diode
- Role: Protection
- Manufacturer Name: BelFuse
- Part Type: Fuse
- Current Rating: 2A
- Package or Case Code: FUSC7451X80N
- License: https://creativecommons.org/licenses/by/4.0/
- Datasheet URL: https://belfuse.com/resources/datasheets/circuitprotection/ds-cp-0zcf-series.pdf
**Pins:**
- ~ [pin 2]
- ~ [pin 1]
### J1 — [KF128-5.08-2P-AA](https://www.flux.ai/lcsc/kf128-5p08-2p-aa~0pbi.md)
- Connector Pitch: 5.08mm
- LCSC Part Number: C474952
- Current Rating: 24A
- Package or Case Code: CONN-TH_P5.08_KF128-5.08-2P
- Connector Gender: Female
- JLCPCB Part Class: Extended Part
- Operating Temperature: -40℃~+105℃
- Product Info Url: https://lcsc.com/product-detail/New-Quadratic-Unclassified-Data_Cixi-Kefa-Elec-KF128-5-08-2P_C474952.html
- Connector Positions: 2
- Manufacturer Name: KEFA(科发)
- Connector Type: Screw terminal
- Manufacturer Part Number: KF128-5.08-2P-AA
- Connector Rows: 1
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/lcsc/2408211511_Cixi-Kefa-Elec-KF128-5-08-2P-AA_C474952.pdf
- Part Type: Screw terminal
- Role Details: Main power input: pin 1 VIN 4.5–17V nominal, pin 2 GND/PGND return
- Role: Connector
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
### J3 — [KF128-5.08-2P-AA](https://www.flux.ai/lcsc/kf128-5p08-2p-aa~0pbi.md)
- Connector Pitch: 5.08mm
- Operating Temperature: -40℃~+105℃
- JLCPCB Part Class: Extended Part
- LCSC Part Number: C474952
- Connector Gender: Female
- Current Rating: 24A
- Package or Case Code: CONN-TH_P5.08_KF128-5.08-2P
- Product Info Url: https://lcsc.com/product-detail/New-Quadratic-Unclassified-Data_Cixi-Kefa-Elec-KF128-5-08-2P_C474952.html
- Connector Positions: 2
- Manufacturer Name: KEFA(科发)
- Connector Type: Screw terminal
- Manufacturer Part Number: KF128-5.08-2P-AA
- Role Details: 5.08mm 2-pin screw terminal
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/lcsc/2408211511_Cixi-Kefa-Elec-KF128-5-08-2P-AA_C474952.pdf
- Connector Rows: 1
- Part Type: Screw terminal
- Role: Connector
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
### J4 — [KF128-5.08-2P-AA](https://www.flux.ai/lcsc/kf128-5p08-2p-aa~0pbi.md)
- Part Type: Screw terminal
- Role: Connector
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/lcsc/2408211511_Cixi-Kefa-Elec-KF128-5-08-2P-AA_C474952.pdf
- Connector Rows: 1
- Role Details: 5.08mm 2-pin screw terminal
- JLCPCB Part Class: Extended Part
- Operating Temperature: -40℃~+105℃
- Current Rating: 24A
- Connector Gender: Female
- Package or Case Code: CONN-TH_P5.08_KF128-5.08-2P
- LCSC Part Number: C474952
- Connector Pitch: 5.08mm
- Connector Type: Screw terminal
- Manufacturer Part Number: KF128-5.08-2P-AA
- Manufacturer Name: KEFA(科发)
- Product Info Url: https://lcsc.com/product-detail/New-Quadratic-Unclassified-Data_Cixi-Kefa-Elec-KF128-5-08-2P_C474952.html
- Connector Positions: 2
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
### J5 — [KF128-5.08-2P-AA](https://www.flux.ai/lcsc/kf128-5p08-2p-aa~0pbi.md)
- Operating Temperature: -40℃~+105℃
- JLCPCB Part Class: Extended Part
- Package or Case Code: CONN-TH_P5.08_KF128-5.08-2P
- Connector Gender: Female
- Current Rating: 24A
- LCSC Part Number: C474952
- Role Details: 5.08mm 2-pin screw terminal
- Connector Pitch: 5.08mm
- Manufacturer Part Number: KF128-5.08-2P-AA
- Connector Type: Screw terminal
- Manufacturer Name: KEFA(科发)
- Connector Positions: 2
- Product Info Url: https://lcsc.com/product-detail/New-Quadratic-Unclassified-Data_Cixi-Kefa-Elec-KF128-5-08-2P_C474952.html
- Part Type: Screw terminal
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/lcsc/2408211511_Cixi-Kefa-Elec-KF128-5-08-2P-AA_C474952.pdf
- Connector Rows: 1
- Role: Connector
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
### J6 — [KF128-5.08-2P-AA](https://www.flux.ai/lcsc/kf128-5p08-2p-aa~0pbi.md)
- Role Details: 5.08mm 2-pin screw terminal
- Role: Connector
- Connector Rows: 1
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/lcsc/2408211511_Cixi-Kefa-Elec-KF128-5-08-2P-AA_C474952.pdf
- Part Type: Screw terminal
- Connector Positions: 2
- Product Info Url: https://lcsc.com/product-detail/New-Quadratic-Unclassified-Data_Cixi-Kefa-Elec-KF128-5-08-2P_C474952.html
- Connector Type: Screw terminal
- Manufacturer Part Number: KF128-5.08-2P-AA
- Manufacturer Name: KEFA(科发)
- Connector Pitch: 5.08mm
- Package or Case Code: CONN-TH_P5.08_KF128-5.08-2P
- Current Rating: 24A
- Connector Gender: Female
- LCSC Part Number: C474952
- JLCPCB Part Class: Extended Part
- Operating Temperature: -40℃~+105℃
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
### J7 — [Pin Header 01x06 2.54mm PROGRAMMING CONNECTOR](https://www.flux.ai/zalak201285/pin-header-01x06-2p54mm-programming-connector~ji.md)
- Manufacturer Name: 61300611121
- License: https://creativecommons.org/licenses/by/4.0/
- Role Details: ESP32 UART boot/programming access
- Part Type: Connector
- Role: Programming Header
- Manufacturer Part Number: Wurth Elektronik
**Pins:**
- JTCK [pin 2]
- JTDI [pin 1]
- JTDO [pin 3]
- JTMS [pin 4]
- NJTRST [pin 5]
- RESET [pin 6]
### Q1 — [AO3400A](https://www.flux.ai/adrian95/ao3400a~ug9.md)
- Datasheet URL: https://media.digikey.com/pdf/Data%20Sheets/Alpha%20&%20Omega/AO3400A_ds.pdf
- Part Type: Transistor
- Role: Low-side Switch
- License: https://creativecommons.org/licenses/by/4.0/
- Manufacturer Part Number: AO3400A
- Role Details: N-channel MOSFET switch for lock output
- Manufacturer Name: Alpha & Omega Semiconductor Inc.
**Pins:**
- D [pin 3]
- G [pin 1]
- S [pin 2]
### Q2 — [AO3400A](https://www.flux.ai/adrian95/ao3400a~ug9.md)
- Role Details: N-channel MOSFET switch for lock output
- Part Type: Transistor
- Datasheet URL: https://media.digikey.com/pdf/Data%20Sheets/Alpha%20&%20Omega/AO3400A_ds.pdf
- Manufacturer Name: Alpha & Omega Semiconductor Inc.
- License: https://creativecommons.org/licenses/by/4.0/
- Role: Low-side Switch
- Manufacturer Part Number: AO3400A
**Pins:**
- D [pin 3]
- G [pin 1]
- S [pin 2]
### Q3 — [AO3400A](https://www.flux.ai/adrian95/ao3400a~ug9.md)
- Role Details: N-channel MOSFET switch for lock output
- Datasheet URL: https://media.digikey.com/pdf/Data%20Sheets/Alpha%20&%20Omega/AO3400A_ds.pdf
- Part Type: Transistor
- Manufacturer Name: Alpha & Omega Semiconductor Inc.
- License: https://creativecommons.org/licenses/by/4.0/
- Manufacturer Part Number: AO3400A
- Role: Low-side Switch
**Pins:**
- D [pin 3]
- G [pin 1]
- S [pin 2]
### Q4 — [AO3400A](https://www.flux.ai/adrian95/ao3400a~ug9.md)
- Datasheet URL: https://media.digikey.com/pdf/Data%20Sheets/Alpha%20&%20Omega/AO3400A_ds.pdf
- Part Type: Transistor
- Role: Low-side Switch
- Role Details: N-channel MOSFET switch for lock output
- Manufacturer Part Number: AO3400A
- License: https://creativecommons.org/licenses/by/4.0/
- Manufacturer Name: Alpha & Omega Semiconductor Inc.
**Pins:**
- D [pin 3]
- G [pin 1]
- S [pin 2]
### U1 — [ESP32-WROOM-32E](https://www.flux.ai/vasyl/esp32-wroom-32e~epi.md)
- Part Type: Integrated Circuit
- Datasheet URL: https://www.espressif.com/sites/default/files/documentation/esp32-wroom-32_datasheet_en.pdf
- License: https://creativecommons.org/licenses/by/4.0/
- Manufacturer Part Number: ESP32-WROOM-32
- Capacitor 1: 100 nF, 25 V, 1206 package x2 (Ceramic)
- Capacitor 2: 10 µF, 16 V, 1206 package (Ceramic)
- Resistor: 10 kΩ, 1206 package (Chip SMD)
- Role: MCU
- Role Details: ESP32 controller for 4 isolated MOSFET lock outputs
- Manufacturer Name: Espressif Systems
- Symbol Style: parametric-v1
**Pins:**
- EN [pin 3]
- GND [pin 38]
- GND [pin 39]
- GND [pin 15]
- GND [pin 1]
- IO0 [pin 25]
- IO12 [pin 14]
- IO13 [pin 16]
- IO14 [pin 13]
- IO15 [pin 23]
- IO16 [pin 27]
- IO17 [pin 28]
- IO18 [pin 30]
- IO19 [pin 31]
- IO2 [pin 24]
- IO21 [pin 33]
- IO22 [pin 36]
- IO23 [pin 37]
- IO25 [pin 10]
- IO26 [pin 11]
- IO27 [pin 12]
- IO32 [pin 8]
- IO33 [pin 9]
- IO34 [pin 6]
- IO35 [pin 7]
- IO4 [pin 26]
- IO5 [pin 29]
- NC [pin 32]
- RXD0/IO3 [pin 34]
- SCK/CLK [pin 20]
- SCS/CMD [pin 19]
- SDI/SD1 [pin 22]
- SDO/SD0 [pin 21]
- SENSOR_VN [pin 5]
- SENSOR_VP [pin 4]
- SHD/SD2 [pin 17]
- SWP/SD3 [pin 18]
- TXD0/IO1 [pin 35]
- VDD [pin 2]
### U2 — [PC817X2NSZ9F](https://www.flux.ai/lcsc/pc817x2nsz9f~p27u.md)
- Manufacturer Name: SHARP(夏普)
- LCSC Part Number: C390734
- Part Type: Optocouplers - Phototransistor Output
- Package or Case Code: DIP-4_L6.4-W4.6-P2.54-LS7.6-BL
- Role Details: GPIO-to-MOSFET gate optocoupler
- Role: Isolation
- Datasheet URL: https://www.lcsc.com/datasheet/lcsc_datasheet_1912111437_Sharp-Microelectronics-PC817X2NSZ9F_C390734.pdf
- Product Info Url: https://lcsc.com/product-detail/DIP-Optocouplers_Sharp-Microelectronics-PC817X2NSZ9F_C390734.html
- Manufacturer Part Number: PC817X2NSZ9F
- JLCPCB Part Class: Extended Part
**Pins:**
- Anode [pin 1]
- Cathode [pin 2]
- Collector [pin 4]
- Emitter [pin 3]
### U3 — [PC817X2NSZ9F](https://www.flux.ai/lcsc/pc817x2nsz9f~p27u.md)
- Role Details: GPIO-to-MOSFET gate optocoupler
- LCSC Part Number: C390734
- Manufacturer Name: SHARP(夏普)
- Package or Case Code: DIP-4_L6.4-W4.6-P2.54-LS7.6-BL
- Part Type: Optocouplers - Phototransistor Output
- Datasheet URL: https://www.lcsc.com/datasheet/lcsc_datasheet_1912111437_Sharp-Microelectronics-PC817X2NSZ9F_C390734.pdf
- Role: Isolation
- Product Info Url: https://lcsc.com/product-detail/DIP-Optocouplers_Sharp-Microelectronics-PC817X2NSZ9F_C390734.html
- Manufacturer Part Number: PC817X2NSZ9F
- JLCPCB Part Class: Extended Part
**Pins:**
- Anode [pin 1]
- Cathode [pin 2]
- Collector [pin 4]
- Emitter [pin 3]
### U4 — [PC817X2NSZ9F](https://www.flux.ai/lcsc/pc817x2nsz9f~p27u.md)
- Manufacturer Name: SHARP(夏普)
- LCSC Part Number: C390734
- Part Type: Optocouplers - Phototransistor Output
- Package or Case Code: DIP-4_L6.4-W4.6-P2.54-LS7.6-BL
- Datasheet URL: https://www.lcsc.com/datasheet/lcsc_datasheet_1912111437_Sharp-Microelectronics-PC817X2NSZ9F_C390734.pdf
- Role: Isolation
- Role Details: GPIO-to-MOSFET gate optocoupler
- Manufacturer Part Number: PC817X2NSZ9F
- Product Info Url: https://lcsc.com/product-detail/DIP-Optocouplers_Sharp-Microelectronics-PC817X2NSZ9F_C390734.html
- JLCPCB Part Class: Extended Part
**Pins:**
- Anode [pin 1]
- Cathode [pin 2]
- Collector [pin 4]
- Emitter [pin 3]
### U5 — [PC817X2NSZ9F](https://www.flux.ai/lcsc/pc817x2nsz9f~p27u.md)
- Role Details: GPIO-to-MOSFET gate optocoupler
- JLCPCB Part Class: Extended Part
- Product Info Url: https://lcsc.com/product-detail/DIP-Optocouplers_Sharp-Microelectronics-PC817X2NSZ9F_C390734.html
- Manufacturer Part Number: PC817X2NSZ9F
- Datasheet URL: https://www.lcsc.com/datasheet/lcsc_datasheet_1912111437_Sharp-Microelectronics-PC817X2NSZ9F_C390734.pdf
- Package or Case Code: DIP-4_L6.4-W4.6-P2.54-LS7.6-BL
- Part Type: Optocouplers - Phototransistor Output
- LCSC Part Number: C390734
- Role: Isolation
- Manufacturer Name: SHARP(夏普)
**Pins:**
- Anode [pin 1]
- Cathode [pin 2]
- Collector [pin 4]
- Emitter [pin 3]
### U6 — [TPS563201DDCR](https://www.flux.ai/lcsc/tps563201ddcr~ro0w.md)
- Part Type: DC-DC Converters
- JLCPCB Part Class: Extended Part
- Product Info Url: https://lcsc.com/product-detail/DC-DC-Converters_TI_TPS563201DDCR_TPS563201DDCR_C116592.html
- Manufacturer Name: TI(德州仪器)
- Role: Power Conversion
- Package or Case Code: SOT-23-6_L2.9-W1.6-P0.95-LS2.8-BR
- Role Details: TPS563201 buck converts protected VIN to 3V3 for ESP32/opto input side
- Manufacturer Part Number: TPS563201DDCR
- LCSC Part Number: C116592
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/lcsc/2304241919_Texas-Instruments-TPS563201DDCR_C116592.pdf
**Pins:**
- EN [pin 5]
- GND [pin 1]
- SW [pin 2]
- VBST [pin 6]
- VFB [pin 4]
- VIN [pin 3]
*The full schematic, PCB layout, bill of materials, and interactive design are available at [https://www.flux.ai/lamtd/esp32-4-channel-lock-driver~wo](https://www.flux.ai/lamtd/esp32-4-channel-lock-driver~wo).*
---
*Generated from [https://www.flux.ai/lamtd/esp32-4-channel-lock-driver~wo](https://www.flux.ai/lamtd/esp32-4-channel-lock-driver~wo)*