Project Files of Automatic Railway Gate Control with Raspberry Pi - Proteus Simulation
85f12ff38484488bafe93373b472b72b.zip

Automatic Railway Gate Control with Raspberry Pi - Proteus Simulation V1.0
Automatic Railway Gate Control with Raspberry Pi - Proteus Simulation V1.0 comes as a ZIP archive of 144 files (14.4 MB, 28.5 MB unpacked) holding Proteus library files, simulation model DLLs, a Proteus simulation, source code and a nested archive.
- LIBProteus library
- DLLProteus model
- DSNProteus simulation
- SRCSource code
- ZIPNested archive
Description
Automatic-Railway-Gate-Control-Raspberry-Pi-Proteus-Simulation-v1.0.zip: the complete Proteus simulation project (a Raspberry Pi 5, three FC-51 IR sensors, an SG90 servo barrier, four 5 mm LEDs with their resistors, an active buzzer, the Laptop and Mobile WiFi Monitors), the Python program railway_gate.py, every LIB and DLL, the TEP Pi runtime and a README.
File Structure
9.9 KB229.3 KB39.5 KB21.8 KB13.1 KB306.9 KB60.5 KB24.5 KB3.3 MB34.3 KB620.8 KB36 KB169.8 KB628.1 KB99.3 KB65.3 KB4.8 MB4.1 MB80 B97.8 KB26.8 KB1.2 MB1.1 MB88.9 KB27.3 KB55.8 KB79.8 KB105.8 KB193.8 KB113.8 KB48.8 KB145.8 KB36.8 KB29.3 KB42.3 KB28.8 KB67.3 KB89.3 KB153.8 KB22.8 KB38.8 KB2.1 KB9.9 KB4.1 KB1.3 KB4.7 KB431 B2.5 KB17.5 KB283 B6.5 KB37.9 KB11.1 KB5.5 KB885 B13.6 KB9 KB878 B1.5 KB4 KB1004 B10 B110 B2.6 KB1.1 KB8.9 KB58.5 KB12.4 KB6.6 KB18.5 KB20.7 KB27.8 KB21.1 KB7.1 KB7.7 KB2.7 KB51.2 KB100.9 KB1.2 KB24.3 KB7.4 KB53.6 KB26.1 KB20.5 KB60.5 KB19.6 KB1.6 KB8.4 KB20.9 KB2.6 KB539 B1.4 KB9.7 KB2.8 KB21 B92 B7.9 KB264 B3.4 KB3.8 KB17.5 KB55.2 KB3.3 KB10.8 KB1.5 KB4.2 KB7.3 KB2.5 KB32.6 KB14.5 KB283 B17.4 KB257 B691 B14.5 KB12.8 KB3.6 KB1.7 KB37 KB418 B6.2 KB7 KB37.3 KB10.6 KB23.7 KB28.7 KB8.8 KB16.9 KB276 KB377 KB289.5 KB3.0 MB311 KB294.5 KB40.2 KB10 KB276 KB377 KB289.5 KB3.0 MB311 KB294.5 KB10 KB10.6 KBGallery12 images from the tutorialOpen the tutorial
The circuit, the board and the results as they appear in Automatic Railway Gate Control with Raspberry Pi - Proteus Simulation. Open an image for its full size.












