This free DS18B20 library for Proteus adds the two DS18B20 parts people really buy to Proteus 8: the black DS18B20 waterproof probe with its steel tube and red, yellow and black wires, and the small DS18B20 module with the 4.7 k pull-up and a power LED on the board. Both have the three pins VCC, DQ, GND.
Proteus ships only the bare TO-92 chip. This DS18B20 Proteus model shows the temperature right on the part, changes it with a click, and answers on the 1-Wire bus exactly like the real sensor, so your Arduino sketch reads it with the OneWire and DallasTemperature libraries. Put several sensors on one pin, set alarms, change the resolution, or try parasite power.
With the DS18B20 library for Proteus installed, place DS18B20 WATERPROOF PROBE or DS18B20 MODULE, wire DQ to D2 of an Arduino UNO (the probe also needs a 4.7 k resistor from DQ to 5 V), and run. Click the + and – on the part to change the temperature.
DS18B20 Library for Proteus: Features
| Feature | DS18B20 Proteus model |
|---|---|
| Two parts | DS18B20 WATERPROOF PROBE (add your own 4.7 k pull-up) and DS18B20 MODULE (pull-up and power LED on the board: the LED lights when VCC is powered) |
| Live readout | The temperature is shown on the part. Click + or – while the simulation runs to change it (0.5 °C per click by default), from -55 to 125 °C |
| 1-Wire bus | Reset and presence pulse, read and write time slots as in the datasheet. Works with the OneWire library timing on AVR and with the Maxim AN126 timing |
| Several sensors on one pin | Each sensor has its own 64-bit ROM code. getDeviceCount(), Search ROM and Match ROM work with 2, 3, 8 or more sensors on the same wire |
| Resolution | 9, 10, 11 or 12 bit (0.5 to 0.0625 °C), with the real conversion times: 94, 188, 375 and 750 ms |
| Alarms | TH and TL alarm limits, checked after each conversion. Alarm Search finds only the sensors that are too hot or too cold |
| EEPROM | Copy Scratchpad saves TH, TL and the resolution, Recall E2 loads them back |
| Parasite power | Tie the probe’s VCC to GND and the sensor runs from the data line, as in the datasheet. Without a strong pull-up during the conversion it fails like the real one |
| Power pins like the real one | VCC and GND are really read: a loose VCC wire gives 85 °C, a loose GND wire and the sensor is not found, and the module’s pull-up and LED work only with VCC connected |
| Hints | No pull-up on DQ, VCC or GND not connected, reading too early, two sensors with the same serial, parasite power without the strong pull-up: a warning in the Proteus log says what to change |
| Boards | Arduino UNO, Nano, Mega, ESP32 and any microcontroller that can drive a 1-Wire pin |
DS18B20 Proteus Model: Pins and Wiring
| Pin | Probe wire | What it does | Arduino UNO (example below) |
|---|---|---|---|
| VCC | red | Supply, 3.0 to 5.5 V. On the probe, tie it to GND for parasite power | 5V |
| DQ | yellow | 1-Wire data (open drain) | D2 |
| GND | black | Ground | GND |
The 1-Wire data line needs a 4.7 k pull-up resistor from DQ to VCC. The DS18B20 module has it on the board, so you just wire it up. With the waterproof probe, add one resistor per bus (not one per sensor). If you forget it, the Proteus log tells you.
Wire both power pins: the model reads VCC and GND like the real sensor. With VCC not connected the sensor is still found (it takes power from DQ) but every reading is 85 °C; with GND not connected it does not answer at all. On the module the 4.7 k resistor and the power LED hang on VCC, so without VCC there is no pull-up and no LED, and the module cannot use parasite power.
Put several probes and modules on the same DQ wire. Each DS18B20 has its own serial number, so the Arduino finds them all and reads each one by its address. In Proteus every part gets its own serial from its name (TP1, TP2, TM1 …), and it stays the same every time you run.
Example: Arduino DS18B20 Temperature Sensor in Proteus
This Arduino DS18B20 Proteus example uses an Arduino UNO with up to three sensors on pin D2. At the start it prints how many sensors it found and their addresses. Then every second it prints each temperature in °C and °F on a Virtual Terminal. When any sensor reaches 30 °C or more (or -10 °C or less), it prints >>> TEMPERATURE ALARM <<< and lights the UNO’s L LED.
- Place an Arduino UNO, a Virtual Terminal, and two or three sensors: for example a DS18B20 WATERPROOF PROBE and a DS18B20 MODULE.
- Wire every DQ to D2, every VCC to 5 V and every GND to GND.
- Add one 4.7 k resistor from D2 to 5 V (with only modules on the bus you can leave it out).
- Terminal RX on the UNO TX (9600 baud).
- In the Arduino IDE, install OneWire (Paul Stoffregen) and DallasTemperature (Miles Burton) with Tools → Manage Libraries.
[IMAGE 2: arduino-ds18b20-proteus.webp | alt: ]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
// DS18B20 test for the ElectronicsTree Proteus model (ETDS18B20.DLL)
//
// Circuit (Arduino UNO):
// Up to 3 DS18B20 on one 1-Wire bus: every DQ -> D2, VCC -> 5 V, GND -> GND.
// One 4.7 k resistor from D2 to 5 V (the DS18B20 MODULE has it on the board).
// Virtual Terminal on TX (9600 baud).
// The UNO's own L LED (D13) lights while any sensor is at 30 degC or more.
//
// Libraries: OneWire (Paul Stoffregen) and DallasTemperature (Miles Burton)
// (Tools -> Manage Libraries, search them by name).
#include <OneWire.h>
#include <DallasTemperature.h>
const int ONE_WIRE_PIN = 2;
const int LED = 13;
const int8_t ALARM_HIGH = 30; // degC
const int8_t ALARM_LOW = -10; // degC
OneWire oneWire(ONE_WIRE_PIN);
DallasTemperature sensors(&oneWire);
DeviceAddress addr[8];
int count = 0;
void printAddress(const DeviceAddress a) {
for (int i = 0; i < 8; i++) {
if (a[i] < 16) Serial.print('0');
Serial.print(a[i], HEX);
if (i < 7) Serial.print(' ');
}
}
void setup() {
Serial.begin(9600);
pinMode(LED, OUTPUT);
Serial.println();
Serial.println(F("================================"));
Serial.println(F(" DS18B20 SENSOR TEST"));
Serial.println(F("================================"));
sensors.begin();
count = sensors.getDeviceCount();
Serial.print(F("Sensors found: "));
Serial.println(count);
if (count == 0) {
Serial.println(F("No sensor: check DQ and the 4.7k pull-up"));
while (1);
}
if (count > 8) count = 8;
Serial.print(F("Power: "));
Serial.println(sensors.isParasitePowerMode() ? F("parasite") : F("normal"));
for (int i = 0; i < count; i++) {
sensors.getAddress(addr[i], i);
sensors.setResolution(addr[i], 12);
sensors.setHighAlarmTemp(addr[i], ALARM_HIGH);
sensors.setLowAlarmTemp(addr[i], ALARM_LOW);
Serial.print(F("Sensor "));
Serial.print(i + 1);
Serial.print(F(": "));
printAddress(addr[i]);
Serial.println();
}
Serial.println();
}
void loop() {
sensors.requestTemperatures(); // all sensors convert together (750 ms at 12 bit)
for (int i = 0; i < count; i++) {
float c = sensors.getTempC(addr[i]);
Serial.print(F("Sensor "));
Serial.print(i + 1);
Serial.print(F(": "));
if (c == DEVICE_DISCONNECTED_C) {
Serial.println(F("error"));
continue;
}
Serial.print(c, 2);
Serial.print(F(" C "));
Serial.print(DallasTemperature::toFahrenheit(c), 2);
Serial.println(F(" F"));
}
// alarm search: only sensors at >= 30 degC or <= -10 degC answer
bool alarm = sensors.hasAlarm();
digitalWrite(LED, alarm ? HIGH : LOW);
if (alarm) Serial.println(F(">>> TEMPERATURE ALARM <<<"));
Serial.println();
delay(1000);
}Export the .hex file (Sketch → Export Compiled Binary), load it into the UNO and press Play. The terminal shows Sensors found: 2, both addresses (they start with 28, the DS18B20 family code), and then a line per sensor every second, for example Sensor 1: 25.00 C 77.00 F. Click + on the probe until it shows 30.00: the next reading prints the alarm and the L LED lights.
New to simulating an Arduino? Our Arduino UNO R3 library for Proteus shows how to load a sketch, and the virtual serial terminal shows the messages.
Wire the probe’s VCC to GND instead of 5 V and run again. The sketch prints Power: parasite and the readings still come: DallasTemperature sees the parasite sensor and holds the data line high during each conversion, as the datasheet asks.
DS18B20 Library for Proteus: Properties
Double-click the probe or the module to change it:
| Property | What it does | Default |
|---|---|---|
| Temperature | The temperature the sensor measures, -55 to 125 °C. The + and – clicks change it while the simulation runs | 25 |
| Temperature Step per Click | How much one click on + or – changes it, in °C | 0.5 |
| Serial Number | AUTO = made from the part’s name, so every sensor has its own. Or type 12 hex digits, for example FF641E0F7A4C, to match a real sensor’s address | AUTO |
| Power-Up Resolution | 9, 10, 11 or 12 bit. The sketch can change it with setResolution() | 12 |
Under Advanced Properties: the alarm limits TH and TL that the sensor has in its EEPROM at power-up (75 and 70 °C, the factory values), the on-board pull-up (No on the probe, Yes on the module), and a log of the 1-Wire commands and conversions in the simulation log.
DS18B20 Proteus Troubleshooting
If the Arduino finds no sensor or reads odd values, check these first. The DS18B20 library for Proteus also writes a hint in the simulation log for the usual mistakes.
| What you see | Cause and fix |
|---|---|
Sensors found: 0 | No 4.7 k pull-up on DQ (the probe needs one), GND not connected, a module with VCC not connected (its pull-up has no supply), or DQ is not on the pin in the sketch |
| -127 °C | DallasTemperature returns -127 when it gets no answer: check the wiring. It also returns -127 for the power-on value 85 °C and for exactly -55.0 °C: that is the library, a real sensor does the same |
| 85 °C | The power-on value. Either VCC is not connected (the sensor answers but resets in every conversion: wire VCC to 5 V), or the sketch read it before a conversion: call requestTemperatures() first |
| Module: the bus does not work, LED off | The module’s VCC is tied to GND or not connected. Wire it to 5 V: only the bare probe can run on parasite power |
| The temperature changes one reading late | A new temperature is measured at the next conversion, like on the real sensor |
| Two sensors show the same address | You typed the same Serial Number in both. Leave it on AUTO, or give each a different one |
| Parasite power reads -127 or 85 | The data line needs a strong pull-up during the conversion. DallasTemperature does it; with your own OneWire code use ds.write(0x44, 1) |
| Steps of 0.5 °C only | The resolution is 9 bit. Set it to 12 bit in the properties or with sensors.setResolution(12) |
Download the DS18B20 Library for Proteus
The zip file of the DS18B20 library for Proteus holds the model ETDS18B20.DLL and the library ElectronicsTree[DS18B20].LIB with the parts DS18B20 WATERPROOF PROBE and DS18B20 MODULE.
Installing it takes two minutes (see the steps right below). Looking for more parts? Browse all our free Proteus libraries.
We’re always looking to expand our library collection based on what our community needs. If you’re looking for a specific Arduino module, sensor, or component that we don’t currently offer, we’d love to hear from you!
Reach out to us at help@electronicstree.com with your requests. We prioritize new library development based on community demand, so your suggestion could be our next addition.
Join the official WhatsApp channel of ElectronicsTree to stay updated with the latest electronics tutorials, Proteus libraries, Arduino projects, and simulation resources.
How to Install the DS18B20 Library for Proteus 8
New to adding libraries? Our guide how to install a library in Proteus 8 shows where the Proteus folders are.
- Close Proteus.
- Copy the files into the Proteus data folder, normally
C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\DATAETDS18B20.DLLgoes intoDATA\MODELSElectronicsTree[DS18B20].LIBgoes intoDATA\LIBRARY
Program Files: click Continue. - Start Proteus, open Pick Devices (press P) and search for
DS18B20. The parts are in the category Sensor and Modules.
The DS18B20 library for Proteus is a library, not Proteus itself: the software comes from Labcenter Electronics, who also offer a free demo on their website.
Frequently Asked Questions
Is there a DS18B20 library for Proteus?
Yes. This free DS18B20 library for Proteus adds the DS18B20 waterproof probe and the DS18B20 module to Proteus 8, with a live temperature readout, several sensors on one pin, alarms and parasite power.
How do I connect the DS18B20 to an Arduino in Proteus?
Connect DQ to a digital pin such as D2, VCC to 5 V and GND to GND, and add a 4.7 k resistor from DQ to 5 V. The DS18B20 module already has this resistor on the board.
Why does the DS18B20 read -127 in Proteus?
DallasTemperature returns -127 when the sensor does not answer, usually a missing pull-up or a wrong pin. It also returns -127 for the power-on value 85 degC and for exactly -55 degC, on real hardware too.
Can I use several DS18B20 sensors on one pin in Proteus?
Yes. Connect all DQ pins together. Each part has its own 64-bit address, so getDeviceCount() finds them all and you read each one by its address or index.
Does the DS18B20 Proteus model work with the DallasTemperature library?
Yes. The sketch on this page uses OneWire and DallasTemperature: begin, getDeviceCount, getAddress, requestTemperatures, getTempC, setResolution, alarms and parasite power all work as on the real sensor.
Does the DS18B20 library work with an ESP32 in Proteus?
Yes. The DS18B20 runs at 3.3 V or 5 V and works with any board that can drive a 1-Wire pin.
Is this DS18B20 Proteus library free?
Yes. Download the DS18B20 library for Proteus from this page. The zip holds the model DLL and the library.
More Libraries for Proteus
Like the DS18B20 library for Proteus? Try these next:
- OLED library for Proteus: show the temperature on a display
- DHT11 library for Proteus: add humidity with a DHT11 or DHT22
- BME280 library for Proteus: temperature, humidity and pressure over I2C
- DS3231 library for Proteus: log the temperature with the time
- Arduino relay module library for Proteus: switch a fan or a heater at a set temperature
Conclusion
This DS18B20 library for Proteus lets you build and test your Arduino thermometer, thermostat or temperature logger before the hardware is on the desk: the waterproof probe and the module, a temperature you change with a click, several sensors on one pin, alarms and parasite power, with hints for the usual mistakes.
Questions, or a module you want next? Write them in the comments!