Project Files of PC817 Optocoupler Library for Proteus: PC817 and 4N35
pc817-optocoupler-tep-v1-0-c8ad0748516743d3a3939c569e8f197b.zip

PC817 Optocoupler Library for Proteus V1.0
PC817 Optocoupler Library for Proteus V1.0 comes as a ZIP archive of 19 files (2.1 MB, 4.7 MB unpacked) holding Proteus library files, simulation model DLLs, a Proteus simulation, an Arduino sketch and compiled HEX firmware.
- LIBProteus library
- DLLProteus model
- DSNProteus simulation
- INOArduino sketch
- HEXHEX firmware
Description
PC817-Optocoupler-Library-for-Proteus-v1.0.zip with real-looking PC817 and 4N35 optocouplers for Proteus (the infrared LED, the phototransistor with its CTR curve and ranks, the switching times; a pop-up with the light across the gap and CTR against IF; TEPOPTO.LIB and TEPOPTO.DLL), our push button, resistors and LED, Arduino UNO V4.0, the A4 demo with its sketch and a README.
File Structure
3.3 KB201.9 KB20.7 KB21.8 KB30 KB306.9 KB883.5 KB274 KB289.5 KB306 KB311 KB24.9 KB12.1 KB883.5 KB274 KB289.5 KB306 KB311 KB14.2 KBGallery12 images from the tutorialOpen the tutorial
The circuit, the board and the results as they appear in PC817 Optocoupler Library for Proteus: PC817 and 4N35. Open an image for its full size.












