# RAKSHAK Railway Crossing Safety System
## Description
STM32F401 Blackpill-style railway crossing safety controller with dual 12V input selection, LM2596 5V buck, AMS1117-3.3 MCU rail, horn relay driver, and edge-mounted off-board sensor, servo, and UART connectors for modular prototyping.
## Project Details
- **Owner:** ompatil13
- **Created:** 4/7/2026
- **Last Updated:** 4/7/2026
- **Visibility:** Public
## Key Components
### D1 — [SS14FP](https://www.flux.ai/lcsc/ss14fp.md)
- Role Details: Series Schottky diode protecting the selected 12V input rail
- Package or Case Code: POWERDI-123_L2.8-W1.8-LS3.7-RD-1
- Manufacturer Part Number: SS14FP
- JLCPCB Part Class: Extended Part
- Package: POWERDI-123
- Role: Reverse polarity diode
- LCSC Part Number: C894423
- Manufacturer Name: onsemi(安森美)
**Pins:**
- A [pin 2]
- K [pin 1]
### D2 — [1N4007](https://www.flux.ai/adrian95/1n4007.md)
- Manufacturer Part Number: 1N4007
- Package: DO-41
- Role: Relay flyback diode
- Manufacturer Name: Yangjie Technology
- License: https://creativecommons.org/licenses/by/4.0/
- Datasheet URL: https://diotec.com/tl_files/diotec/files/pdf/datasheets/1n4001.pdf
- Role Details: Flyback clamp across horn relay coil
- Part Type: Diode
**Pins:**
- anode [pin 2]
- cathode [pin 1]
### J1 — [Barrel_Jack_Switch_SMT_FC681465S](https://www.flux.ai/jecstronic/barreljackswitchsmtfc681465s.md)
- Manufacturer Name: CLIFF Electronic Components Ltd
- Role: Primary DC input
- Manufacturer Part Number: FC681465S
- Role Details: 2.1mm barrel jack for external 12V adapter input
- License: https://creativecommons.org/licenses/by/4.0/
- Part Type: Connector
- Datasheet URL: https://www.cliffuk.co.uk/products/dcconnectors/DualDCSockets.pdf
- Package: Barrel jack
**Pins:**
- 1 [pin 4]
- 1 [pin 1]
- 2 [pin 2]
- 3 [pin 3]
### J10 — [FTSH-103-01-L-D](https://www.flux.ai/adrian95/ftsh-103-01-l-d.md)
- Part Type: Connector
- Package: 2x3 1.27mm TH
- Role Details: 2x3 ARM SWD header for programming and debug access
- License: https://creativecommons.org/licenses/by/4.0/
- Manufacturer Part Number: FTSH-103-01-L-D
- Manufacturer Name: Samtec
- Implementation Details: Pin 1=VTref 3.3V, Pin 3=NRST, Pins 4 and 5=GND, Pin 6=SWO; SWDIO and SWCLK require confirmation against the Blackpill module symbol
- Datasheet URL: https://suddendocs.samtec.com/catalog_english/ftsh_th.pdf
- Role: SWD debug connector
**Pins:**
- 01 [pin 01]
- 02 [pin 02]
- 03 [pin 03]
- 04 [pin 04]
- 05 [pin 05]
- 06 [pin 06]
### J2 — [61300311021](https://www.flux.ai/adrian95/61300311021.md)
- License: https://creativecommons.org/licenses/by/4.0/
- Manufacturer Part Number: 61300311021
- Implementation Details: Pin 1=GND, Pin 2=5V, Pin 3=Ultrasonic sensor signal
- Datasheet URL: https://www.we-online.com/components/products/datasheet/61300311021.pdf
- Package or Case Code: HDRRA3W79P0X254_1X3_762X254X269P
- Manufacturer Name: Wurth Elektronik
- Role Details: HC-SR04 sensor header 1 with GND, 5V, signal pair support
- Part Type: Connector
- Role: Ultrasonic sensor connector
- Package: 1x3 2.54mm TH
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
- 3 [pin 3]
### J3 — [61300311021](https://www.flux.ai/adrian95/61300311021.md)
- Datasheet URL: https://www.we-online.com/components/products/datasheet/61300311021.pdf
- Manufacturer Part Number: 61300311021
- Implementation Details: Pin 1=GND, Pin 2=5V, Pin 3=Ultrasonic sensor signal
- Package: 1x3 2.54mm TH
- Role: Ultrasonic sensor connector
- License: https://creativecommons.org/licenses/by/4.0/
- Role Details: HC-SR04 sensor header 2 with GND, 5V, signal pair support
- Part Type: Connector
- Manufacturer Name: Wurth Elektronik
- Package or Case Code: HDRRA3W79P0X254_1X3_762X254X269P
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
- 3 [pin 3]
### J4 — [61300311021](https://www.flux.ai/adrian95/61300311021.md)
- License: https://creativecommons.org/licenses/by/4.0/
- Role: Microwave sensor connector
- Manufacturer Part Number: 61300311021
- Datasheet URL: https://www.we-online.com/components/products/datasheet/61300311021.pdf
- Role Details: HB100 radar sensor header 1 with GND, 5V, signal
- Package or Case Code: HDRRA3W79P0X254_1X3_762X254X269P
- Manufacturer Name: Wurth Elektronik
- Package: 1x3 2.54mm TH
- Part Type: Connector
- Implementation Details: Pin 1=GND, Pin 2=5V, Pin 3=Microwave sensor output
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
- 3 [pin 3]
### J5 — [61300311021](https://www.flux.ai/adrian95/61300311021.md)
- Datasheet URL: https://www.we-online.com/components/products/datasheet/61300311021.pdf
- Role Details: HB100 radar sensor header 2 with GND, 5V, signal
- Manufacturer Part Number: 61300311021
- Package: 1x3 2.54mm TH
- License: https://creativecommons.org/licenses/by/4.0/
- Implementation Details: Pin 1=GND, Pin 2=5V, Pin 3=Microwave sensor output
- Role: Microwave sensor connector
- Part Type: Connector
- Manufacturer Name: Wurth Elektronik
- Package or Case Code: HDRRA3W79P0X254_1X3_762X254X269P
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
- 3 [pin 3]
### J6 — [61300311021](https://www.flux.ai/adrian95/61300311021.md)
- Package or Case Code: HDRRA3W79P0X254_1X3_762X254X269P
- Implementation Details: Pin 1=GND, Pin 2=5V, Pin 3=IR sensor output
- Manufacturer Name: Wurth Elektronik
- Part Type: Connector
- Package: 1x3 2.54mm TH
- Role Details: IR sensor header 1 with GND, 5V, signal
- License: https://creativecommons.org/licenses/by/4.0/
- Manufacturer Part Number: 61300311021
- Datasheet URL: https://www.we-online.com/components/products/datasheet/61300311021.pdf
- Role: IR sensor connector
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
- 3 [pin 3]
### J7 — [61300311021](https://www.flux.ai/adrian95/61300311021.md)
- Role Details: IR sensor header 2 with GND, 5V, signal
- Package or Case Code: HDRRA3W79P0X254_1X3_762X254X269P
- Manufacturer Name: Wurth Elektronik
- Part Type: Connector
- Role: IR sensor connector
- Implementation Details: Pin 1=GND, Pin 2=5V, Pin 3=IR sensor output
- License: https://creativecommons.org/licenses/by/4.0/
- Package: 1x3 2.54mm TH
- Manufacturer Part Number: 61300311021
- Datasheet URL: https://www.we-online.com/components/products/datasheet/61300311021.pdf
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
- 3 [pin 3]
### J8 — [61300311021](https://www.flux.ai/adrian95/61300311021.md)
- Manufacturer Part Number: 61300311021
- Role Details: Servo header with GND, 5V, PWM control
- Datasheet URL: https://www.we-online.com/components/products/datasheet/61300311021.pdf
- License: https://creativecommons.org/licenses/by/4.0/
- Role: Servo connector
- Part Type: Connector
- Package: 1x3 2.54mm TH
- Package or Case Code: HDRRA3W79P0X254_1X3_762X254X269P
- Manufacturer Name: Wurth Elektronik
- Implementation Details: Pin 1=GND, Pin 2=5V, Pin 3=Servo PWM control
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
- 3 [pin 3]
### J9 — [PCC03SAAN](https://www.flux.ai/adrian95/pcc03saan.md)
- Manufacturer Name: Sullins
- Role Details: Pin order GND, TX out from board, RX into board
- Package or Case Code: HDRV3W64P0X254_1X3_762X254X838P
- Datasheet URL: https://s3.amazonaws.com/catalogspreads-pdf/PAGE112-113%20.100%20MALE%20HDR.pdf
- Role: UART debug connector
- Manufacturer Part Number: PCC03SAAN
- Implementation Details: Pin 1=GND, Pin 2=Board TX, Pin 3=Board RX
- Part Type: HDRV3W64P0X254_1X3_762X254X838P
- Package: 1x3 2.54mm TH
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
- 3 [pin 3]
### K1 — [SRD-05VDC-SL-C](https://www.flux.ai/jecstronic/srd-05vdc-sl-c.md)
- License: https://creativecommons.org/licenses/by/4.0/
- Datasheet URL: https://datasheet.lcsc.com/lcsc/1811021933_Ningbo-Songle-Relay-SRD-05VDC-SL-C_C35449.pdf
- Manufacturer Part Number: SRD-05VDC-SL-C
- Part Type: Relay
- Role Details: 5V coil SPDT relay switching horn supply
- Manufacturer Name: Ningbo Songle Relay
- Role: Horn relay
- Package: Relay THT
**Pins:**
- A1 [pin A1]
- A2 [pin A2]
- COM [pin COM]
- NC [pin NC]
- NO [pin NO]
### PS1 — [LM2596 DC-DC buck converter](https://www.flux.ai/vasy_skral/lm2596-dc-dc-buck-converter.md)
- License: https://creativecommons.org/licenses/by/4.0/
- Role: 5V regulator
- Package: Buck module
- Part Type: Integrated Circuit
- Role Details: LM2596 buck module generating 5V from protected 12V input
**Pins:**
- IN - [pin 2]
- IN + [pin 1]
- OUT - [pin 3]
- OUT + [pin 4]
### Q1 — [2N2222A](https://www.flux.ai/lcsc/2n2222a.md)
- Frequency: 250MHz
- Compliance: RoHS
- Manufacturer Part Number: 2N2222A
- Role: Relay driver transistor
- LCSC Part Number: C118536
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/lcsc/1809200018_ST-Semtech-2N2222A_C118536.pdf
- Manufacturer Name: ST(先科)
- Product Info Url: https://lcsc.com/product-detail/Transistors-NPN-PNP_2N2222_C118536.html
- JLCPCB Part Class: Extended Part
- Package: TO-92-3
- Package or Case Code: TO-92-3_L4.9-W3.7-P1.27-L
- Part Type: Transistors/Thyristors/Bipolar (BJT)
- Role Details: NPN transistor driving 5V relay coil from STM32 GPIO
- Transistor Type: NPN
**Pins:**
- B [pin 2]
- C [pin 3]
- E [pin 1]
### SW1 — [SS-12D07-VG 4 NS GA PA](https://www.flux.ai/adrian95/ss-12d07-vg-4-ns-ga-pa.md)
- Role Details: SPDT manual switch selecting one of two 12V sources
- License: https://creativecommons.org/licenses/by/4.0/
- Part Type: Switch
- Package: SPDT slide switch
- Datasheet URL: https://mm.digikey.com/Volume0/opasdata/d220001/medias/docus/580/SS-12D07-VG_GA_PA.pdf
- Manufacturer Part Number: SS12D07VG4NSGAPA
- Role: Input source select
- Manufacturer Name: C&K
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
- 3 [pin 3]
### U1 — [STM32F401CCU6](https://www.flux.ai/karolrojas/stm32f401ccu6.md)
- Role Details: STM32F401 Blackpill-style carrier footprint operating from 3.3V with fixed header pin mapping
- Datasheet URL: https://www.st.com/en/microcontrollers-microprocessors/stm32f411ce.html
- Manufacturer Part Number: STM32 Black Pill
- Manufacturer Name: ST-Microelectronics
- Part Type: Breakout board
- Package: Blackpill module
- Role: Main MCU module
**Pins:**
- 3V3
- 3V3
- 5V
- 5V
- GND
- GND
- NRST
- P37
- PA0
- PA1
- PA10
- PA11
- PA12
- PA15
- PA3
- PA4
- PA5
- PA6
- PA7
- PA8
- PA9
- PB0
- PB1
- PB10
- PB12 [pin 1]
- PB13
- PB14
- PB15
- PB2
- PB3
- PB4
- PB5
- PB6
- PB7
- PB8
- PB9
- PC13
- PC14
- PC15
- VBAT
### U2 — [AMS1117-3.3](https://www.flux.ai/vasy_skral/ams1117-33.md)
- Role Details: AMS1117 fixed 3.3V LDO from 5V rail for STM32 module
- License: https://creativecommons.org/licenses/by/4.0/
- Datasheet URL: http://www.advanced-monolithic.com/pdf/ds1117.pdf
- Role: 3.3V regulator
- Manufacturer Part Number: AMS1117-3.3
- Manufacturer Name: AMS
- Symbol Style: Parametric
- Package: SOT-223
- Part Type: Integrated Circuit
**Pins:**
- GND [pin 1]
- TAB(VOUT) [pin 4]
- VIN [pin 3]
- VOUT [pin 2]
### U3 — [KF128-5.08-2P-AA](https://www.flux.ai/lcsc/kf128-5p08-2p-aa.md)
- Part Type: Screw terminal
- Operating Temperature: -40℃~+105℃
- Package or Case Code: CONN-TH_P5.08_KF128-5.08-2P
- Role: 12V input terminal
- Role Details: Alternate 12V screw terminal input
- Connector Type: Screw terminal
- Product Info Url: https://lcsc.com/product-detail/New-Quadratic-Unclassified-Data_Cixi-Kefa-Elec-KF128-5-08-2P_C474952.html
- Connector Gender: Female
- Connector Positions: 2
- Manufacturer Part Number: KF128-5.08-2P-AA
- Manufacturer Name: KEFA(科发)
- Connector Rows: 1
- Current Rating: 24A
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/lcsc/2408211511_Cixi-Kefa-Elec-KF128-5-08-2P-AA_C474952.pdf
- Connector Pitch: 5.08mm
- LCSC Part Number: C474952
- JLCPCB Part Class: Extended Part
- Package: 5.08mm terminal block
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
### U4 — [KF128-5.08-2P-AA](https://www.flux.ai/lcsc/kf128-5p08-2p-aa.md)
- Operating Temperature: -40℃~+105℃
- Role Details: 2-pin screw terminal for horn load connection
- Part Type: Screw terminal
- Package or Case Code: CONN-TH_P5.08_KF128-5.08-2P
- Role: Horn connector
- Package: 5.08mm terminal block
- Connector 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
- Current Rating: 24A
- Connector Rows: 1
- Manufacturer Part Number: KF128-5.08-2P-AA
- 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
- Connector Gender: Female
- Connector Pitch: 5.08mm
- LCSC Part Number: C474952
- JLCPCB Part Class: Extended Part
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
*The full schematic, PCB layout, bill of materials, and interactive design are available at [https://www.flux.ai/ompatil13/rakshak-railway-crossing-safety-system](https://www.flux.ai/ompatil13/rakshak-railway-crossing-safety-system).*
---
*Generated from [https://www.flux.ai/ompatil13/rakshak-railway-crossing-safety-system](https://www.flux.ai/ompatil13/rakshak-railway-crossing-safety-system)*