Project Files of Density Based Traffic Light with Raspberry Pi 5 - Proteus Simulation
50912fc517334943837d203ad05e0d42.zip

Density Based Traffic Light with Raspberry Pi 5 - Proteus Simulation V1.0
Density Based Traffic Light with Raspberry Pi 5 - Proteus Simulation V1.0 comes as a ZIP archive of 138 files (13.8 MB, 27.3 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
Density-Based-Traffic-Light-Raspberry-Pi-5-Proteus-Simulation-v1.0.zip: the complete Proteus simulation project (a Raspberry Pi 5, twelve 5 mm LEDs with their resistors, eight FC-51 IR sensors, the Laptop and Mobile WiFi Monitors), the Python program traffic_light.py, every LIB and DLL, the TEP Pi runtime and a README.
File Structure
229.3 KB39.5 KB21.8 KB13.1 KB306.9 KB60.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 KB377 KB289.5 KB3.0 MB311 KB38.3 KB377 KB289.5 KB3.0 MB311 KB11.4 KB11.4 KB10.4 KBGallery12 images from the tutorialOpen the tutorial
The circuit, the board and the results as they appear in Density Based Traffic Light with Raspberry Pi 5 - Proteus Simulation. Open an image for its full size.












README
===============================================================================================================
Density Based Traffic Light with Raspberry Pi 5 - 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/density-based-traffic-light-raspberry-pi-5-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
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
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-Density-Traffic-Light-TEP-v1.0/
|-- Proteus Library Files/
| |-- 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
|-- Proteus Model Files/
| |-- 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
| |-- 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-Density-Traffic-Light.pdsprj 38.3 KB the project simulation
| |-- 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
| |-- traffic_light.py 11.4 KB the program PI1 runs
|-- Python Code/
| |-- traffic_light.py 11.4 KB the program (the same file)
|-- README.txt ~10.6 KB this file
Total: 27.31 MB (unzipped). The C++ source code of the models is not included.
WHAT IS IT?
A four-way junction that gives the green to the road with the most traffic, instead of to the next road in a fixed
turn. Two IR sensors on each road tell the Raspberry Pi 5 whether a car waits at the stop line and whether the queue
reaches back to the second sensor; the Pi picks the busiest road, gives it a longer green when the queue is long,
ends a green early when its road empties, never lets a road wait too long, and gives an ambulance the green.
* PI1 RASPBERRY PI 5 runs traffic_light.py on Ethernet at 192.168.1.51 (port 8000); 3V3 (pin 1), GND (pin 6).
* Four signal heads, D1 - D12 (5 mm LEDs LED5MMREDTEP / LED5MMYELLOWTEP / LED5MMGREENTEP), each LED from its GPIO
through a 220 ohm resistor (RESISTOR4BANDTEP R1 - R12), K to GND - red / yellow / green:
NORTH GPIO17 / 27 / 22 (pins 11 / 13 / 15) EAST GPIO5 / 6 / 13 (pins 29 / 31 / 33)
SOUTH GPIO19 / 26 / 21 (pins 35 / 37 / 40) WEST GPIO20 / 16 / 12 (pins 38 / 36 / 32)
* U1 - U8 FC-51 IR obstacle sensors (FC51ADVTEP), two a road - CAR at the stop line, QUEUE a few car lengths back;
VCC on the Pi's 3V3, OUT LOW = a car in front:
NORTH GPIO4 / 18 (pins 7 / 12) EAST GPIO23 / 24 (pins 16 / 18)
SOUTH GPIO25 / 8 (pins 22 / 24) WEST GPIO7 / 11 (pins 26 / 23)
* Laptop WiFi Monitor (PC1) and Mobile WiFi Monitor (MOB1) open http://192.168.1.51:8000/.
What the program does:
the density EMPTY (no car), LOW (one sensor sees a car), HIGH (both: the queue reaches the second sensor)
the choice the waiting road with the highest density; a tie: the one that has waited longest
the green LOW 4 s, HIGH 8 s (short for the simulation; a real junction: about 15 s / 30 s); held while no other
road has a car; ended early (after 2 s) when its road is empty for 1 s and another road waits
no starving a road that has waited 20 s gets the next green and cuts a running green short (after its 2 s)
the change yellow 2 s, then all red 1 s, then the next green
ambulance the dashboard's NORTH / EAST / SOUTH / WEST: that road green at once (yellow and all red first),
held until NORMAL
Its pages:
/ the dashboard: Refresh, NORMAL / NORTH, EAST / SOUTH, WEST; the phase, each road's light, density
and wait, the greens and the average wait
/data JSON: the same, with the counts of cars arriving at each stop line
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 car to 10 cm or away to 30 cm):
- 0.0 s READY - all red, every road EMPTY (each FC-51: nothing within its 20 cm range, OUT HIGH).
- 19.7 s a car at the NORTH stop line (OUT LOW 2 ms after the comparator): NORTH GREEN at once (LOW, 4 s);
23.8 s held - no other road had a car.
- 26.9 s EAST car + queue (HIGH) and a WEST car (LOW) together: NORTH YELLOW; 30.0 s EAST GREEN (HIGH, 8 s).
- 34.6 s SOUTH car + queue (HIGH); the NORTH car gone. 41.0 s SOUTH GREEN (HIGH, waited 6.4 s) before WEST (LOW,
waited 14.1 s) - the busiest road, not the next one.
- 47.0 s SOUTH YELLOW - WEST has waited 20 s (the green cut short after 6 s); 50.0 s WEST GREEN (waited 23 s).
- 52.2 s the WEST car gone: 53.2 s WEST YELLOW - its road is empty; 56.2 s SOUTH GREEN (HIGH) again.
- 58.9 s an AMBULANCE on WEST from the phone: SOUTH YELLOW at once; 61.9 s WEST GREEN, held. 65.2 s NORMAL from
the laptop: 65.9 s WEST YELLOW; 68.9 s SOUTH GREEN. The dashboard: 7 greens, 1 cut short, the average wait 8.0 s.
- Each lit LED: 1.90 V, 14.0 mA (3.09 V across its 220 ohm) - the simulation's GPIO outputs are Proteus's 5 V logic
level; a real Pi 5 pin gives 3.3 V: (3.3 - 1.9) / 220 = 6.4 mA. 73.0 s of simulation in 639 s.
- Our first run: each LED's ground symbol sat on the name of the LED below it; 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-Density-Traffic-Light.pdsprj". Keep traffic_light.py and the DLL files beside it.
2. Press Play: READY - all red, no traffic. Each FC-51's pop-up opens (U1 - U8).
3. Put a car in front of a sensor: its pop-up's Scene page, distance 10 cm (30 cm = nothing within its range).
U1 / U2 are NORTH's CAR / QUEUE, U3 / U4 EAST's, U5 / U6 SOUTH's, U7 / U8 WEST's.
4. Open the Laptop or the Mobile WiFi Monitor (Go): an ambulance with NORTH / EAST / SOUTH / WEST, then NORMAL.
PROPERTIES USED IN THIS PROJECT
PI1 RASPBERRY PI 5 PROGRAM=traffic_light.py, ETHERNET=IN (192.168.1.51)
D1 - D12 LED5MM...TEP (no properties)
R1 - R12 RESISTOR4BANDTEP 220
U1 - U8 FC51ADVTEP (no changes: a white object, the range 20 cm, the scene at 30 cm = clear)
PC1, MOB1 HOMEPAGE=http://192.168.1.51:8000/
TROUBLESHOOTING
* A road never gets the green: its sensor reads HIGH (clear) - check its OUT wire; OUT LOW means a car.
* A green ends at once: another road has waited 20 s, or its own road shows EMPTY.
* The lights cycle with no cars: a sensor sees something within its range - set its scene to 30 cm.
* Real hardware: the FC-51 sees only 2 - 30 cm, fine for a model junction; a real road uses induction loops,
radar or cameras. Real signal heads need drivers (transistors or relays) - a GPIO gives a few mA, enough for
one LED only. Mount the IR sensors out of direct sunlight.
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.0Density Based Traffic Light with Raspberry Pi 5 - 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 50912fc517334943837d203ad05e0d42.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-Density-Traffic-Light-TEP-v1.0) as it is.
- 2
Copy the library files into Proteus
Move TEPFC51.LIB, TEPLAPTOP.LIB and TEPLED5MM.LIB and 3 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 TEPFC51.DLL, TEPLED5MM.DLL and TEPNET.DLL and 8 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 traffic_light.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-Density-Traffic-Light.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
Density Based Traffic Light with Raspberry Pi 5 - 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 Density Based Traffic Light with Raspberry Pi 5 - 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?
Density Based Traffic Light with Raspberry Pi 5 - Proteus Simulation V1.0 comes as a ZIP archive of 138 files (13.8 MB, 27.3 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 138 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, 7fd7c1332eeccb0ad4fbbb99649dee94f4be8a674a1ae2e68cae3078273c3cae. In PowerShell run Get-FileHash "50912fc517334943837d203ad05e0d42.zip"; on macOS or Linux run shasum -a 256 "50912fc517334943837d203ad05e0d42.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
- 5 Dec 2026Uploaded at
7fd7c1332eeccb0ad4fbbb99649dee94f4be8a674a1ae2e68cae3078273c3cae






















Comments
0