README
===============================================================================================================
Automatic Railway Gate Control with Raspberry Pi - Proteus Simulation - Project V1.0
The Engineering Projects - www.TheEngineeringProjects.com
===============================================================================================================
IMPORTANT LINKS
The project tutorial (circuit, code, simulation results):
https://www.theengineeringprojects.com/2026/12/automatic-railway-gate-control-raspberry-pi-proteus-simulation.html
The libraries this project is built from (each post has its own full download and tutorial):
Raspberry Pi 5 board:
https://www.theengineeringprojects.com/2026/10/raspberry-pi-5-library-for-proteus.html
FC-51 IR obstacle sensor:
https://www.theengineeringprojects.com/2026/10/infrared-sensor-library-for-proteus-v2-0.html
SG90 servo motor:
https://www.theengineeringprojects.com/2026/10/sg90-servo-motor-library-for-proteus-v1-0.html
5 mm LEDs:
https://www.theengineeringprojects.com/2026/11/5mm-led-library-for-proteus.html
Resistors:
https://www.theengineeringprojects.com/2026/11/resistor-library-for-proteus.html
Active buzzer:
https://www.theengineeringprojects.com/2026/11/active-buzzer-library-for-proteus.html
Laptop WiFi Monitor:
https://www.theengineeringprojects.com/2026/10/laptop-wifi-monitor-library-for-proteus.html
Mobile WiFi Monitor:
https://www.theengineeringprojects.com/2026/10/mobile-wifi-monitor-library-for-proteus.html
Support our free work: https://www.theengineeringprojects.com/donate
FILE STRUCTURE
Pi-5-Railway-Gate-TEP-v1.0/
|-- Proteus Library Files/
| |-- TEPBUZZER.LIB 9.9 KB a part of the project -> LIBRARY folder
| |-- TEPFC51.LIB 229.3 KB a part of the project -> LIBRARY folder
| |-- TEPLAPTOP.LIB 39.5 KB a part of the project -> LIBRARY folder
| |-- TEPLED5MM.LIB 21.8 KB a part of the project -> LIBRARY folder
| |-- TEPMOBILE.LIB 13.1 KB a part of the project -> LIBRARY folder
| |-- TEPRESISTOR.LIB 306.9 KB a part of the project -> LIBRARY folder
| |-- TEPRPI5.LIB 60.5 KB a part of the project -> LIBRARY folder
| |-- TEPSG90.LIB 24.5 KB a part of the project -> LIBRARY folder
|-- Proteus Model Files/
| |-- TEPBUZZER.DLL 276.0 KB a model -> MODELS folder
| |-- TEPFC51.DLL 377.0 KB a model -> MODELS folder
| |-- TEPLED5MM.DLL 289.5 KB a model -> MODELS folder
| |-- TEPNET.DLL 3.01 MB a model -> MODELS folder
| |-- TEPRESISTOR.DLL 311.0 KB a model -> MODELS folder
| |-- TEPSG90.DLL 294.5 KB a model -> MODELS folder
| |-- TEPPi/python/ 17.54 MB Python 3.11 embeddable -> MODELS\TEPPi (33 files)
| |-- TEPPi/runtime/ 1.11 MB TEP Pi runtime, gpiozero -> MODELS\TEPPi (87 files)
|-- Proteus Simulation/
| |-- Pi-5-Railway-Gate.pdsprj 40.2 KB the project simulation
| |-- railway_gate.py 10.0 KB the program PI1 runs
| |-- TEPBUZZER.DLL 276.0 KB copy of the model
| |-- TEPFC51.DLL 377.0 KB copy of the model
| |-- TEPLED5MM.DLL 289.5 KB copy of the model
| |-- TEPNET.DLL 3.01 MB copy of the model
| |-- TEPRESISTOR.DLL 311.0 KB copy of the model
| |-- TEPSG90.DLL 294.5 KB copy of the model
|-- Python Code/
| |-- railway_gate.py 10.0 KB the program (the same file)
|-- README.txt ~10.4 KB this file
Total: 28.46 MB (unzipped). The C++ source code of the models is not included.
WHAT IS IT?
An unmanned level crossing on a Raspberry Pi 5: it sees a train coming from either side, warns the road with
flashing lights and a bell, lowers the barrier, gives the train a green signal only when the barrier is down, and
opens again when the train has gone. It never lowers the barrier onto a car on the crossing - the train's signal
stays red instead.
* PI1 RASPBERRY PI 5 runs railway_gate.py on Ethernet at 192.168.1.51 (port 8000); 3V3 (pin 1), 5V (pin 2), GND.
* U1 / U2 / U3 FC-51 IR sensors (FC51ADVTEP), VCC on the Pi's 3V3, OUT LOW = something in front: WEST TRACK on
GPIO17 (pin 11) and EAST TRACK on GPIO27 (pin 13) along the track, CROSSING on GPIO22 (pin 15) across the road.
* SERVO1 the barrier (SG90SERVOTEP): V+ on 5V, SIG on GPIO18 (pin 12) - 90 deg up (open), 0 deg down (closed).
* D1 / D2 the road's red warning lights (LED5MMREDTEP) on GPIO23 / GPIO24 (pins 16 / 18); D3 / D4 the train's
signal, red (LED5MMREDTEP) on GPIO5 (pin 29) and green (LED5MMGREENTEP) on GPIO6 (pin 31); each through a 220 ohm
RESISTOR4BANDTEP R1 - R4.
* BZ1 the bell (BUZZERACTIVETEP) on GPIO25 (pin 22).
* Laptop WiFi Monitor (PC1) and Mobile WiFi Monitor (MOB1) open http://192.168.1.51:8000/.
What the program does:
a train the first track sensor to see it gives the direction; the other one is the exit
WARNING the road lights flash in turn and the bell rings for 3 s
HELD something on the crossing: the barrier stays up and the train's signal at RED until it is clear
CLOSING the barrier comes down 3 degrees every 50 ms (1.5 s); CLOSED: the train's signal GREEN
OPENING the exit sensor has seen the train and is clear again; 2 s later the signal goes RED and the barrier
rises; OPEN: the lights and the bell off
fail-safe no train at the exit within 60 s: the crossing stays closed
maintenance CLOSE on the dashboard closes the crossing until AUTO
Its pages:
/ the dashboard: Refresh, CLOSE, AUTO; the state, the barrier's angle, the signal, the three sensors,
the trains and the holds, the last events
/data JSON: the same
TEST STATUS
Tested in Proteus 8 Professional on Windows 11, the run that made the tutorial's screenshots (the times are the
program's clock; each FC-51's pop-up moved a train or a car to 10 cm or away to 30 cm):
- 0.0 s READY: the barrier up (90 deg, 1472 us), the train's signal red.
- A train from the WEST: 6.9 s TRAIN and WARNING (the road lights flashing, the bell: 29.2 mA at 4.97 V); 9.9 s
CLOSING; 11.4 s CLOSED (0.4 deg, 544 us) and the train's signal GREEN. 18.1 s the train at the EAST sensor; it
cleared - 22.8 s OPENING, the signal RED; 24.3 s OPEN.
- A car stuck on the crossing as a train comes from the EAST: 29.7 s WARNING; 32.7 s HELD - the barrier stays up
(89.6 deg), the signal RED; the car left - 40.0 s CLOSING, 41.5 s CLOSED, GREEN; 44.2 s the train at the WEST
sensor; 48.8 s OPENING; 50.3 s OPEN (2 trains, 1 hold).
- 51.4 s CLOSE from the phone (maintenance): the warning, 55.9 s CLOSED; 59.0 s AUTO: 60.6 s OPEN.
- The bell's 29.2 mA is more than a Pi pin should give (the simulation's GPIO HIGH is Proteus's 5 V logic level;
about 19 mA from 3.3 V) - drive a real buzzer through a transistor. 64.2 s of simulation in 420 s.
- Our first run: D2 at x 1100 put R2's ROADR label across D1's value; the lamps are further apart now.
INSTALLATION
1. Close Proteus. Extract the WHOLE zip file, for example to your Desktop.
2. Copy the files from "Proteus Library Files" into the LIBRARY folder of Proteus, for example
C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY
3. Copy everything in "Proteus Model Files" - the DLL files and the TEPPi folder - into the MODELS folder (next
to LIBRARY).
4. Start Proteus. Press P in the schematic and search for RASPBERRY PI 5 or FC-51 to check that the parts are there.
RUN THE SIMULATION
1. Open "Proteus Simulation\Pi-5-Railway-Gate.pdsprj". Keep railway_gate.py and the DLL files beside it.
2. Press Play: READY - the barrier up, the train's signal red. The FC-51 and SG90 pop-ups open.
3. A train: the WEST TRACK sensor's (U1) Scene page, distance 10 cm; then 30 cm (passed), then the EAST TRACK
sensor (U3) 10 cm and 30 cm - the barrier goes up again. A car on the crossing: U2 at 10 cm.
4. Open the Laptop or the Mobile WiFi Monitor (Go): CLOSE for maintenance, AUTO to go back.
PROPERTIES USED IN THIS PROJECT
PI1 RASPBERRY PI 5 PROGRAM=railway_gate.py, ETHERNET=IN (192.168.1.51)
U1 - U3 FC51ADVTEP (no changes: a white object, the range 20 cm, the scene at 30 cm = clear)
SERVO1 SG90SERVOTEP, D1 - D4 LED5MM...TEP, BZ1 BUZZERACTIVETEP (no properties)
R1 - R4 RESISTOR4BANDTEP 220
PC1, MOB1 HOMEPAGE=http://192.168.1.51:8000/
TROUBLESHOOTING
* The barrier never comes down: something stands on the crossing (U2) - the program holds it up on purpose.
* The barrier stays down after the train: the exit sensor must see the train and then be clear again.
* The barrier jitters: the servo's pulse is 544 - 2400 us for 0 - 180 deg; give the servo its own 5 V supply.
* Real hardware: a model railway crossing is fine with FC-51s; a real crossing uses track circuits or axle
counters, fail-safe relays and a certified controller - never a hobby board alone.
LICENCES
* The project, the program, the parts (LIB files) and the models (DLL files) are made by The Engineering Projects
and are free for learning and for your own projects. The models use only standard Windows libraries.
The C++ source code of the models is not included; the source code is not included for any model.
* TEPPi\python is the Python 3.11 Windows embeddable package (Python Software Foundation License); TEPPi\runtime
holds our TEP Pi runtime with gpiozero and colorzero (BSD licences) - their licence files are inside the folders.
* Proteus is a product of Labcenter Electronics and is not included. Raspberry Pi is a trademark of Raspberry Pi
Ltd. This project is not made or endorsed by them.
VERSION
V1.0 - the first release of the project.
===============================================================================================================Development1 release
-
V1.0Automatic Railway Gate Control with Raspberry Pi - Proteus Simulation V1.0this page
V1.0 is the only release in the Download Center so far. When a newer version is published, it appears above with its own download page.
Installation7 steps
From the download to a working project, in order. The steps follow what the package contains.
You will need
- Proteus Design SuiteProteus 8 or newer (Labcenter), on Windows
- Pythonto build the source files into firmware
- Any archive toolWindows, macOS and Linux extract ZIP files on their own
Steps
- 1
Extract the archive
Right-click 85f12ff38484488bafe93373b472b72b.zip and choose Extract All (or open it with 7-Zip or WinRAR) into a folder you can find again. Keep its folder structure (Pi-5-Railway-Gate-TEP-v1.0) as it is.
- 2
Copy the library files into Proteus
Move TEPBUZZER.LIB, TEPFC51.LIB and TEPLAPTOP.LIB and 5 more and the files into the LIBRARY folder of your Proteus installation: C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY for Proteus 8, or the matching Proteus 7 folder. Older versions keep it under ProgramData\Labcenter Electronics. If Proteus is open, close it first.
- 3
Add the simulation model
Copy TEPBUZZER.DLL, TEPFC51.DLL and TEPLED5MM.DLL and 10 more into the MODELS folder next to LIBRARY, so the component can run, not only be drawn.
- 4
Restart Proteus and place the component
Start Proteus, open a schematic, press P (Pick Devices) and search for the component by the name used in the tutorial. It appears with its pins ready to wire.
- 5
Build the source code
Open railway_gate.py, attr.py and color.py and 28 more in the compiler named in the tutorial (MikroC, Keil, MPLAB, Code Composer or the Arduino IDE) and build it to get the firmware.
- 6
Open the example simulation
Open Pi-5-Railway-Gate.pdsprj in Proteus to see the wiring exactly as in the tutorial. Check the controller's Program File path, then press Play.
- 7
Follow the tutorial
Automatic Railway Gate Control with Raspberry Pi - Proteus Simulation explains every connection and setting in order; keep it open beside the files while you build.
FAQs8 questionsContact TEP
How do I download Automatic Railway Gate Control with Raspberry Pi - Proteus Simulation V1.0?
Wait for the 30-second guest countdown on this page, then press the download button; the file comes straight from our storage. Members who are logged in skip the wait. If the browser opens the file instead of saving it, use its Save as option. The download link is made for you when the countdown ends and works for 15 minutes; a saved or shared link stops working, so share this page instead.
What is inside the archive?
Automatic Railway Gate Control with Raspberry Pi - Proteus Simulation V1.0 comes as a ZIP archive of 144 files (14.4 MB, 28.5 MB unpacked) holding Proteus library files, simulation model DLLs, a Proteus simulation, source code and a nested archive. Open the File Structure tab for the full list of 144 files.
What should I do if the download does not start?
Check the browser's download list first; an ad blocker or a company firewall can also hold it back, so try another browser or network. If the file arrives incomplete, download it again. For an installation problem, read the Install tab or tell us in the comments with your software version and the exact error message.
Is this file free?
Yes. Every file in the TEP Download Center is free for learning, personal and student projects. If you share it, link back to this page or the tutorial so others find the latest version.
How do I check that the file arrived complete?
Compare its SHA-256 with the one on this page, 18c435607a23423d4ed6a8d3a808b783c2d4d3268db95a1e7c25b8577d8791f9. In PowerShell run Get-FileHash "85f12ff38484488bafe93373b472b72b.zip"; on macOS or Linux run shasum -a 256 "85f12ff38484488bafe93373b472b72b.zip". The same value means the file is exactly the one in our storage; a different one means the download broke off, so download it again.
Do I need WinRAR to open the ZIP file?
No. Windows, macOS and Linux open ZIP archives on their own (Extract All, or double-click). WinRAR and 7-Zip work too. Extract the whole archive before using the files.
Where do I put the LIB and IDX files?
Both files go into the LIBRARY folder of your Proteus installation (Proteus 8: C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY; Proteus 7 has the same folder under its own name). Restart Proteus afterwards and search for the component with P.
Which Proteus version does the library need?
The tutorial names the Proteus version the library was made and tested with. Most TEP libraries work in Proteus 7 and Proteus 8; if the component does not appear after a restart, check that both the LIB and the IDX file were copied and that Proteus was fully closed while copying.
Members skip the wait. Log in or join TEP.
- 0Total downloads
- 4%Popularity
- Raspberry PiCategory
- 0Comments
- ssyedzainnasirUploaded by
- 6 Dec 2026Uploaded at
18c435607a23423d4ed6a8d3a808b783c2d4d3268db95a1e7c25b8577d8791f9






















Comments
0