Project Files of Soil NPK Sensor Library for Proteus Simulation
4ba49eb28bba4909a70f4426301d4af3.zip

Soil NPK Sensor Library for Proteus V1.0
Soil NPK Sensor Library for Proteus V1.0 comes as a ZIP archive of 22 files (2.5 MB, 5.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
Soil-NPK-Sensor-Library-for-Proteus-v1.0.zip with the RS485 soil NPK sensor for Proteus simulation (TEPSOILNPK.LIB and TEPSOILNPK.DLL), our MAX485, OLED, 5 mm LED and resistor libraries, our Arduino UNO V4.0, the A4 demo with its sketch and a README.
File Structure
8.7 KB201.9 KB21.8 KB59.2 KB112.4 KB306.9 KB17.1 KB883.5 KB289.5 KB281.5 KB342.5 KB311 KB319.5 KB27.7 KB25 KB883.5 KB289.5 KB281.5 KB342.5 KB311 KB319.5 KB15.2 KBGallery12 images from the tutorialOpen the tutorial
The circuit, the board and the results as they appear in Soil NPK Sensor Library for Proteus Simulation. Open an image for its full size.
README
SOIL NPK SENSOR LIBRARY FOR PROTEUS SIMULATION - V1.0 (an RS485 Modbus probe, 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/soil-npk-sensor-library-for-proteus.html
Report a bug or suggest a feature (our forum):
https://www.theengineeringprojects.com/forum/category/capacitive-soil-moisture-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 UNO talks to the probe through our MAX485 RS-485 module (in this zip; its article):
https://www.theengineeringprojects.com/2026/10/max485-rs485-module-library-for-proteus-v1-0.html
The readings are drawn on our SSD1306 OLED (in this zip; its article):
https://www.theengineeringprojects.com/2026/10/oled-ssd1306-library-for-proteus-v1-0.html
Support us (the libraries are free):
https://www.theengineeringprojects.com/donate
FILE STRUCTURE
Soil-NPK-Sensor-TEP-v1.0/
|-- Proteus Library Files/
| |-- ArduinoV4TEP.LIB 201.9 KB TEP Arduino boards V4.0 (UNO) -> LIBRARY
| |-- TEPLED5MM.LIB 21.8 KB a part the demo uses -> LIBRARY folder
| |-- TEPMAX485.LIB 59.2 KB a part the demo uses -> LIBRARY folder
| |-- TEPOLED12864.LIB 112.4 KB a part the demo uses -> LIBRARY folder
| |-- TEPRESISTOR.LIB 306.9 KB a part the demo uses -> LIBRARY folder
| |-- TEPSOILNPK.LIB 17.1 KB the library -> LIBRARY folder
|-- Proteus Model Files/
| |-- TEPARDUINO.DLL 883.5 KB the Arduino board model -> MODELS folder
| |-- TEPLED5MM.DLL 289.5 KB its model -> MODELS folder
| |-- TEPMAX485.DLL 281.5 KB its model -> MODELS folder
| |-- TEPOLED.DLL 342.5 KB its model -> MODELS folder
| |-- TEPRESISTOR.DLL 311.0 KB its model -> MODELS folder
| |-- TEPSOILNPK.DLL 319.5 KB the model -> MODELS folder
|-- Proteus Simulation/
| |-- SoilNPK_Demo.hex 25.0 KB the demo firmware
| |-- SoilNPK-RS485-ArduinoUnoV4.pdsprj 27.7 KB the demo project
| |-- TEPARDUINO.DLL 883.5 KB copy of the board model
| |-- TEPLED5MM.DLL 289.5 KB copy of its model
| |-- TEPMAX485.DLL 281.5 KB copy of its model
| |-- TEPOLED.DLL 342.5 KB copy of its model
| |-- TEPRESISTOR.DLL 311.0 KB copy of its model
| |-- TEPSOILNPK.DLL 319.5 KB copy of the model
|-- Arduino Code/
| |-- SoilNPK_Demo/SoilNPK_Demo.ino 8.7 KB the demo sketch (source of the .hex)
|-- README.txt ~15.4 KB this file
Total: 5.52 MB (unzipped). The C++ source code of the models is not included.
WHAT IS IT?
An RS485 soil NPK probe - the common three-needle probe that estimates nitrogen, phosphorus and
potassium - drawn from the front
and compact: the black epoxy head with its label plate and two LEDs (PWR and COM - a TEP addition),
three stainless needles (shortened in
the drawing) and the four-wire cable (brown V+, black GND, yellow A, blue B) ending in a wire block
with the four pins. The probe is our
own drawing (no vendor's mark); the protocol follows the register map the vendors' manuals and the
Arduino tutorials use:
* RS485, Modbus-RTU, 9600 baud, 8 data bits, no parity, 1 stop bit, address 1; the pair as on our
MAX485 module (A high and B low = 1).
* Function 0x03 (and 0x04) reads nitrogen 0x001E, phosphorus 0x001F, potassium 0x0020 in mg/kg (0
- 1999), the address 0x07D0 and
the baud code 0x07D1 (0 = 2400, 1 = 4800, 2 = 9600); 0x06 writes the last two. One request reads
all three: 01 03 00 1E 00 03 65 CD.
* CRC-16 (0xA001), the low byte first; exceptions 1 (an unknown function), 2 (no such register), 3
(a bad value); no answer to a
wrong CRC, another address or without a supply. The answer comes 20 ms after the request has
ended.
* Supply 5 - 30 V (the demo: 12 V); a new measurement every second, following the soil with a 1.5
s lag.
* The soil in a scene (PROFILE DEMO: a poor vegetable bed - N 30, P 12, K 95 mg/kg; fertiliser at
4 s - towards N 140, P 62, K 210;
heavy rain at 11 s - the nitrogen washes out to 35, some potassium to 185, the phosphorus
stays).
* On the sheet the probe comes alive at Run: PWR lights with the supply, COM flashes with every
answer. Click it at Run for the
pop-up: the probe in the soil with the nutrients as coloured grains, the last Modbus frames byte
by byte, the readings and the soil
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 "NPK" or "soil" in Pick Devices):
SOILNPKTEP "Soil NPK Sensor V1.0" in TEPSOILNPK.LIB (Sensors > Soil), prefix U, model
TEPSOILNPK.DLL (mixed: VCC, GND analog; A, B the
RS485 pair). Four pins along the bottom: VCC (5 - 30 V), GND, A, B.
THE POP-UP
Click the part at Run. Tabs:
Soil NPK Sensor chips: Sandy, Garden, Compost, Potting; Fertilise, Rain; Demo (the scene again
from now).
The probe in the soil (the nutrients as grains, the rain, the fertiliser) and the
last six Modbus frames with their
bytes and meaning; eight tiles: nitrogen, phosphorus, potassium, the soil, the
address and baud rate, requests and
answers, CRC errors and exceptions, the supply.
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 20 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 19 simulated seconds in about 3 minutes on
our PC with the pop-up open and the
pictures being taken.
* RS485 through our MAX485 module at 9600 baud 8N1: the request 01 03 00 1E 00 03 65 CD every two
seconds, 10 requests and 10 answers
(11 bytes each, 20 ms after the request), no wrong CRC, no exception.
* The poor bed: N 30, P 13, K 94 mg/kg at the first measurement (0.4 s) - "LOW: N P K", the red
LED on.
* Fertiliser at 4 s: N 89, P 39, K 158 at 6.6 s ("all fine", the green LED), N 134, P 58, K 204 at
10.6 s.
* Heavy rain at 11 s: N 109 at 12.6 s, 64 at 14.6 s, 44 at 16.6 s ("LOW: N") and 38 at 18.6 s; P
stays near 60, K falls to 185.
* The probe on +12 V, 12 mA; the pop-up (Soil NPK Sensor, Graphs, Event log, Check) 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" (TEPSOILNPK.LIB, TEPMAX485.LIB, TEPOLED12864.LIB,
TEPLED5MM.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 TEPSOILNPK.DLL, TEPMAX485.DLL, TEPOLED.DLL, TEPLED5MM.DLL, TEPRESISTOR.DLL and
TEPARDUINO.DLL from "Proteus Model Files" to the MODELS folder (...\Proteus 8 Professional\MODELS).
4. Delete TEPSOILNPK.IDX from the LIBRARY folder if it is there (Proteus makes a new index).
5. Start Proteus. In Pick Devices (P) search "NPK".
RUN THE DEMO
"Proteus Simulation\SoilNPK-RS485-ArduinoUnoV4.pdsprj" (an A4 sheet) - keep the .hex file and the
DLLs beside the project.
A garden bed's nutrients:
ARD1: Arduino UNO V4.0 running SoilNPK_Demo.hex, its serial monitor built in (window "TEP
Arduino UNO - ARD1").
U1: our MAX485 RS-485 module (MAX485ADVTEP): RO on D8, DI on D9, DE and RE on D2; A and B to
the probe.
U2: the soil NPK probe: PROFILE DEMO (the poor bed, fertiliser at 4 s, heavy rain at 11 s),
ADDRESS 1; VCC on +12V, GND, A, B.
U3: our SSD1306 OLED, 128 x 64, yellow and blue (0x3C, I2C on A4 / A5): SOIL OK / FERTILISE in
big letters, then N, P and K as
bars with their marks and values (LOW under the mark).
D1, D2: OK (green, D5) when all three are at or above their marks (N 50, P 25, K 120 mg/kg - this
demo's); LOW (red, D6) when any
is under. Each through 220 ohm.
Every two seconds the sketch sends 01 03 00 1E 00 03 + CRC through AltSoftSerial, waits
for the 11-byte answer and checks
its CRC.
Closed the monitor? Click the UNO's USB port.
WIRING (the same in Proteus and on a real board)
The probe: brown to 5 - 30 V (12 V is common), black to ground, yellow (A) to the RS485 module's
A, blue (B) to its B.
The MAX485 module: VCC 5 V, GND; RO to the UNO's RX pin (D8 with AltSoftSerial), DI to TX (D9), DE
and RE together to any pin (D2):
high while sending, low while listening. Join the probe's ground and the UNO's ground.
REAL HARDWARE:
* Push all three needles fully into moist soil, without a stone in the way; in dry or loose soil
the readings drop.
* These probes estimate N, P and K from the soil's conductivity: use them for trends and
comparisons, not as a laboratory test.
* Check the baud rate on your probe's label (4800 on some) and set it in the sketch; a new rate
(0x07D1) counts after the next
power-up.
* Long RS485 runs need a 120 ohm terminator at each end; keep A to A and B to B (swapped, nothing
answers).
THE DEMO SKETCH ON THE SERIAL MONITOR (SoilNPK_Demo V1.0, 9600 baud)
The sketch prints its request and a line every two seconds. EXPECTED MONITOR OUTPUT
Soil NPK monitor - The Engineering Projects
Request: 01 03 00 1E 00 03 + CRC (N, P, K from 0x001E)
N .. P .. K .. mg/kg LOW: N P K
PROPERTIES (double-click the part > Edit Properties)
The soil (PROFILE) DEMO (the poor bed, fertiliser, rain) or STEADY (N, P, K;
the chips change it) (DEMO)
Nitrogen for STEADY (N) mg/kg (60)
Phosphorus for STEADY (P) mg/kg (30)
Potassium for STEADY (K) mg/kg (150)
The Modbus address (ADDRESS) 1 - 247 (1)
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 TEPSOILNPK.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 from the probe": A and B swapped, no supply on VCC, a different ADDRESS, or DE / RE
still high when the answer comes.
* The CRC is wrong: the baud rate or the frame format (8N1) differs; the event log shows the bytes
the probe saw.
* Exception 2: the register is not 0x001E - 0x0020, 0x07D0 or 0x07D1.
* The readings do not change: the probe measures once a second - and the soil itself changes slowly.
* The part is not simulated: TEPSOILNPK.DLL is missing from MODELS and from the project folder.
* The part is not simulated: TEPSOILNPK.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/capacitive-soil-moisture-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 (TEPSOILNPK.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\SoilNPK_Demo\SoilNPK_Demo.ino, select Arduino Uno and use Sketch > Export Compiled
Binary. Replace the simulation's .hex with the exported HEX. The sketch needs 9,092 bytes of flash
and 692 bytes of RAM.
MODEL SCOPE AND LIMITS
Modelled: the RS485 pair, Modbus-RTU (0x03, 0x04, 0x06, the CRC, the exceptions, the address), the
register map, the
measurement each second, the supply; the scene and the chips. Our choices: 0x04 answered like 0x03,
the 20 ms before an answer, the 1.5 s
lag, 1 mg/kg of noise, the scene, the LEDs. Not modelled: the other baud rates during a run, the
effect of soil moisture and
temperature on the readings, the probe's accuracy class.
VERSION
TEP Soil NPK Sensor library V1.0 (Nov 2026). Device SOILNPKTEP (TEPSOILNPK.LIB / TEPSOILNPK.DLL).
Demo sketch SoilNPK_Demo V1.0 (AltSoftSerial 1.4 and Wire - the Modbus master written out by hand).
The demo also uses our MAX485 RS-485 library (TEPMAX485: MAX485ADVTEP), our SSD1306 OLED library
(TEPOLED12864: OLED12864YELLOWBLUEADVTEP, TEPOLED.DLL), our 5 mm LED library (TEPLED5MM) and our
resistor library (TEPRESISTOR), shipped in this package. Demo board: ARDUINO UNO V4.0 (TEP Arduino
Library V4.0) with its built-in serial monitor.Development1 release
-
V1.0Soil NPK 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 4ba49eb28bba4909a70f4426301d4af3.zip and choose Extract All (or open it with 7-Zip or WinRAR) into a folder you can find again. Keep its folder structure (Soil-NPK-Sensor-TEP-v1.0) as it is.
- 2
Copy the library files into Proteus
Move ArduinoV4TEP.LIB, TEPLED5MM.LIB and TEPMAX485.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 TEPARDUINO.DLL, TEPLED5MM.DLL and TEPMAX485.DLL and 3 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 SoilNPK_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 SoilNPK_Demo.hex and run the simulation. For real hardware, flash the same file with your programmer.
- 7
Open the example simulation
Open SoilNPK-RS485-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
Soil NPK 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 Soil NPK 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?
Soil NPK Sensor Library for Proteus V1.0 comes as a ZIP archive of 22 files (2.5 MB, 5.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 22 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, 58651f3f23dce4e72aa3c8ecd7b8bf4237441b427a2daae208d922b04d46c9a5. In PowerShell run Get-FileHash "4ba49eb28bba4909a70f4426301d4af3.zip"; on macOS or Linux run shasum -a 256 "4ba49eb28bba4909a70f4426301d4af3.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
- 26 Nov 2026Uploaded at
58651f3f23dce4e72aa3c8ecd7b8bf4237441b427a2daae208d922b04d46c9a5



























Comments
0