Editor Version ×

1.Easy to use and quick to get started

2.The process supports design scales of 300 devices or 1000 pads

3.Supports simple circuit simulation

4.For students, teachers, creators


1.Brand new interactions and interfaces

2.Smooth support for design sizes of over 30,000 devices or 100,000 pads

3.More rigorous design constraints, more standardized processes

4.For enterprises, more professional users

STD One Wire Digital Temperature Sensor

Project Status: Ongoing


  • 4.5k
  • 0
  • 0
Creation time: 2015-12-20 13:44:43
Update time: 2021-04-10 22:44:16
## Arduino drives A single wire digital temperature sensor ## DS18B20 fromMaxim (formerly Dallas) is a great chip to measure temperature in your project. Fortunately, the Dallas emperature library which makes use of the sensor is easy to Arduino. In the latest version of the library can be found here http://www.milesburton.com/?title=Dallas_Temperature_Control_Library We used version 3.6.0 for this tutorial which can also be downloaded in last Drag and drop the DallasTemperture folder into my arduino/libraries folder The DS18B20 can be powered by 5.5V to 3.0V, so you can simply connect the GND pin to the 0V and VDD pins for the +5V from the Arduino. However, DS18B20 can also be extracted from the data line, which means that we only need two wires to connect their power. Which makes it very suitable for use as an external sensor. Arduino is received from the DQ pin to pin 2 on the board (which can be any Arduino digital pin) Pull it up to 5V a 10k ohm on pull resistor, which is required in the DQ pin Here is our sensor installed on the bread board ![ One Wire Digital Temperature Sensor][1] Next, add the following sketch and upload it to your Arduino mega 2560. The use of the Dallas temperature library makes it easy to get the temperature.

// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup(void)
  // start serial port
  Serial.println("Dallas Temperature IC Control Library Demo");

  // Start up the library
void loop(void)

  Serial.print(" Requesting temperatures...");

  Serial.print("Temperature for Device 1 is: ");

When you have uploaded the sketch, click on the Serial Monitor and you should see output like the following. The temperature is in degrees C ![One Wire Digital Temperature Sensor - DS18B20][2] [1]: /editor/20151221/5676da6ec7542.JPG [2]: /editor/20151221/5676dc6b7e4eb.jpg
Design Drawing
schematic diagram
1 /
1 /
The preview image was not generated, please save it again in the editor.
ID Name Designator Footprint Quantity
1 Arduino MEGA 2560 U1 DIP 1
2 DS18B20 U2 DS18B20_SOIC 1
3 10k R1 R3 1


Project Attachments
Order File name Download times


Project Members
Target complaint
Related Projects
Change a batch
Add to album ×


reminder ×

Do you need to add this project to the album?


周一至周五 9:00~18:00
  • 0755 - 2382 4495
  • 153 6159 2675


周一至周五 9:00~18:00
  • 立创EDA微信号


  • QQ交流群


  • 立创EDA公众号