README
PC817 OPTOCOUPLER LIBRARY FOR PROTEUS - V1.0 (PC817 and 4N35 optocouplers with a pop-up)
Designed by The Engineering Projects
www.TheEngineeringProjects.com
IMPORTANT LINKS
Article (read it first - pictures, step by step, every feature explained):
https://www.theengineeringprojects.com/2026/11/pc817-optocoupler-library-for-proteus.html
Report a bug or suggest a feature (our forum):
https://www.theengineeringprojects.com/forum/category/pc817-optocoupler-proteus-library
The demo runs on our Arduino UNO V4.0 (included) - working LEDs, RESET and a
built-in serial monitor, no Virtual Terminal to wire - its own article:
https://www.theengineeringprojects.com/2026/10/arduino-uno-library-for-proteus-v40.html
The 24 V switch is our own push button (included):
https://www.theengineeringprojects.com/2026/11/push-button-library-for-proteus.html
the 12 V lamp is our own 5 mm LED (included):
https://www.theengineeringprojects.com/2026/11/5mm-led-library-for-proteus.html
Support us (the libraries are free):
https://www.theengineeringprojects.com/donate
FILE STRUCTURE
PC817-Optocoupler-TEP-v1.0/
|-- Proteus Library Files/
| |-- ArduinoV4TEP.LIB 201.9 KB TEP Arduino boards V4.0 (UNO) -> LIBRARY
| |-- TEPBUTTON.LIB 20.7 KB a part the demo uses -> LIBRARY folder
| |-- TEPLED5MM.LIB 21.8 KB a part the demo uses -> LIBRARY folder
| |-- TEPOPTO.LIB 30.0 KB the library -> LIBRARY folder
| |-- TEPRESISTOR.LIB 306.9 KB a part the demo uses -> LIBRARY folder
|-- Proteus Model Files/
| |-- TEPARDUINO.DLL 883.5 KB the Arduino board model -> MODELS folder
| |-- TEPBUTTON.DLL 274.0 KB its model -> MODELS folder
| |-- TEPLED5MM.DLL 289.5 KB its model -> MODELS folder
| |-- TEPOPTO.DLL 306.0 KB the model -> MODELS folder
| |-- TEPRESISTOR.DLL 311.0 KB its model -> MODELS folder
|-- Proteus Simulation/
| |-- Opto_Demo.hex 12.1 KB the demo firmware
| |-- Optocoupler-Isolation-ArduinoUnoV4.pdsprj 24.9 KB the demo project
| |-- TEPARDUINO.DLL 883.5 KB copy of the board model
| |-- TEPBUTTON.DLL 274.0 KB copy of its model
| |-- TEPLED5MM.DLL 289.5 KB copy of its model
| |-- TEPOPTO.DLL 306.0 KB copy of the model
| |-- TEPRESISTOR.DLL 311.0 KB copy of its model
|-- Arduino Code/
| |-- Opto_Demo/Opto_Demo.ino 3.3 KB the demo sketch (source of the .hex)
|-- README.txt ~14.8 KB this file
Total: 4.65 MB (unzipped). The C++ source code of the models is not included.
WHAT IS IT?
Two optocouplers, drawn at true scale (the top view): an infrared LED and a phototransistor with
nothing between them but light.
* PC817 - DIP-4 (1 A, 2 K, 3 E, 4 C), 4.58 x 6.5 mm: CTR 50 to 600 % at 5 mA, sold in ranks A
(80-160 %), B (130-260 %), C (200-400 %)
and D (300-600 %); 80 V, 50 mA; 5000 Vrms between its two sides. The rank is printed on the
body: pick it in Edit Properties.
* 4N35 - DIP-6 (1 A, 2 K, 3 not connected, 4 E, 5 C, 6 B): CTR 100 % or more at 10 mA; its base on
a pin; 70 V, 50 mA, 5000 Vrms.
* One analog model: the LED (VF from the datasheet, burns out past its rating), the light as a
photocurrent into the base, and the
phototransistor (a Gummel-Poon-style law with a recombination current, so CTR rises, peaks and
falls with IF as on the datasheet curve),
with the charges of its junctions - so the switching times follow the load resistor and a base
resistor, as on a real part.
* It says whether its output is OFF, ON (CTR now) or SWITCHED ON (the load sets the current),
recognises PWM on the LED, and measures its own
turn-on and turn-off delays. Click one at Run for the pop-up: inside the package, CTR against IF
with the rank's band, graphs,
an event log and a check page.
The body is drawn as on the real part and to true scale against our Arduino.
The TEP signature and the pop-up are TEP additions.
TWO DEVICES (search "PC817" or "4N35" in Pick Devices):
PC817TEP "PC817 Optocoupler V1.0" in TEPOPTO.LIB (Optoelectronics > Optocouplers), prefix U,
model TEPOPTO.DLL. Pins 1 A, 2 K, 3 E, 4 C.
OPTO4N35TEP "4N35 Optocoupler V1.0" in TEPOPTO.LIB, prefix U, model TEPOPTO.DLL. Pins 1 A, 2 K, 4
E, 5 C, 6 B (pin 3 is not connected).
THE POP-UP
Click the part at Run. Tabs:
Optocoupler inside the package (the LED's glow and the light across the gap, the pins lit while
their current flows, the voltage across
the gap), CTR against IF on a log scale with the rank's band and the working point,
and eight live values: IF, VF, IC, VCE,
CTR now, the delays on and off, the power and the gap. While the LED is pulsed the
values are averages.
The toolbar: New part, the pins, the rank.
Graphs the live values over the last 2, 6 or 15 s. Live / Freeze.
Event log every change and warning; filters All / Changes / Warnings, Pause, Clear
Check what the part is doing and what to look at, each with a verdict (green = fine, amber
= check, red = wrong)
Settings theme, text size, open at Run, window size
Help report a bug, suggest a feature, article, updates, donate, forum; Copy diagnostics
for a bug report
TEST STATUS
V1.0: verified in Proteus 8.5 on 31 Oct 2026 (the demo project as shipped: an A4 sheet, an Arduino UNO V4.0).
What the runs showed (the model's own numbers and the sketch's monitor):
* The project loads and starts cleanly. Before the runs, the model was fitted in a separate solver
to the datasheets: CTR at the test point by
rank (PC817 C: 283 % at 5 mA, 5 V), the CTR curve peaking near 3 to 5 mA, and the PC817's
switching test (VCE 2 V, IC 2 mA, RL 100 ohm):
rise 4.2 us, fall 2.9 us against the datasheet's 4 and 3 us typical.
* U1 (PC817, rank C), the 24 V input: SW1 held put 4.87 mA through its LED (VF 1.10 V); its
transistor pulled D2 down to 0.10 V, the 10k
pull-up taking 490 uA. The monitor printed "24 V input: ON" once - the sketch debounces the
switch, whose bounces the optocoupler passes on.
* U2 (PC817, rank C), the 12 V lamp: at 25 % the pop-up read the LED as PULSED, 490 Hz, about 25 %
on (2.33 mA on average); at 100 %,
9.41 mA in the LED switched 6.72 mA through the lamp at VCE 0.16 V. Its Check page: the load
needs CTR 71 %, rank C gives at least
200 % - a 2.8 x margin for the LED's ageing. The lamp, our red LED: 6.7 mA at 1.76 V.
* U3 and U4 (4N35), timed by the sketch with 47k pull-ups: U3, base open, crossed half its swing
3.2 us after its LED came on and 138.6 us
after it went off; U4, with 220k from base to emitter, 3.6 us and 21.9 us - six times faster to
let go. The sketch, reading the pins
(which switch at about 1 V in the simulation), printed U3 12 / 48 us and U4 12 / 16 us.
* The pop-up: Optocoupler (inside the package, CTR against IF with the rank's band), Graphs, Event
log, Check - all four pages followed the run,
for all four parts.
INSTALLATION (about 2 minutes)
1. Close Proteus. Extract the WHOLE ZIP to a normal folder (e.g. Desktop).
2. Copy everything in "Proteus Library Files" (TEPOPTO.LIB, TEPRESISTOR.LIB, TEPLED5MM.LIB,
TEPBUTTON.LIB and our Arduino library V4.0, ArduinoV4TEP.LIB, with the ARDUINO UNO V4.0 used by the
demo) to the LIBRARY folder of Proteus, for example:
C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY
(use the folder that already holds Proteus's own .LIB files).
3. Copy TEPOPTO.DLL, TEPRESISTOR.DLL, TEPLED5MM.DLL, TEPBUTTON.DLL and TEPARDUINO.DLL from "Proteus
Model Files" to the MODELS folder (...\Proteus 8 Professional\MODELS).
4. Delete TEPOPTO.IDX from the LIBRARY folder if it is there (Proteus makes a new index).
5. Start Proteus. In Pick Devices (P) search "PC817 or 4N35".
RUN THE DEMO
"Proteus Simulation\Optocoupler-Isolation-ArduinoUnoV4.pdsprj" (an A4 sheet) - keep the .hex file
and the DLLs beside the project.
ARD1: Arduino UNO V4.0 running Opto_Demo.hex, its serial monitor built in (window "TEP Arduino
UNO - ARD1").
U1 PC817: SW1 (our push button) from +24V - R1 4k7 - A, K to GND; C to D2 with R2 10k to +5V, E to
GND a 24 V input
U2 PC817: D9 - R3 390 - A, K to GND; +12V - R4 1k5 - D1 (our red LED) - C, E to GND
a 12 V lamp
U3 4N35: D10 - R5 390 - A, K to GND; C to D3 with R8 47k to +5V, E to GND; B open
U4 4N35: D10 - R6 390 - A, K to GND; C to D4 with R9 47k to +5V, E to GND; R7 220k from B to GND
1. Press Run. Every 3 s the lamp goes to its next level (25, 75, 100 %) and the sketch times both
4N35s.
2. Hold SW1 (its pop-up, or the mouse on it): the monitor prints "24 V input: ON".
3. Compare U3's and U4's turn-off delays: the base resistor lets U4 go six times sooner.
Closed the monitor? Click the UNO's USB port.
WIRING (the same in Proteus and on a real board)
input: signal - R - A; K to the signal's ground; C to a pin with a pull-up (10k); E to the
board's ground
output: pin - R (330 to 470 ohm) - A; K to GND; the load from its supply to C; E to the load's
ground
R for the LED = (V - 1.2 V) / IF, for 5 to 10 mA
REAL HARDWARE:
* The two sides share no wire: keep their grounds apart, or the isolation is gone.
* As a switch, the load must need less than IF x the lowest CTR of the rank - leave room: LEDs fade
with age.
* A bigger pull-up switches slower (the collector-base capacitance times the gain); on a 4N35 a
resistor of 100k to 1M from B to E
makes it let go sooner, at the cost of some CTR.
* An AC or reversed input needs a diode across the LED: it takes only 6 V backwards.
THE DEMO SKETCH ON THE SERIAL MONITOR (Opto_Demo V1.0, 9600 baud)
There are no commands. The sketch steps the lamp every 3 s, times the 4N35s and reports the 24 V
input.
EXPECTED MONITOR OUTPUT
Optocouplers - The Engineering Projects
Lamp at 25 %
4N35 on / off: U3 12 / 48 us, U4 12 / 16 us
PROPERTIES (double-click the part > Edit Properties)
Part (VALUE) PC817 or 4N35
CTR rank (PC817, STATE) no rank (50-600 %), A (80-160 %), B (130-260 %), C (200-400 %), D
(300-600 %) - printed on the body
Every run starts again from the properties.
LINKS.INI (OPTIONAL)
The Help page cards of the pop-up open web pages. To point them somewhere else without a new DLL,
put a text file named links.ini next to TEPOPTO.DLL with lines KEY=URL, for example:
ARTICLE=https://www.theengineeringprojects.com/...
Keys: WEBSITE, FORUM, BUG_REPORT, FEATURE_REQUEST, ARTICLE, USER_GUIDE,
UPDATE_CHECK, DONATE. Only http:// and https:// links are used; lines starting
with # are comments.
TROUBLESHOOTING
* The output never switches: the LED is reversed, or IF is too small for the load - check IF x CTR
against the load's current.
* It switches but slowly: a big pull-up; use a smaller one, or a base resistor on a 4N35.
* The input reads twice per press: the switch bounces and the optocoupler passes every bounce -
debounce in software.
* LED BURNT: more than 50 mA for too long - a bigger resistor.
* The part is not simulated: TEPOPTO.DLL is missing from MODELS and from the project folder. No UNO
/ no monitor window: TEPARDUINO.DLL is missing, or click the UNO's USB port.
BUG REPORTS AND FEATURE REQUESTS
Please post them in our forum with a screenshot, the Serial Monitor text, the
simulation log and the pop-up's Copy diagnostics text:
https://www.theengineeringprojects.com/forum/category/pc817-optocoupler-proteus-library
SUPPORT US
This library is free. If it saves you time, please support our work:
https://www.theengineeringprojects.com/donate
WEBSITE
https://www.theengineeringprojects.com/
LICENCES AND THIRD-PARTY NOTES
* The model (TEPOPTO.DLL), the symbols and artwork, the other parts of ours in the demo and the
Arduino Library V4.0 (ArduinoV4TEP.LIB / TEPARDUINO.DLL, with its built-in TEP Serial Monitor
Advance) are made by The Engineering Projects. The models use only standard Windows libraries; no
Visual C++ redistributable is needed.
The C++ source code is not included.
* Arduino UNO V4.0 (ArduinoV4TEP.LIB / TEPARDUINO.DLL, our Arduino Library V4.0 - its
microcontroller is Proteus's own AVR model): The Engineering Projects,
https://www.theengineeringprojects.com/2026/10/arduino-uno-library-for-proteus-v40.html
* The .hex file is built from the demo sketch and the Arduino AVR core 1.8.6, which includes
LGPL-licensed code; its source code is available at
https://github.com/arduino/ArduinoCore-avr/tree/1.8.6
* Proteus is a product of Labcenter Electronics and is not included. Arduino is a trademark of Arduino SA.
This library is not made or endorsed by Arduino or Labcenter.
REBUILDING THE FIRMWARE (OPTIONAL)
The HEX file is supplied; Arduino IDE is not needed to run the demo. To edit the sketch, open
Arduino Code\Opto_Demo\Opto_Demo.ino, select Arduino Uno and use Sketch > Export Compiled Binary.
Replace the simulation's .hex with the exported HEX. The sketch needs 4,402 bytes of flash and 214
bytes of RAM.
MODEL SCOPE AND LIMITS
Modelled: the LED and its burn-out, the light as a photocurrent, the phototransistor with its CTR
curve, saturation, dark current and junction
charges (the switching times against the load and a base resistor), the voltage across the gap, the
transistor's heat.
Not modelled: the 0.6 pF across the gap, temperature drift of CTR, the LED's ageing, the gap's
breakdown. The charge stored in saturation is an
estimate: no datasheet figure fixes it.
VERSION
TEP PC817 Optocoupler library V1.0 (Nov 2026). Devices PC817TEP and OPTO4N35TEP (TEPOPTO.LIB /
TEPOPTO.DLL). Demo sketch Opto_Demo V1.0. Demo board: ARDUINO UNO V4.0 (TEP Arduino Library V4.0)
with its built-in serial monitor.Development1 release
-
V1.0PC817 Optocoupler Library for Proteus 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.
Installation8 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
- Arduino IDE1.8 or 2.x, with the board of the tutorial chosen under Tools → Board
- Any archive toolWindows, macOS and Linux extract ZIP files on their own
Steps
- 1
Extract the archive
Right-click pc817-optocoupler-tep-v1-0-c8ad0748516743d3a3939c569e8f197b.zip and choose Extract All (or open it with 7-Zip or WinRAR) into a folder you can find again. Keep its folder structure (PC817-Optocoupler-TEP-v1.0) as it is.
- 2
Copy the library files into Proteus
Move ArduinoV4TEP.LIB, TEPBUTTON.LIB and TEPLED5MM.LIB and 2 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 TEPARDUINO.DLL, TEPBUTTON.DLL and TEPLED5MM.DLL and 2 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
Open the sketch in the Arduino IDE
Open Opto_Demo.ino, select your board and port under Tools, then Verify. Sketch → Export Compiled Binary writes the HEX file a simulation needs.
- 6
Load the HEX file
In Proteus double-click the microcontroller, set Program File to Opto_Demo.hex and run the simulation. For real hardware, flash the same file with your programmer.
- 7
Open the example simulation
Open Optocoupler-Isolation-ArduinoUnoV4.pdsprj in Proteus to see the wiring exactly as in the tutorial. Check the controller's Program File path, then press Play.
- 8
Follow the tutorial
PC817 Optocoupler Library for Proteus: PC817 and 4N35 explains every connection and setting in order; keep it open beside the files while you build.
FAQs9 questionsContact TEP
How do I download PC817 Optocoupler Library for Proteus 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?
PC817 Optocoupler Library for Proteus V1.0 comes as a ZIP archive of 19 files (2.1 MB, 4.7 MB unpacked) holding Proteus library files, simulation model DLLs, a Proteus simulation, an Arduino sketch and compiled HEX firmware. Open the File Structure tab for the full list of 19 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, b4993a1d5976815c866ae07c789ac644147c2b678f8ab0e6bb38712ad040a94a. In PowerShell run Get-FileHash "pc817-optocoupler-tep-v1-0-c8ad0748516743d3a3939c569e8f197b.zip"; on macOS or Linux run shasum -a 256 "pc817-optocoupler-tep-v1-0-c8ad0748516743d3a3939c569e8f197b.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.
How do I get the HEX file into the simulation?
Compile the sketch in the Arduino IDE (Sketch → Export Compiled Binary gives you the HEX next to the sketch), then in Proteus double-click the board, set Program File to that HEX and run.
Members skip the wait. Log in or join TEP.
- 0Total downloads
- 4%Popularity
- ProteusCategory
- 0Comments
- ssyedzainnasirUploaded by
- 8 Nov 2026Uploaded at
b4993a1d5976815c866ae07c789ac644147c2b678f8ab0e6bb38712ad040a94a

















Comments
0