Project Files of SGP40 VOC Sensor Library for Proteus Simulation
c1abbf6d92cd48d284529e7a30c3a064.zip

SGP40 VOC Sensor Library for Proteus V1.0
SGP40 VOC Sensor Library for Proteus V1.0 comes as a ZIP archive of 16 files (1.8 MB, 4.1 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
SGP40-VOC-Sensor-Library-for-Proteus-v1.0.zip with the SGP40 VOC sensor for Proteus simulation (TEPSGP40.LIB and TEPSGP40.DLL), our RGB LED and Resistor libraries, our Arduino UNO V4.0, the A4 demo with its sketch and a README.
File Structure
4.6 KB201.9 KB306.9 KB13.9 KB14.6 KB883.5 KB311 KB287 KB324 KB23.4 KB25.6 KB883.5 KB311 KB287 KB324 KB15.4 KBGallery12 images from the tutorialOpen the tutorial
The circuit, the board and the results as they appear in SGP40 VOC Sensor Library for Proteus Simulation. Open an image for its full size.












README
SGP40 VOC SENSOR LIBRARY FOR PROTEUS SIMULATION - V1.0 (a metal-oxide VOC sensor over I2C, 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/sgp40-voc-sensor-library-for-proteus.html
Report a bug or suggest a feature (our forum):
https://www.theengineeringprojects.com/forum/category/ccs811-air-quality-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 demo's lamp is our RGB LED library (in this zip; its article):
https://www.theengineeringprojects.com/2026/11/rgb-led-library-for-proteus.html
Its resistors are our Resistor library (in this zip):
https://www.theengineeringprojects.com/2026/11/resistor-library-for-proteus.html
Support us (the libraries are free):
https://www.theengineeringprojects.com/donate
FILE STRUCTURE
SGP40-VOC-Sensor-TEP-v1.0/
|-- Proteus Library Files/
| |-- ArduinoV4TEP.LIB 201.9 KB TEP Arduino boards V4.0 (UNO) -> LIBRARY
| |-- TEPRESISTOR.LIB 306.9 KB a part the demo uses -> LIBRARY folder
| |-- TEPRGB.LIB 13.9 KB a part the demo uses -> LIBRARY folder
| |-- TEPSGP40.LIB 14.6 KB the library -> LIBRARY folder
|-- Proteus Model Files/
| |-- TEPARDUINO.DLL 883.5 KB the Arduino board model -> MODELS folder
| |-- TEPRESISTOR.DLL 311.0 KB its model -> MODELS folder
| |-- TEPRGB.DLL 287.0 KB its model -> MODELS folder
| |-- TEPSGP40.DLL 324.0 KB the model -> MODELS folder
|-- Proteus Simulation/
| |-- SGP40_Demo.hex 25.6 KB the demo firmware
| |-- SGP40-VOC-ArduinoUnoV4.pdsprj 23.4 KB the demo project
| |-- TEPARDUINO.DLL 883.5 KB copy of the board model
| |-- TEPRESISTOR.DLL 311.0 KB copy of its model
| |-- TEPRGB.DLL 287.0 KB copy of its model
| |-- TEPSGP40.DLL 324.0 KB copy of the model
|-- Arduino Code/
| |-- SGP40_Demo/SGP40_Demo.ino 4.6 KB the demo sketch (source of the .hex)
|-- README.txt ~16.2 KB this file
Total: 4.12 MB (unzipped). The C++ source code of the models is not included.
WHAT IS IT?
An SGP40 metal-oxide (MOX) VOC sensor module, drawn at its real size (20 x 14 mm) from above: the
blue board, the tiny
sensor (a 2.44 mm package with a metal lid and a membrane over its hotplate), a 3.3 V regulator, the
I2C pull-ups and three
LEDs. The module is our own drawing (no maker's mark); the commands, their timing and the
compensation follow the maker's own
driver for the SGP40:
* I2C at 0x59. Every command is a 16-bit word, sent high byte first; every data word, both ways,
is followed by a CRC-8
(polynomial 0x31, start value 0xFF).
* measure_raw_signal (0x260F) carries two words - the relative humidity (ticks = %RH x 65535 /
100) and the temperature
(ticks = (C + 45) x 65535 / 175) - each with its CRC; 0x8000 and 0x6666 (50 %RH, 25 C) leave the
compensation off. 30 ms
later it returns SRAW_VOC, a number that follows the logarithm of the sensing layer's
resistance: it FALLS when VOCs
rise. The first measure_raw_signal switches the hotplate on; send it once a second.
* execute_self_test (0x280E): 320 ms, then 0xD400 (passed) or 0x4B00 (failed). turn_heater_off
(0x3615): the hotplate
off, idle. get_serial_number (0x3682): three words.
* The sensor gives no VOC index of its own: the maker's index (0 - 500, 100 = an average day) is
an algorithm that runs
on the host. Our demo sketch makes a simple index of its own.
* On the sheet the module comes alive at Run: PWR lights with the supply, I2C flashes with every
transfer, HEAT lights
while the hotplate runs, and the hotplate glows through the lid (the I2C and HEAT LEDs and the
glow are our
additions). Click it at Run for the pop-up: the hotplate and its MOX layer with the VOC
molecules, SRAW and the VOCs over
the room's clock, the readings and the air chips; 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.
ONE DEVICE (search "SGP40" or "VOC" in Pick Devices):
SGP40TEP "SGP40 VOC Sensor V1.0" in TEPSGP40.LIB (Sensors > Gas), prefix U, model TEPSGP40.DLL
(mixed: analog and
digital). Four pins along the bottom: VCC (3.3 - 5 V), GND, SCL, SDA.
THE POP-UP
Click the part at Run. Tabs:
VOC Sensor chips: the air (Fresh 30, Lived-in 150, Cooking 600, Paint 2000 ppb), Spray (a
cleaning spray), Hood on (the
VOCs drawn out) and Kitchen (the profile again from minute 0). The hotplate - the
MOX layer between its two
electrodes, glowing while the heater runs, with the VOC molecules landing on it;
SRAW (blue, left scale) and
the room's VOCs (grey, right scale, log) over the room's clock; eight tiles: the
last SRAW, the VOCs at the
hotplate, the heater, the compensation, the measurements, the I2C traffic, the room
and the self-test.
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 19 Nov 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; the demo ran 88 simulated seconds (almost 18 minutes of
the kitchen at SPEED 12) in 407 s
on our PC with the pop-up open and the pictures being taken.
* Power on at 2 ms; the sketch ran the self-test at 66 ms (320 ms, then 0xD400 - passed) and sent
the first measure_raw_signal at
407 ms, compensated for 50.0 %RH and 24.0 C: the hotplate came on (the HEAT LED, the glow) and
the first SRAW values (31735,
31152) settled to 28606 at 10 s while the lamp was blue (the warm-up); the sketch took its
baseline (about 28400) at 12 s.
* Clean air at 16 s: SRAW 28309, 62 ppb at the hotplate, the lamp green. The cooking started at
room minute 3: SRAW 25260 at 25 s
(yellow), 23999 at 38 s with 551 ppb at the hotplate (red); the cooking stopped at room minute
8.
* The cleaning spray at room minute 11: 2050 ppb at the hotplate and SRAW 20927 at 58 s - VERY
HIGH VOCs, the lamp red, the
sketch's index at the top of its scale (500).
* The hood at room minute 14: SRAW 25418 at 77 s (yellow), green at 82 s, 27703 at 88 s (80 ppb at
the hotplate).
* 88 measurements 999 ms apart, 89 commands, 0 not acknowledged, 0 CRC errors, the compensation
sent, the self-test passed.
The pop-up: VOC Sensor, Graphs, Event log, Check - all four followed the run.
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" (TEPSGP40.LIB, TEPRGB.LIB, TEPRESISTOR.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 TEPSGP40.DLL, TEPRGB.DLL, TEPRESISTOR.DLL and TEPARDUINO.DLL from "Proteus Model Files" to
the MODELS folder (...\Proteus 8 Professional\MODELS).
4. Delete TEPSGP40.IDX from the LIBRARY folder if it is there (Proteus makes a new index).
5. Start Proteus. In Pick Devices (P) search "SGP40".
RUN THE DEMO
"Proteus Simulation\SGP40-VOC-ArduinoUnoV4.pdsprj" (an A4 sheet) - keep the .hex file and the DLLs
beside the project.
A kitchen air lamp:
ARD1: Arduino UNO V4.0 running SGP40_Demo.hex, its serial monitor built in (window "TEP Arduino
UNO - ARD1").
U1: the SGP40 module: PROFILE KITCHEN, VOC 60, TEMP 24, HUMIDITY 50, SPEED 12 (12 seconds of
the kitchen each simulated
second); VCC on VCC, GND, SCL on A5, SDA on A4.
D1: our RGB LED (common cathode): R on D9 through 150 ohm (R1), G on D10 and B on D11 through
100 ohm each.
The sketch runs the self-test, then sends measure_raw_signal once a second with the room's
humidity and
temperature as compensation words and reads SRAW. It skips the hotplate's first 12
seconds, learns the SRAW of
clean air, and makes a simple VOC index: 100 x e^((baseline - SRAW) / 4000), 1 - 500.
Green under 150, yellow up to
250, red above.
Closed the monitor? Click the UNO's USB port.
WIRING (the same in Proteus and on a real board)
VCC to 3.3 V or 5 V (the module has its own 3.3 V regulator), GND to ground, SCL to the I2C clock
(A5 on an UNO), SDA to
the I2C data (A4). The module has 10 k pull-ups, so a 5 V board reads it without a level shifter.
REAL HARDWARE:
* A new SGP40 needs time: the first minutes after power-on its readings settle, and the maker's
index learns the room over
hours. Run it continuously and measure once a second.
* Send the real humidity and temperature in every measure_raw_signal (from a sensor such as the
SHT31 or the BME280):
without them, humid air looks like VOCs.
* The sensor is for indoor air; keep it away from silicone vapours and conformal coating, which
poison the MOX layer.
* The hotplate draws a few mA while it runs: turn_heater_off saves power, but the next readings
start cold.
THE DEMO SKETCH ON THE SERIAL MONITOR (SGP40_Demo V1.0, 9600 baud)
The sketch prints every third measurement and every change of the lamp. EXPECTED MONITOR OUTPUT
SGP40 kitchen air lamp - The Engineering Projects
Self-test 0xD400 - passed
Measuring once a second - the hotplate settles for 12 s
Baseline .....
#15 t=.. s SRAW ..... VOC index ...
>> GOOD - green
PROPERTIES (double-click the part > Edit Properties)
The room (PROFILE) STEADY (the VOC below; the chips change it) or KITCHEN
(cooking at minute 3, a cleaning
spray at minute 11, the hood at minute 14) (KITCHEN)
The VOCs at the start (VOC) 0 - 30000 ppb, ethanol equivalent (60)
Temperature, humidity (TEMP, HUMIDITY) the room's: C (24), % (50)
The room clock (SPEED) 1 real time, 60 a minute each simulated second (12)
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 TEPSGP40.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
* No answer while measuring: the measurement takes 30 ms - wait before the read. During the
self-test (320 ms) the sensor
does not answer either.
* measure_raw_signal ignored with a warning: it needs both compensation words with their CRCs - 8
bytes in all.
* SRAW high at the start: the hotplate is still warming up; skip the first seconds.
* Humid air reads as VOCs: send the real humidity and temperature instead of the defaults.
* The part is not simulated: TEPSGP40.DLL is missing from MODELS and from the project folder.
* The part is not simulated: TEPSGP40.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/ccs811-air-quality-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 (TEPSGP40.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\SGP40_Demo\SGP40_Demo.ino, select Arduino Uno and use Sketch > Export Compiled Binary.
Replace the simulation's .hex with the exported HEX. The sketch needs 9,310 bytes of flash and 517
bytes of RAM.
MODEL SCOPE AND LIMITS
Modelled: the commands, their busy times and their replies with CRC-8; the hotplate on with the
first measurement and off
with turn_heater_off; the compensation words; SRAW from the VOCs at the hotplate, the warm-up after
the heater comes on, the
humidity and temperature effect without compensation, the noise; the self-test and the serial
number; the room (PROFILE,
SPEED, the chips), the sensor following it with tau 20 s of the room's clock, the supply current.
Our choices: SRAW = 30000 -
2600 ln(1 + VOC / 60 ppb); while a command runs the sensor does not answer its address. Not
modelled: the maker's VOC index
algorithm (that runs on the host), the sensitivity to each gas, the drift and the ageing of a real
MOX layer.
VERSION
TEP SGP40 VOC Sensor library V1.0 (Nov 2026). Device SGP40TEP (TEPSGP40.LIB / TEPSGP40.DLL). Demo
sketch SGP40_Demo V1.0 (plain Wire, CRC-8, our own simple index). The demo also uses our RGB LED
(TEPRGB: LEDRGBCCTEP) and Resistor (TEPRESISTOR) libraries, shipped in this package. Demo board:
ARDUINO UNO V4.0 (TEP Arduino Library V4.0) with its built-in serial monitor.Development1 release
-
V1.0SGP40 VOC Sensor 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 c1abbf6d92cd48d284529e7a30c3a064.zip and choose Extract All (or open it with 7-Zip or WinRAR) into a folder you can find again. Keep its folder structure (SGP40-VOC-Sensor-TEP-v1.0) as it is.
- 2
Copy the library files into Proteus
Move ArduinoV4TEP.LIB, TEPRESISTOR.LIB and TEPRGB.LIB and 1 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, TEPRESISTOR.DLL and TEPRGB.DLL and 1 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 SGP40_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 SGP40_Demo.hex and run the simulation. For real hardware, flash the same file with your programmer.
- 7
Open the example simulation
Open SGP40-VOC-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
SGP40 VOC Sensor Library for Proteus Simulation explains every connection and setting in order; keep it open beside the files while you build.
FAQs9 questionsContact TEP
How do I download SGP40 VOC Sensor 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?
SGP40 VOC Sensor Library for Proteus V1.0 comes as a ZIP archive of 16 files (1.8 MB, 4.1 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 16 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, 32ccb72386cce4c2ce38ad42409e8a3f5aa6059be6169a4dfdd7f534d3724b12. In PowerShell run Get-FileHash "c1abbf6d92cd48d284529e7a30c3a064.zip"; on macOS or Linux run shasum -a 256 "c1abbf6d92cd48d284529e7a30c3a064.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
- 25 Nov 2026Uploaded at
32ccb72386cce4c2ce38ad42409e8a3f5aa6059be6169a4dfdd7f534d3724b12
















Comments
0