TEP DOWNLOAD CENTER

Project Files of TRIAC Lamp Dimmer with ESP32 - Proteus Simulation

Libraries Code Projects Simulation
tep://download-terminal ef0362da748d4628b73aaf97bd545488.zip ZIP archiveV1.0Verified0 downloadsFree
TRIAC Lamp Dimmer with ESP32 - Proteus Simulation: the ESP32, the BT136 triac, the P21W lamp on 12 V AC and the PC817 zero-cross detector
Proteus library · File 1 of 1

TRIAC Lamp Dimmer with ESP32 - Proteus Simulation V1.0

TRIAC Lamp Dimmer with ESP32 - Proteus Simulation V1.0 comes as a ZIP archive of 24 files (4.3 MB, 9.5 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

TRIAC-Lamp-Dimmer-ESP32-Proteus-Simulation-v1.0.zip: the complete Proteus simulation project (an ESP32 DevKit V1, a BT136 triac, a P21W lamp on 12 V AC, a PC817 and 1N4007 zero-cross detector, the Laptop and Mobile WiFi Monitors), the Arduino sketch ESP32_Triac_Dimmer.ino and its HEX, every LIB and DLL and a README.

Read TRIAC Lamp Dimmer with ESP32 - Proteus Simulation

File Structure

ef0362da748d4628b73aaf97bd545488.zip24 files · 5 folders · 9.5 MB unpacked
ESP32-Triac-Dimmer-TEP-v1.0/24 files · 9.5 MB
Arduino Code/1 file · 9.4 KB
ESP32_Triac_Dimmer/1 file · 9.4 KB
INO ESP32_Triac_Dimmer.inoArduino sketch 9.4 KB
Proteus Library Files/8 files · 468.5 KB
LIB TEP1N4007.LIBProteus library 9.7 KB
LIB TEPBULB.LIBProteus library 17.7 KB
LIB TEPESP32V1.LIBProteus library 36.6 KB
LIB TEPLAPTOP.LIBProteus library 39.5 KB
LIB TEPMOBILE.LIBProteus library 13.1 KB
LIB TEPOPTO.LIBProteus library 30 KB
LIB TEPRESISTOR.LIBProteus library 306.9 KB
LIB TEPTHYR.LIBProteus library 15.1 KB
Proteus Model Files/6 files · 4.5 MB
DLL TEP1N4007.DLLSimulation model 286.5 KB
DLL TEPBULB.DLLSimulation model 291 KB
DLL TEPNET.DLLSimulation model 3.0 MB
DLL TEPOPTO.DLLSimulation model 306 KB
DLL TEPRESISTOR.DLLSimulation model 311 KB
DLL TEPTHYR.DLLSimulation model 306.5 KB
Proteus Simulation/8 files · 4.6 MB
DSN ESP32-Triac-Dimmer.pdsprjProteus simulation 31.7 KB
HEX ESP32_Triac_Dimmer.hexCompiled HEX file 69.6 KB
DLL TEP1N4007.DLLSimulation model 286.5 KB
DLL TEPBULB.DLLSimulation model 291 KB
DLL TEPNET.DLLSimulation model 3.0 MB
DLL TEPOPTO.DLLSimulation model 306 KB
DLL TEPRESISTOR.DLLSimulation model 311 KB
DLL TEPTHYR.DLLSimulation model 306.5 KB
TXT README.txtText file 10.6 KB

README

README.txt 147 lines
===============================================================================================================
  TRIAC Lamp Dimmer with ESP32 - 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/triac-lamp-dimmer-esp32-proteus-simulation.html
  The libraries this project is built from (each post has its own full download and tutorial):
    ESP32 DevKit V1 board:
      https://www.theengineeringprojects.com/2026/10/esp32-devkit-v1-library-for-proteus-v2-0.html
    SCR and TRIAC (BT136):
      https://www.theengineeringprojects.com/2026/11/scr-and-triac-library-for-proteus.html
    Filament bulb (P21W):
      https://www.theengineeringprojects.com/2026/11/filament-bulb-library-for-proteus.html
    PC817 optocoupler:
      https://www.theengineeringprojects.com/2026/11/pc817-optocoupler-library-for-proteus.html
    1N4007 diode:
      https://www.theengineeringprojects.com/2026/11/1n4007-diode-library-for-proteus.html
    Resistor:
      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
ESP32-Triac-Dimmer-TEP-v1.0/
|-- Proteus Library Files/
|   |-- TEP1N4007.LIB                                   9.7 KB   a part of the project -> LIBRARY folder
|   |-- TEPBULB.LIB                                    17.7 KB   a part of the project -> LIBRARY folder
|   |-- TEPESP32V1.LIB                                 36.6 KB   a part of the project -> LIBRARY folder
|   |-- TEPLAPTOP.LIB                                  39.5 KB   a part of the project -> LIBRARY folder
|   |-- TEPMOBILE.LIB                                  13.1 KB   a part of the project -> LIBRARY folder
|   |-- TEPOPTO.LIB                                    30.0 KB   a part of the project -> LIBRARY folder
|   |-- TEPRESISTOR.LIB                               306.9 KB   a part of the project -> LIBRARY folder
|   |-- TEPTHYR.LIB                                    15.1 KB   a part of the project -> LIBRARY folder
|-- Proteus Model Files/
|   |-- TEP1N4007.DLL                                 286.5 KB   a model -> MODELS folder
|   |-- TEPBULB.DLL                                   291.0 KB   a model -> MODELS folder
|   |-- TEPNET.DLL                                     3.01 MB   a model -> MODELS folder
|   |-- TEPOPTO.DLL                                   306.0 KB   a model -> MODELS folder
|   |-- TEPRESISTOR.DLL                               311.0 KB   a model -> MODELS folder
|   |-- TEPTHYR.DLL                                   306.5 KB   a model -> MODELS folder
|-- Proteus Simulation/
|   |-- ESP32_Triac_Dimmer.hex                         69.6 KB   the firmware U1 runs
|   |-- ESP32-Triac-Dimmer.pdsprj                      31.7 KB   the project simulation
|   |-- TEP1N4007.DLL                                 286.5 KB   copy of the model
|   |-- TEPBULB.DLL                                   291.0 KB   copy of the model
|   |-- TEPNET.DLL                                     3.01 MB   copy of the model
|   |-- TEPOPTO.DLL                                   306.0 KB   copy of the model
|   |-- TEPRESISTOR.DLL                               311.0 KB   copy of the model
|   |-- TEPTHYR.DLL                                   306.5 KB   copy of the model
|-- Arduino Code/
|   |-- ESP32_Triac_Dimmer/ESP32_Triac_Dimmer.ino       9.4 KB   the sketch (source of the .hex)
|-- README.txt                                        ~10.5 KB   this file
Total: 9.53 MB (unzipped). The C++ source code of the models is not included.

WHAT IS IT?
  A phase-angle lamp dimmer, the way every wall dimmer works, controlled by an ESP32 over Wi-Fi. After each zero of
  the AC the ESP32 waits, then fires a BT136 triac, which conducts until the next zero: the later the firing, the
  less of each half-cycle reaches the lamp. The ESP32 sets the lamp's POWER, not the delay: 50 % on the dashboard
  is half the power, through the RMS formula of a phase-cut sine. A soft start spares the cold filament, and a
  sunrise mode brightens the lamp slowly like a wake-up light.
    * U1 ESP32 DEVKIT V1 runs ESP32_Triac_Dimmer.hex on TEP-WiFi at 192.168.1.101.
    * V1 Proteus's ALTERNATOR, 12 V rms (17 V peak) at 50 Hz - low-voltage AC, safe to learn with.
    * L1 a P21W 12 V 21 W lamp (BULBP21WTEP) from AC to the triac's MT2.
    * Q1 a BT136 triac (TRIACBT136TEP): T1 to ground, T2 = MT2, the gate from D26 through R1 100 ohm (a 200 us pulse a
      half-cycle).
    * The zero-cross detector: R2 2k2 from AC into U2's (PC817TEP) LED, D1 (DIODE1N4007TEP) across it for the
      negative half-cycles; U2's transistor pulls D27 LOW in each positive half-cycle, R3 10k pulls it up to +3.3V in
      the negative one.
    * Laptop WiFi Monitor (PC1) and Mobile WiFi Monitor (MOB1) open http://192.168.1.101/.
  What the sketch does:
    the zero      an interrupt on each edge of D27; the PC817 needs about 1 V, so its edges sit 250 us from the true
                  zero: the zero is 250 us before a falling edge and 250 us after a rising one
    the firing    loop() waits the delay after each zero (micros()), then a 200 us gate pulse; the slow work (the web
                  server) runs only right after a pulse, so nothing delays the next one
    the power     P / Pfull = 1 - a / pi + sin(2a) / (2 pi) for a firing angle a (0 = full, pi = off); the sketch
                  solves it for a by bisection; the delay = a / pi x the measured half-cycle (0.3 - 9.4 ms)
    soft start    every new level is reached over 0.5 s; HARD ON jumps to 100 % at once - the cold filament's surge
    SUNRISE       from 0 to 100 % power over 30 s (a wake-up light; 30 minutes in a bedroom)
    the mains     the half-cycle from the zeros (a running mean): the frequency; NO MAINS when no edge comes for 100 ms
    no display    a full OLED frame takes about 25 ms on I2C - more than two half-cycles without a gate pulse
  Its pages:
    /             the dashboard with the links Refresh, OFF, 25 %, 50 %, 75 %, 100 %, HARD ON and SUNRISE
    /data         JSON: the level, the target, the firing delay and angle, the mains frequency, sunrise, mains
  Libraries: WiFi and WebServer (part of the ESP32 core).

TEST STATUS
  Tested in Proteus 8 Professional on Windows 11, the run that made the tutorial's screenshots (the triac's pop-up
  measures its own firing angle and the share of full power - the check of every number the sketch gives):
  - 2.25 s MAINS 50.2 Hz; 50 % (soft start): fired 5.01 ms after the zero (90 deg) - the triac: 5.0 ms, 90 deg,
    about 50 % of full power; 2.51 A, the junction heading for 81 C with no heatsink.
  - 25 %: 6.34 ms (114 deg) - the triac: 6.4 ms, 115 deg, about 24 %; the filament at 1888 K, 13 lm.
  - 100 %: 0.30 ms - the triac: 0.8 ms (14 deg), about 100 %; the filament at 2766 K, 355 lm.
  - OFF: the filament cooled to 375 K within 2.5 s. HARD ON: about 15 A in the first half-cycles (twelve times the
    lamp's working current), full light after 216 ms; with the soft start the pulses' 4 ms average stayed low.
  - SUNRISE over 30 s: 34 % (105 deg, 2043 K) after 9 s, 68 % (73 deg, 2487 K) after 18 s, 100 % at 53.5 s.
  - 56.1 s of simulation in 482 s.
  - Our first runs: the mains check read micros() before the last edge's time - an edge in between wrapped the
    unsigned difference and NO MAINS flickered; now copied first and compared signed. Four links in one row wrapped on
    the laptop and the taps hit the wrong links: rows of two.

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 the files from "Proteus Model Files" into the MODELS folder (next to LIBRARY). The ALTERNATOR is part of
     Proteus itself.
  4. Start Proteus. Press P in the schematic and search for ESP32 DEVKIT V1 or TRIACBT136TEP to check that the parts
     are there.

RUN THE SIMULATION
  1. Open "Proteus Simulation\ESP32-Triac-Dimmer.pdsprj". Keep ESP32_Triac_Dimmer.hex and the DLL files beside it.
  2. Press Play. The lamp comes up softly to 50 % of its power. Click Q1 for the triac's pop-up: its firing angle,
     the voltage and the current of the last two cycles.
  3. Open the Laptop or the Mobile WiFi Monitor (Go): 25 / 50 / 75 / 100 %, OFF, HARD ON and SUNRISE.

PROPERTIES USED IN THIS PROJECT
  U1 ESP32 DEVKIT V1           PROGRAM=ESP32_Triac_Dimmer.hex
  V1 ALTERNATOR                AMP=17V, FREQ=50Hz
  L1 BULBP21WTEP; Q1 TRIACBT136TEP HEATSINK=NONE; U2 PC817TEP; D1 DIODE1N4007TEP
  R1 100 ohm, R2 2k2, R3 10k (RESISTOR4BANDTEP); PC1, MOB1 HOMEPAGE=http://192.168.1.101/

TROUBLESHOOTING
  * The lamp never lights: the gate from D26 through R1 to G, T1 to ground; the zero-cross on D27 (NO MAINS on the
    dashboard means no edges).
  * The lamp flickers: something in loop() waits - a display, a long Serial print, a delay(); the gate pulse is timed
    there.
  * The power is a little off at the extremes: the PC817's edges are not exactly 250 us from the zero for every
    voltage; on a real dimmer, measure and adjust ZC_US.
  * On 230 V mains: never connect the ESP32 to the mains side - fire the triac through an opto-triac (MOC3021) and
    use a mains-rated zero-cross detector; a dimmer on the mains is for experienced builders only.

LICENCES
  * The project, the sketch, 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.
  * The .hex file is built with the TEP Boards for Proteus.
  * Proteus and its ALTERNATOR are products of Labcenter Electronics and are not included. ESP32 is a product of
    Espressif Systems. This project is not made or endorsed by them.

VERSION
  V1.0 - the first release of the project.
===============================================================================================================
Advertisement

Development1 release

  1. V1.0TRIAC Lamp Dimmer with ESP32 - 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.

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. 1

    Extract the archive

    Right-click ef0362da748d4628b73aaf97bd545488.zip and choose Extract All (or open it with 7-Zip or WinRAR) into a folder you can find again. Keep its folder structure (ESP32-Triac-Dimmer-TEP-v1.0) as it is.

  2. 2

    Copy the library files into Proteus

    Move TEP1N4007.LIB, TEPBULB.LIB and TEPESP32V1.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. 3

    Add the simulation model

    Copy TEP1N4007.DLL, TEPBULB.DLL and TEPNET.DLL and 3 more into the MODELS folder next to LIBRARY, so the component can run, not only be drawn.

  4. 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. 5

    Open the sketch in the Arduino IDE

    Open ESP32_Triac_Dimmer.ino, select your board and port under Tools, then Verify. Sketch → Export Compiled Binary writes the HEX file a simulation needs.

  6. 6

    Load the HEX file

    In Proteus double-click the microcontroller, set Program File to ESP32_Triac_Dimmer.hex and run the simulation. For real hardware, flash the same file with your programmer.

  7. 7

    Open the example simulation

    Open ESP32-Triac-Dimmer.pdsprj in Proteus to see the wiring exactly as in the tutorial. Check the controller's Program File path, then press Play.

  8. 8

    Follow the tutorial

    TRIAC Lamp Dimmer with ESP32 - Proteus Simulation explains every connection and setting in order; keep it open beside the files while you build.

How to add a library in Proteus 8

FAQs9 questionsContact TEP

How do I download TRIAC Lamp Dimmer with ESP32 - 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?

TRIAC Lamp Dimmer with ESP32 - Proteus Simulation V1.0 comes as a ZIP archive of 24 files (4.3 MB, 9.5 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 24 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, c8813e2ab008958a77adc63824a2f2d50e06c3ec3ddcc56a504e08b36be9b440. In PowerShell run Get-FileHash "ef0362da748d4628b73aaf97bd545488.zip"; on macOS or Linux run shasum -a 256 "ef0362da748d4628b73aaf97bd545488.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.

preparing · ef0362da748d4628b73aaf97bd545488.zip
Rating
Your download will be ready shortly
Preparing your download…

Members skip the wait. Log in or join TEP.

Last 14 days0 downloads
SHA-256 c8813e2ab008958a77adc63824a2f2d50e06c3ec3ddcc56a504e08b36be9b440
DocumentationTRIAC Lamp Dimmer with ESP32 - Proteus Simulation
Need help with this file? Bug report Ask a question Download problemsGet updates
Advertisement

Comments

0

Join the conversation

Start the conversationAsk a question or share how you used this download.