# ESP32 Door Access Controller ## Description ESP32-S3 door access controller with USB-C Li-ion charging, VBAT and 12V lock power, dual 3.3V rails, I2C sensor headers, reed/PIR inputs, LED indicators, buzzer, and MOSFET plus relay lock outputs. External modules and field devices remain represented by connector placeholders with documented pinouts for later PCB and validation work. ## Project Details - **Owner:** hyrunk - **Created:** 4/5/2026 - **Last Updated:** 4/6/2026 - **Visibility:** Public - **Implementation Details:** Assumptions used during wiring: TP4056 module VIN pin was treated as the USB-C 5V charger input and its battery output was exported as VBAT; the existing TP4056 symbol did not expose separate OUT+ and OUT- pins, so VBAT was derived from the available battery-side output representation. The buzzer was wired using the simpler direct-drive option from the provided specification because only one IRLZ44N MOSFET and one added 2N2222 driver were allocated to lock and relay drive stages. Existing placeholder connector representations were preserved and assigned explicit pin functions: J2 PN532 uses I2C, J3 AM312 is VCC/OUT/GND, J4 reed switch is REED_SENSE/GND, J5 BH1750 ties ADDR low with a second ground pin, and J6 is 12V plus STRIKE_NEG. Solenoid lock output remains represented by the relay contact net SOLENOID_POS and requires a dedicated external field connector if separate from the electric strike connector. The current ESP32-S3 CAM module symbol exposes a single 3V3 pin rather than separate VDD pins, so all digital decoupling was tied to that available 3V3 rail pin. - **System Architecture:** ```mermaid flowchart TD PWR[Power Inputs and Battery] CTRL[ESP32-S3 CAM Controller] NFC[PN532 NFC Interface] LIGHT[BH1750 Light Sensor] MOTION[AM312 PIR Sensor] DOOR[Door Sensors and Actuators] IOPLACE[External Module Placeholders] PWR --> CTRL CTRL --> NFC CTRL --> LIGHT CTRL --> MOTION CTRL --> DOOR NFC --> IOPLACE LIGHT --> IOPLACE MOTION --> IOPLACE DOOR --> IOPLACE ``` - **Forks:** 1 ## Key Components ### BT1 18650 — [BH-18650-B1BA002](https://www.flux.ai/markwuflux/bh-18650-b1ba002~i9.md) - Manufacturer Part Number: BH-18650-B1BA002 - DPN: C2988620 - Datasheet URL: https://datasheet.lcsc.com/lcsc/2204021730_MYOUNG-BH-18650-B1BA002_C2988620.pdf - Package: Battery Holder - Role: Battery - Manufacturer Name: ASE Technology Holding Co. Ltd. (ASX) - Role Details: Single 18650 cell holder for system battery input. - Implementation Details: Real 18650 holder footprint. Final battery protection and power-path wiring deferred. **Pins:** - - [pin 2] - + [pin 1] ### BZ1 — [PS1440P02BT](https://www.flux.ai/jecstronic/ps1440p02bt~778.md) - Manufacturer Name: TDK Corporation - License: https://creativecommons.org/licenses/by/4.0/ - Datasheet URL: https://product.tdk.com/en/system/files?file=dam/doc/product/sw_piezo/sw_piezo/piezo-buzzer/catalog/piezoelectronic_buzzer_ps_en.pdf - Part Type: Buzzer - Role Details: Direct-driven buzzer placeholder wired per alternate simple buzzer option: GPIO4 through series resistor to buzzer positive, return to 3V3_D. - Manufacturer Part Number: PS1440P02BT - Role: Buzzer **Pins:** - - [pin 2] - + [pin 1] ### D2 — [LED THT](https://www.flux.ai/jharwinbarrozo/led-tht~gr.md) - Series Resistance: 0.42Ω - Emission Coefficient: 3.73 - Forward Voltage: 1.70 - Saturation Current: 93.2e-12A - Breakdown Voltage: 0V **Pins:** - A [pin 2] - K [pin 1] ### D3 — [LED THT](https://www.flux.ai/jharwinbarrozo/led-tht~gr.md) - Emission Coefficient: 3.73 - Series Resistance: 0.42Ω - Breakdown Voltage: 0V - Saturation Current: 93.2e-12A - Forward Voltage: 1.70 **Pins:** - A [pin 2] - K [pin 1] ### D4 — [LED THT](https://www.flux.ai/jharwinbarrozo/led-tht~gr.md) - Saturation Current: 93.2e-12A - Forward Voltage: 1.70 - Breakdown Voltage: 0V - Series Resistance: 0.42Ω - Emission Coefficient: 3.73 **Pins:** - A [pin 2] - K [pin 1] ### D5 — [1N4007W](https://www.flux.ai/vasy_skral/1n4007w~xpy.md) - Manufacturer Part Number: 1N4007W - Manufacturer Name: Shandong Jingdao Microelectronics - Role Details: Flyback diode across electric strike terminals. - Package: SOD-123FL - License: https://creativecommons.org/licenses/by/4.0/ - Role: Flyback Protection - Part Type: Diode - Datasheet URL: https://www.evvosemi.com/Uploads/file/20240515/2024051515581665.pdf **Pins:** - A [pin 2] - K [pin 1] ### D6 — [1N4007W](https://www.flux.ai/vasy_skral/1n4007w~xpy.md) - Datasheet URL: https://www.evvosemi.com/Uploads/file/20240515/2024051515581665.pdf - Package: SOD-123FL - Role Details: Flyback diode across relay coil terminals. - Role: Flyback Protection - Part Type: Diode - License: https://creativecommons.org/licenses/by/4.0/ - Manufacturer Name: Shandong Jingdao Microelectronics - Manufacturer Part Number: 1N4007W **Pins:** - A [pin 2] - K [pin 1] ### J10 ESP32 AUX3 — [Pin Header 01x04 2.54mm Vertical i2c](https://www.flux.ai/hasanbasri93/pin-header-01x04-2p54mm-vertical-i2c~37.md) - Package: 1x4 2.54mm Header - Part Type: Connector - License: https://creativecommons.org/licenses/by/4.0/ - Role: Expansion Placeholder - Role Details: Auxiliary expansion header carrying unused ESP32 GPIOs with defined parking network. **Pins:** - 5V [pin 1] - GND [pin 2] - SCL [pin 4] - SDA [pin 3] ### J11 ESP32 AUX4 — [Pin Header 01x04 2.54mm Vertical i2c](https://www.flux.ai/hasanbasri93/pin-header-01x04-2p54mm-vertical-i2c~37.md) - License: https://creativecommons.org/licenses/by/4.0/ - Role Details: Auxiliary expansion header carrying unused ESP32 GPIOs with defined parking network. - Package: 1x4 2.54mm Header - Role: Expansion Placeholder - Part Type: Connector **Pins:** - 5V [pin 1] - GND [pin 2] - SCL [pin 4] - SDA [pin 3] ### J12 ESP32 AUX5 — [Pin Header 01x04 2.54mm Vertical i2c](https://www.flux.ai/hasanbasri93/pin-header-01x04-2p54mm-vertical-i2c~37.md) - Part Type: Connector - Package: 1x4 2.54mm Header - Role Details: Auxiliary expansion header carrying unused ESP32 GPIOs with defined parking network. - Role: Expansion Placeholder - License: https://creativecommons.org/licenses/by/4.0/ **Pins:** - 5V [pin 1] - GND [pin 2] - SCL [pin 4] - SDA [pin 3] ### J13 ESP32 AUX6 — [Pin Header 01x04 2.54mm Vertical i2c](https://www.flux.ai/hasanbasri93/pin-header-01x04-2p54mm-vertical-i2c~37.md) - Role Details: Auxiliary expansion header carrying unused ESP32 GPIOs with defined parking network. - Part Type: Connector - License: https://creativecommons.org/licenses/by/4.0/ - Package: 1x4 2.54mm Header - Role: Expansion Placeholder **Pins:** - 5V [pin 1] - GND [pin 2] - SCL [pin 4] - SDA [pin 3] ### J2 PN532 — [Pin Header 01x04 2.54mm Vertical i2c](https://www.flux.ai/hasanbasri93/pin-header-01x04-2p54mm-vertical-i2c~37.md) - License: https://creativecommons.org/licenses/by/4.0/ - Part Type: Connector - Role: External Module Placeholder - Package: 1x4 2.54mm Header - Role Details: PN532 I2C placeholder header. Pin 1 = 3V3_A, pin 2 = GND, pin 3 = I2C_SDA, pin 4 = I2C_SCL. **Pins:** - 5V [pin 1] - GND [pin 2] - SCL [pin 4] - SDA [pin 3] ### J3 AM312 — [PCC03SAAN](https://www.flux.ai/adrian95/pcc03saan~2t5.md) - Implementation Details: Placeholder for AM312 PIR module. Later map to VCC, OUT, and GND. - Part Type: HDRV3W64P0X254_1X3_762X254X838P - Manufacturer Part Number: PCC03SAAN - Datasheet URL: https://s3.amazonaws.com/catalogspreads-pdf/PAGE112-113%20.100%20MALE%20HDR.pdf - Connector Positions: 3 - Package: 1x3 2.54mm Header - Role Details: AM312 placeholder header. Pin 1 = 3V3_A, pin 2 = GPIO14 PIR output, pin 3 = GND. - Connector Type: Male Header - Package or Case Code: HDRV3W64P0X254_1X3_762X254X838P - Connector Pitch: 2.54mm - Role: External Module Placeholder - Manufacturer Name: Sullins **Pins:** - 1 [pin 1] - 2 [pin 2] - 3 [pin 3] ### J4 Reed Switch — [2-Position Screw Terminal](https://www.flux.ai/corynrobinson/2-position-screw-terminal~s4.md) - Role: Field Device Placeholder - Manufacturer Name: Würth Elektrik - Manufacturer Part Number: 691137710002 - Connector Pitch: 5.0mm - Datasheet URL: https://www.we-online.com/katalog/datasheet/691137710002.pdf - Connector Positions: 2 - Connector Type: Screw Terminal - Role Details: MC-38 NC reed switch connector. Pin 1 = REED_SENSE, pin 2 = GND. - Package: 2-Pin Terminal Block - Implementation Details: Placeholder for MC-38 NC reed switch field wiring. Later connect as the door-state sensing interface. - Part Type: Connector **Pins:** - P1 [pin 1] - P2 [pin 2] ### J5 BH1750 — [640456-6](https://www.flux.ai/adrian95/640456-6~oy5.md) - Manufacturer Name: TE Connectivity AMP Connectors - Manufacturer Part Number: 640456-6 - Part Type: Connector - Package or Case Code: SHDR6W66P0X254_1X6_1524X572X1003P - License: https://creativecommons.org/licenses/by/4.0/ - Datasheet URL: https://www.te.com/usa-en/product-640456-6.datasheet.pdf - Role Details: BH1750 placeholder connector. Pin 1 = 3V3_A, pin 2 = GND, pin 3 = I2C_SCL, pin 4 = I2C_SDA, pin 5 = GND for ADDR low, pin 6 reserved and tied low. - Package: 1x6 2.54mm Header - Role: External Module Placeholder **Pins:** - 1 [pin 1] - 2 [pin 2] - 3 [pin 3] - 4 [pin 4] - 5 [pin 5] - 6 [pin 6] ### J6 Electric Strike — [DG503-5.08-02P-14-00A(H)](https://www.flux.ai/lcsc/dg503-5p08-02p-14-00ah~xfrv.md) - Implementation Details: Placeholder for electric strike or solenoid lock field wiring. Later connect pins 1-2 to the chosen lock drive stage and final protection network. - Manufacturer Part Number: DG503-5.08-02P-14-00A(H) - Manufacturer Name: DEGSON(高正/高松) - Connector Pitch: 5.08mm - Connector Positions: 2 - JLCPCB Part Class: Extended Part - Package: 2-Pin 5.08mm Terminal Block - Role: Field Device Placeholder - Part Type: Screw terminal - LCSC Part Number: C2858320 - Role Details: 2-pin field connector used for electric strike output: pin 1 = 12V, pin 2 = STRIKE_NEG switched by Q1 IRLZ44N. - Package or Case Code: CONN-TH_DG503-5.08-02P-14-00A - Connector Type: Terminal Block **Pins:** - 1 [pin 1] - 2 [pin 2] ### J7 USB-C — [Type-C-2.0-6Pin](https://www.flux.ai/jharwinbarrozo/type-c-2p0-6pin~wh.md) - Part Type: Connector - Manufacturer Name: CIKI - Manufacturer Part Number: Type-C-2.0-6Pin - Package: USB-C Power Only - Role: USB-C Power Input - Role Details: USB Type-C power-only connector feeding TP4056 VIN with CC1 and CC2 pull-down resistors to GND. - Datasheet URL: https://datasheet.lcsc.com/lcsc/2204071830_CIKI-Type-C-2-0-6Pin_C2987385.pdf **Pins:** - CC1 - CC2 - GND - GND__1 - SHIELD - SHIELD__1 - SHIELD__2 - SHIELD__3 - V-BUS - V-BUS__1 ### J8 ESP32 AUX1 — [Pin Header 01x04 2.54mm Vertical i2c](https://www.flux.ai/hasanbasri93/pin-header-01x04-2p54mm-vertical-i2c~37.md) - Role Details: Auxiliary expansion header carrying unused ESP32 GPIOs with defined parking network. - Part Type: Connector - Role: Expansion Placeholder - Package: 1x4 2.54mm Header - License: https://creativecommons.org/licenses/by/4.0/ **Pins:** - 5V [pin 1] - GND [pin 2] - SCL [pin 4] - SDA [pin 3] ### J9 ESP32 AUX2 — [Pin Header 01x04 2.54mm Vertical i2c](https://www.flux.ai/hasanbasri93/pin-header-01x04-2p54mm-vertical-i2c~37.md) - Part Type: Connector - Package: 1x4 2.54mm Header - License: https://creativecommons.org/licenses/by/4.0/ - Role Details: Auxiliary expansion header carrying unused ESP32 GPIOs with defined parking network. - Role: Expansion Placeholder **Pins:** - 5V [pin 1] - GND [pin 2] - SCL [pin 4] - SDA [pin 3] ### K1 Relay — [SRD-05VDC-SL-C](https://www.flux.ai/vasy_skral/srd-05vdc-sl-c~go1.md) - Implementation Details: Library-backed relay option included at placement stage. Final coil drive, flyback, and contact wiring deferred. - Manufacturer Part Number: SRD-05VDC-SL-C - Manufacturer Name: Ningbo Songle Relay - Datasheet URL: https://www.circuitbasics.com/wp-content/uploads/2015/11/SRD-05VDC-SL-C-Datasheet.pdf - Role: Relay - Part Type: Relay - Role Details: 5V relay placeholder for lock or auxiliary load switching. - Package: Relay THT **Pins:** - A1 [pin A1] - A2 [pin A2] - COM [pin COM] - NC [pin NC] - NO [pin NO] ### Q1 IRLZ44N — [IRLZ44NPBF](https://www.flux.ai/jecstronic/irlz44npbf~kg9.md) - Datasheet URL: https://www.mouser.com/datasheet/2/196/Infineon_IRLZ44N_DataSheet_v01_01_EN-3363447.pdf - Manufacturer Name: Infineon Technologies - Package: TO-220 - Role Details: Power MOSFET placeholder for electric strike or lock drive stage. - Manufacturer Part Number: IRLZ44NPBF - Implementation Details: Library-backed MOSFET option included at placement stage. Final gate drive, source return, and load wiring deferred. - Role: Load Switch - License: https://creativecommons.org/licenses/by/4.0/ - Part Type: Transistor **Pins:** - D [pin 2] - G [pin 1] - S [pin 3] ### Q3 2N2222 — [2N2222AUB](https://www.flux.ai/jecstronic/2n2222aub~0jf.md) - Datasheet URL: https://www.ttelectronics.com/TTElectronics/media/ProductFiles/Datasheet/2N2222AUB.pdf - License: https://creativecommons.org/licenses/by/4.0/ - Part Type: Transistor - Package: SMD - Role Details: Low-side NPN transistor used to switch relay coil current from ESP32 GPIO17. - Role: Relay Driver - Manufacturer Part Number: 2N2222AUB - Manufacturer Name: TT Electronics/Optek Technology **Pins:** - B [pin 1] - C [pin 2] - E [pin 3] ### U1 ESP32-S3 — [ESP-32 S3 Cam module](https://www.flux.ai/adrian95/esp-32-s3-cam-module~psj.md) - Package: Module - Part Type: Module - Purchase Url: https://www.aliexpress.com/item/1005007652172433.html?aff_fcid=649a71dd0ef54508842088231bfb00ac-1769498921531-02630-_c3qOT5g3&tt=CPS_NORMAL&aff_fsk=_c3qOT5g3&aff_platform=shareComponent-detail&sk=_c3qOT5g3&aff_trace_key=649a71dd0ef54508842088231bfb00ac-1769498921531-02630-_c3qOT5g3&terminal_id=141523ca2a0f4e3eb3d6c90167c47a63&afSmartRedirect=y - Role Details: Primary ESP32-S3 controller/camera module for the door access system. - License: https://creativecommons.org/licenses/by/4.0/ - Implementation Details: Only the GPIOs required by the current access-control design are wired. Remaining GPIO pins on the module symbol are intentionally left available for future expansion. The module 5V pin is left unconnected because this design powers the module from its 3V3 input rail. - Role: Controller **Pins:** - 3V3 - 5V - GND - GPIO0 - GPIO1 - GPIO10 - GPIO11 - GPIO12 - GPIO13 - GPIO14 - GPIO15 - GPIO16 - GPIO17 - GPIO18 - GPIO19 - GPIO2 - GPIO20 - GPIO21 - GPIO3 - GPIO35 - GPIO36 - GPIO37 - GPIO38 - GPIO39 - GPIO4 - GPIO40 - GPIO41 - GPIO42 - GPIO43 - GPIO44 - GPIO45 - GPIO46 - GPIO47 - GPIO48 - GPIO5 - GPIO6 - GPIO7 - GPIO8 - GPIO9 - RST ### U3 AMS1117-3.3 — [AMS1117-3.3](https://www.flux.ai/vasy_skral/ams1117-33~34.md) - Package: SOT-223 - Symbol Style: Parametric - Role Details: 3.3V LDO regulator for local rail generation if needed. - Manufacturer Name: AMS - Datasheet URL: http://www.advanced-monolithic.com/pdf/ds1117.pdf - License: https://creativecommons.org/licenses/by/4.0/ - Part Type: Integrated Circuit - Manufacturer Part Number: AMS1117-3.3 - Role: Regulator **Pins:** - GND [pin 1] - TAB(VOUT) [pin 4] - VIN [pin 3] - VOUT [pin 2] ### U4 AMS1117-3.3 — [AMS1117-3.3](https://www.flux.ai/vasy_skral/ams1117-33~34.md) - License: https://creativecommons.org/licenses/by/4.0/ - Part Type: Integrated Circuit - Role: Regulator - Manufacturer Part Number: AMS1117-3.3 - Role Details: Second 3.3V LDO regulator generating 3V3_D from 12V for ESP32 digital power. - Package: SOT-223 - Symbol Style: Parametric - Manufacturer Name: AMS - Datasheet URL: http://www.advanced-monolithic.com/pdf/ds1117.pdf **Pins:** - GND [pin 1] - TAB(VOUT) [pin 4] - VIN [pin 3] - VOUT [pin 2] *The full schematic, PCB layout, bill of materials, and interactive design are available at [https://www.flux.ai/hyrunk/esp32-door-access-controller~jm](https://www.flux.ai/hyrunk/esp32-door-access-controller~jm).* --- *Generated from [https://www.flux.ai/hyrunk/esp32-door-access-controller~jm](https://www.flux.ai/hyrunk/esp32-door-access-controller~jm)*