This is the latestย Digital Temperature Sensorย DS18B20 from Maxim IC (but sourced from Sparkfun). The DS18B20 sensor measures temperature in degrees Celsius with 9 to 12-bit precision, -55C to 125C (+/-0.5C). Each temp sensor has a unique 64-bit serial number programmed into it which allows for a huge number of sensors to be used on one data bus. The best Arduino temperature sensorย is a wonderful part that is the cornerstone of many data-logging and temperature control projects.
Features & Specifications Of DS18B20 Bestย Temperature Sensor:
- Unique 1-Wireยฎ interface requires only one port pin for communication.
- Each device has a unique 64-bit serial code stored in an onboard ROM.
- Multidrop capability simplifies distributed temperature sensing applications.
- Requires no external components.
- It can be powered from the data line. Power supply range is 3.0V to 5.5V.
- Measures temperatures from โ55ยฐC to +125ยฐC (โ67ยฐF to +257ยฐF).
- ยฑ0.5ยฐC accuracy from โ10ยฐC to +85ยฐC.
- Thermometer resolution is user-selectable from 9 to 12 bits.
- Converts temperature to 12-bit digital word in 750ms (max.).
- User-definable nonvolatile (NV) alarm settings.
- Alarm search command identifies and addresses devices whose temperature is outside of programmed limits (temperature alarm condition).
- Applications include thermostatic controls, industrial systems, consumer products, thermometers, or any thermally sensitive system.
Applications Ofย DS18B20 Digital Temperature Sensor for Arduino:
- Thermostatic Controls
- Industrial Systems
- Consumer Products
- Thermometers
- Thermally Sensitive Systems
Datasheet Of DS18B20:
Package Includes:
- 1 xย DS18B20 Temperature Sensor
Best Online Shopping website for Best Arduino Temperature Sensorย DS18B20 Digital Temp Sensorย in cheap price in Karachi, Lahore, Islamabad, Rawalpindi, Sukkur, Peshawar, Multan, Quetta, Faisalabad and all over Pakistan.
ย
//===================
Example Code
// Include the libraries we need
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.ย
DallasTemperature sensors(&oneWire);
// arrays to hold device address
DeviceAddress insideThermometer;
/*
ย * Setup function. Here we do the basics
ย */
void setup(void)
{
ย // start serial port
ย Serial.begin(9600);
ย Serial.println(“Dallas Temperature IC Control Library Demo”);
ย // locate devices on the bus
ย Serial.print(“Locating devices…”);
ย sensors.begin();
ย Serial.print(“Found “);
ย Serial.print(sensors.getDeviceCount(), DEC);
ย Serial.println(” devices.”);
ย // report parasite power requirements
ย Serial.print(“Parasite power is: “);ย
ย if (sensors.isParasitePowerMode()) Serial.println(“ON”);
ย else Serial.println(“OFF”);
ย ย
ย // Assign address manually. The addresses below will beed to be changed
ย // to valid device addresses on your bus. Device address can be retrieved
ย // by using either oneWire.search(deviceAddress) or individually via
ย // sensors.getAddress(deviceAddress, index)
ย // Note that you will need to use your specific address here
ย //insideThermometer = { 0x28, 0x1D, 0x39, 0x31, 0x2, 0x0, 0x0, 0xF0 };
ย // Method 1:
ย // Search for devices on the bus and assign based on an index. Ideally,
ย // you would do this to initially discover addresses on the bus and thenย
ย // use those addresses and manually assign them (see above) once you knowย
ย // the devices on your bus (and assuming they don’t change).
ย if (!sensors.getAddress(insideThermometer, 0)) Serial.println(“Unable to find address for Device 0”);ย
ย ย
ย // method 2: search()
ย // search() looks for the next device. Returns 1 if a new address has been
ย // returned. A zero might mean that the bus is shorted, there are no devices,ย
ย // or you have already retrieved all of them. It might be a good idea toย
ย // check the CRC to make sure you didn’t get garbage. The order isย
ย // deterministic. You will always get the same devices in the same order
ย //
ย // Must be called before search()
ย //oneWire.reset_search();
ย // assigns the first address found to insideThermometer
ย //if (!oneWire.search(insideThermometer)) Serial.println(“Unable to find address for insideThermometer”);
ย // show the addresses we found on the bus
ย Serial.print(“Device 0 Address: “);
ย printAddress(insideThermometer);
ย Serial.println();
ย // set the resolution to 9 bit (Each Dallas/Maxim device is capable of several different resolutions)
ย sensors.setResolution(insideThermometer, 9);
ย
ย Serial.print(“Device 0 Resolution: “);
ย Serial.print(sensors.getResolution(insideThermometer), DEC);ย
ย Serial.println();
}
// function to print the temperature for a device
void printTemperature(DeviceAddress deviceAddress)
{
ย // method 1 – slower
ย //Serial.print(“Temp C: “);
ย //Serial.print(sensors.getTempC(deviceAddress));
ย //Serial.print(” Temp F: “);
ย //Serial.print(sensors.getTempF(deviceAddress)); // Makes a second call to getTempC and then converts to Fahrenheit
ย // method 2 – faster
ย float tempC = sensors.getTempC(deviceAddress);
ย Serial.print(“Temp C: “);
ย Serial.print(tempC);
ย Serial.print(” Temp F: “);
ย Serial.println(DallasTemperature::toFahrenheit(tempC)); // Converts tempC to Fahrenheit
}
/*
ย * Main function. It will request the tempC from the sensors and display on Serial.
ย */
void loop(void)
{ย
ย delay(2000);
ย // call sensors.requestTemperatures() to issue a global temperatureย
ย // request to all devices on the bus
ย Serial.print(“Requesting temperatures…”);
ย sensors.requestTemperatures(); // Send the command to get temperatures
ย Serial.println(“DONE”);
ย ย
ย // It responds almost immediately. Let’s print out the data
ย printTemperature(insideThermometer); // Use a simple function to print out the data
}
// function to print a device address
void printAddress(DeviceAddress deviceAddress)
{
ย for (uint8_t i = 0; i < 8; i++)
ย {
ย ย if (deviceAddress[i] < 16) Serial.print(“0”);
ย ย Serial.print(deviceAddress[i], HEX);
ย }
}
Reviews
There are no reviews yet.