Temperatur messen mit dem DS18B20

Temperatur messen mit dem DS18B20

Besteht mal der Bedarf an einer Temperatur Messung ist der DS18B20 ideal dafuer geeignet. 

DS18B20 Wasserdicht

Gemessen wird mit einem One Wire Bus. Durch diesen Bus ist es moeglich an einem Daten-Pin des Arduino mehrer Messfuehler anzuschliessen. Denn Pins einsparen ist immer von Vorteil.

Beschaltung des DS18B20

Und nun noch der entsprechende Sketch.

#include <OneWire.h>

// OneWire DS18S20, DS18B20, DS1822 Temperature Example
// http://www.pjrc.com/teensy/td_libs_OneWire.html
// The DallasTemperature library can do all this work for you!
// http://milesburton.com/Dallas_Temperature_Control_Library

OneWire  ds(2);  // on pin 10 (a 4.7K resistor is necessary)

void setup(void) {

void loop(void) {
  byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  float celsius, fahrenheit;
  if ( !ds.search(addr)) {
    Serial.println("No more addresses.");
  Serial.print("ROM =");
  for( i = 0; i < 8; i++) {
    Serial.write(' ');
    Serial.print(addr[i], HEX);

  if (OneWire::crc8(addr, 7) != addr[7]) {
      Serial.println("CRC is not valid!");
  // the first ROM byte indicates which chip
  switch (addr[0]) {
    case 0x10:
      Serial.println("  Chip = DS18S20");  // or old DS1820
      type_s = 1;
    case 0x28:
      Serial.println("  Chip = DS18B20");
      type_s = 0;
    case 0x22:
      Serial.println("  Chip = DS1822");
      type_s = 0;
      Serial.println("Device is not a DS18x20 family device.");

  ds.write(0x44, 1);        // start conversion, with parasite power on at the end

  present = ds.reset();
  ds.write(0xBE);         // Read Scratchpad

  Serial.print("  Data = ");
  Serial.print(present, HEX);
  Serial.print(" ");
  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data[i] = ds.read();
    Serial.print(data[i], HEX);
    Serial.print(" ");
  Serial.print(" CRC=");
  Serial.print(OneWire::crc8(data, 8), HEX);

  int16_t raw = (data[1] << 8) | data[0];
  if (type_s) {
    raw = raw << 3; // 9 bit resolution default
    if (data[7] == 0x10) {
      // "count remain" gives full 12 bit resolution
      raw = (raw & 0xFFF0) + 12 - data[6];
  } else {
    byte cfg = (data[4] & 0x60);
    // at lower res, the low bits are undefined, so let's zero them
    if (cfg == 0x00) raw = raw & ~7;  // 9 bit resolution, 93.75 ms
    else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms
    else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms
    //// default is 12 bit resolution, 750 ms conversion time
  celsius = (float)raw / 16.0;
  fahrenheit = celsius * 1.8 + 32.0;
  Serial.print("  Temperature = ");
  Serial.print(" Celsius, ");
  Serial.println(" Fahrenheit");

88 Kommentare

KiaAnoky Veröffentlicht am5:35 pm - Jan 20, 2021

[url=http://forcepharmacy.com/]italian pharmacy online[/url]

Direct Lenders Veröffentlicht am3:01 pm - Jan 20, 2021

[url=http://midiloans.com/]loans secured[/url] [url=http://loansmf.com/]bank loans[/url] [url=http://etalending.com/]express cash advance[/url] [url=http://ipdadvance.com/]direct lenders online[/url] [url=http://loansqt.com/]all payday lenders[/url]

FsbxAncef Veröffentlicht am6:16 am - Jan 20, 2021

penis pump viagra viagra uk viagra walmart price [url=http://genericrxxx.com/]buy viagra australia[/url] ’

LisaAnoky Veröffentlicht am5:53 am - Jan 20, 2021

[url=https://cialisduo.com/]cialis 20 mg daily use[/url]

windows 6 activator Veröffentlicht am3:38 am - Jan 20, 2021

Good day! Do you know if they make any plugins to help with Search Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success. If you know of any please share. Many thanks!|


Verlie Foutain Veröffentlicht am2:43 am - Jan 20, 2021

Hey,. . My site went down a while ago now, i just need to know how to upload my backup file back onto the site, is it on the dashboard in wordpress or on cpanel or something?. . Thanks..


CarlAnoky Veröffentlicht am12:49 am - Jan 20, 2021

[url=http://ventolinhaler.com/]albuterol tablets india[/url] [url=http://cialistrial.com/]cialis 10mg best price[/url] [url=http://hydroxychloroquinezts.com/]hydroxychloroquine 25 mg[/url] [url=http://cialisstrong.com/]buy brand cialis online[/url] [url=http://viagragenericsildenafil.com/]viagra voucher[/url]

jordan shoes Veröffentlicht am6:07 pm - Jan 19, 2021

Thanks for all your valuable labor on this web page. Kim take interest in participating in investigations and it’s really easy to understand why. My spouse and i hear all concerning the dynamic means you convey helpful thoughts through the web site and as well recommend contribution from people about this concept plus our child is actually starting to learn a lot of things. Enjoy the remaining portion of the new year. You have been carrying out a great job.
jordan shoes

Jvcbxcrike Veröffentlicht am3:29 pm - Jan 19, 2021

cialis us pharmacy online cialis generic cialis denmark [url=http://phrcialiled.com/]cialis usa[/url] ’

windows loader 32 bit Veröffentlicht am2:32 pm - Jan 19, 2021

Inspiring quest there. What occurred after? Thanks!|


NlbxAgedo Veröffentlicht am12:33 am - Jan 19, 2021

cialis canada pharmacy no prescription required health plus cialis viagra vs cialis reviews [url=http://cialijomen.com/]prolonged effects of cialis[/url] ’

windows loader uninstall other cracks Veröffentlicht am5:30 pm - Jan 18, 2021

You made some really good points there. I checked on the net for additional information about the issue and found most individuals will go along with your views on this site.|


AmyAnoky Veröffentlicht am11:23 pm - Jan 17, 2021

[url=http://viagragenericsildenafil.com/]where can you buy generic viagra[/url]

Tamika Brodin Veröffentlicht am12:27 pm - Jan 17, 2021

Your style is very unique compared to other folks I’ve read stuff from. Thank you for posting when you have the opportunity, Guess I’ll just bookmark this page.|


AmyAnoky Veröffentlicht am7:56 am - Jan 17, 2021

[url=http://lipitorpill.com/]cost of lipitor 20 mg[/url]

Speedycash Veröffentlicht am4:55 am - Jan 17, 2021

[url=http://midiloans.com/]money loan[/url] [url=http://refloans.com/]private loans[/url] [url=http://etalending.com/]installment loans no credit check same day[/url] [url=http://kobeloans.com/]cash advance payday loan[/url] [url=http://lamaloans.com/]payday loans uk[/url] [url=http://mustlending.com/]personal loans with low interest rates[/url]

Online Payday Loans Veröffentlicht am4:52 am - Jan 17, 2021

[url=http://lynloans.com/]loans in ohio[/url]

superbeets review Veröffentlicht am7:56 am - Jan 16, 2021

Amazing! This blog looks just like my old one! It’s on a totally different topic but it has pretty much the same page layout and design. Excellent choice of colors!|
superbeets review

Jin Mockus Veröffentlicht am4:01 am - Jan 16, 2021

Howdy would you mind letting me know which webhost you’re using? I’ve loaded your blog in 3 completely different web browsers and I must say this blog loads a lot faster then most. Can you recommend a good internet hosting provider at a reasonable price? Cheers, I appreciate it!|


Direct Lender Loans Veröffentlicht am9:39 pm - Jan 15, 2021

[url=http://exaloans.com/]christmas payday loans[/url]

Suzanne Autrey Veröffentlicht am4:37 pm - Jan 15, 2021

WOW just what I was searching for. Came here by searching for meta_keyword|


DenAnoky Veröffentlicht am1:10 pm - Jan 15, 2021

[url=http://chloroquineorder.com/]chloroquine 500[/url] [url=http://propeciapharm.com/]where to get finasteride[/url] [url=http://viagradoit.com/]price of 100mg viagra[/url] [url=http://lexaprobuy.com/]price of brand name lexapro[/url] [url=http://levitrader.com/]levitra generic online[/url]

Payday Loan Veröffentlicht am9:08 am - Jan 15, 2021

[url=http://loansmf.com/]loans zoom reviews[/url] [url=http://refloans.com/]quick loans no credit check[/url] [url=http://koaloans.com/]no faxing payday loan[/url] [url=http://etalending.com/]payday mask[/url] [url=http://loanstk.com/]instant payday loans no credit check[/url]

Gertrud Aasen Veröffentlicht am6:03 am - Jan 15, 2021

Thank you, I have recently been looking for info approximately this topic for a while and yours is the best I’ve found out so far. However, what concerning the conclusion? Are you positive in regards to the supply?|


MaryAnoky Veröffentlicht am4:55 am - Jan 15, 2021

[url=https://cialispoi.com/]cialis discount[/url] [url=https://anspharmacy.com/]uk pharmacy[/url] [url=https://cialisteva.com/]cialis canadian pharmacy online[/url] [url=https://ivermectinnorx.com/]ivermectin 8000[/url] [url=https://viagra2x.com/]sildenafil 25 mg price[/url] [url=https://cialisduo.com/]discount cialis online canada[/url] [url=https://nrgpharmacy.com/]italian pharmacy online[/url] [url=https://amoxicillinmedication.com/]augmentin 825[/url] [url=https://zithromaxpack.com/]buy zithromax z-pak[/url] [url=https://viagrazett.com/]buy viagra online cheap usa[/url]

JudyAnoky Veröffentlicht am10:40 pm - Jan 14, 2021

[url=http://creamtretinoin.com/]retin a india buy[/url] [url=http://cialisteva.com/]generic cialis otc[/url] [url=http://chloroquineorder.com/]buy aralen pills[/url] [url=http://phenerganonline.com/]phenergan over the counter in uk[/url] [url=http://propeciaff.com/]buy propecia online no rx[/url] [url=http://edviagra.com/]female pink viagra[/url] [url=http://viagrahard.com/]viagra for sale cheap[/url] [url=http://anspharmacy.com/]online pharmacy without scripts[/url] [url=http://hydroxychloroquinehcqn.com/]can you buy plaquenil over the counter[/url] [url=http://zithromaxtb.com/]zithromax 1g[/url]

clarkericky Veröffentlicht am3:44 pm - Jan 14, 2021

It’s perfect time to make some plans for the future and it is time to be happy.
I’ve read this post and if I could I desire to suggest you few interesting things or suggestions.
Maybe you can write next articles referring to this article.

I want to read more things about it! Life Experience Degree

steveclarke Veröffentlicht am3:42 pm - Jan 14, 2021

I’m really enjoying the design and layout of your website. It’s a very easy on the eyes which makes it much more enjoyable for me to come here and visit more often. Did you hire out a designer to create your theme? Outstanding work! Life Experience Degrees

Money Loan Veröffentlicht am3:10 pm - Jan 14, 2021

[url=https://exaloans.com/]online payday loan[/url]

Norman Poorte Veröffentlicht am10:30 am - Jan 14, 2021

I was suggested this web site by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my problem. You’re wonderful! Thanks!|


Lazaro Behun Veröffentlicht am1:53 am - Jan 14, 2021

What a information of un-ambiguity and preserveness of valuable experience concerning unexpected feelings.|


LisaAnoky Veröffentlicht am1:36 am - Jan 14, 2021

[url=https://synthroidrem.com/]synthroid 175[/url]

Daniela Laninga Veröffentlicht am2:59 pm - Jan 13, 2021

I don’t know whether it’s just me or if everybody else encountering issues with your site. It appears as if some of the written text in your content are running off the screen. Can somebody else please comment and let me know if this is happening to them as well? This might be a issue with my web browser because I’ve had this happen before. Thank you|


LokuAncef Veröffentlicht am8:25 am - Jan 13, 2021

canada online pharmacy online canadian pharmacy canada rx pharmacy

Trish Winget Veröffentlicht am11:48 pm - Jan 12, 2021

Sweet blog! I found it while browsing on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Thank you|


JtmfAncef Veröffentlicht am11:59 am - Jan 12, 2021

canadian pharmacy generic viagra pharmacies near me п»їviagra online canadian pharmacy

Instant Online Loans Veröffentlicht am9:51 pm - Jan 11, 2021

payday loans bad credit

FgvdAgedo Veröffentlicht am9:17 pm - Jan 11, 2021

ed pills that work quickly pharm discount rx

Lane Niccoli Veröffentlicht am8:26 pm - Jan 11, 2021

Hello, I think your blog might be having web browser compatibility issues. Whenever I look at your site in Safari, it looks fine however when opening in I.E., it has some overlapping issues. I simply wanted to give you a quick heads up! Aside from that, wonderful site!|


Zaida Mccra Veröffentlicht am11:22 am - Jan 11, 2021

This is really interesting, You are a very skilled blogger. I’ve joined your rss feed and look ahead to looking for extra of your magnificent post. Additionally, I have shared your website in my social networks|


Juliet Burck Veröffentlicht am9:15 pm - Jan 10, 2021

If you want to obtain much from this article then you have to apply such methods to your won webpage.|


FwsxAncef Veröffentlicht am11:08 am - Jan 10, 2021

best erectile dysfunction pills best ed pills pharmacies near me

AmyAnoky Veröffentlicht am9:45 am - Jan 10, 2021

flonase canada over the counter

Garret Kidner Veröffentlicht am7:12 am - Jan 10, 2021

Hi, its nice post about media print, we all be familiar with media is a fantastic source of facts.|


Lisabeth Lamica Veröffentlicht am10:11 pm - Jan 9, 2021

I am truly thankful to the holder of this site who has shared this fantastic post at here.|


Jllocrike Veröffentlicht am8:19 pm - Jan 9, 2021

ed pills that work quickly best drugstore mascara ed pills that work quickly

NllpAgedo Veröffentlicht am7:35 pm - Jan 9, 2021

erectile best drug store foundation canadian pharmacy online

Paydayloan Veröffentlicht am7:11 pm - Jan 9, 2021

top payday loan companies

LisaAnoky Veröffentlicht am12:12 pm - Jan 9, 2021

buy cialis over the counter usa

LisaAnoky Veröffentlicht am5:30 am - Jan 9, 2021

hydroxychloroquine 90

Treasa Degracia Veröffentlicht am5:12 am - Jan 9, 2021

Hi there, yup this paragraph is really fastidious and I have learned lot of things from it concerning blogging. thanks.|


AmyAnoky Veröffentlicht am8:37 pm - Jan 8, 2021

usa pharmacy

Ardith Kellison Veröffentlicht am5:47 pm - Jan 8, 2021

Hello, I enjoy reading through your article. I wanted to write a little comment to support you.|


Dorthey Warsing Veröffentlicht am8:17 am - Jan 8, 2021

Helpful information. Fortunate me I discovered your website accidentally, and I am surprised why this coincidence didn’t took place earlier! I bookmarked it.|


cialis price Veröffentlicht am10:59 pm - Jan 7, 2021

I am commenting to let you know of the fine encounter my friend’s daughter found reading your site. She figured out many issues, not to mention what it’s like to have a wonderful giving mindset to have men and women quite simply have an understanding of selected hard to do subject areas. You really exceeded our expectations. Many thanks for giving the insightful, safe, explanatory and as well as easy thoughts on the topic to Jane. https://azzaroelectric.com/

viagra cheap Veröffentlicht am6:45 pm - Jan 7, 2021

Thank you for every one of your labor on this web site. My daughter really loves managing investigations and it’s really obvious why. Most people learn all regarding the lively mode you present rewarding techniques through this web site and even inspire participation from some others on the point then our favorite princess is really starting to learn a whole lot. Take advantage of the rest of the year. You are always doing a splendid job. https://habebihookahbar.com/

Douglass Colo Veröffentlicht am4:17 pm - Jan 7, 2021

Thanks for every other informative site. Where else could I am getting that type of info written in such a perfect manner? I have a challenge that I am simply now running on, and I have been on the look out for such information.|


generic tadalafil Veröffentlicht am3:39 pm - Jan 7, 2021

I am glad for writing to make you know what a magnificent encounter my friend’s girl gained studying your web site. She learned several pieces, which include what it’s like to possess an awesome helping nature to let other folks very easily know just exactly several multifaceted subject matter. You truly exceeded people’s expectations. Thank you for presenting these powerful, safe, explanatory and in addition fun tips about this topic to Kate. https://hillsdaledowcenter.com/

Reanna Blunden Veröffentlicht am6:35 am - Jan 7, 2021

No matter if some one searches for his vital thing, therefore he/she needs to be available that in detail, thus that thing is maintained over here.|


amoxicillin next day shipping Veröffentlicht am5:44 am - Jan 7, 2021

amoxicillin next day shipping https://amoxycillin1st.com/

purchase sildenafil Veröffentlicht am5:04 am - Jan 7, 2021

I am commenting to let you know of the fantastic encounter my cousin’s daughter experienced reading your site. She even learned many issues, not to mention what it’s like to have a wonderful giving mindset to have many people quite simply grasp chosen grueling subject areas. You really exceeded our expectations. Many thanks for giving the informative, healthy, educational and as well as easy thoughts on the topic to Jane. https://johnpisanohomeimprovements.com/

cvs pharmacy coupons for dapoxetine Veröffentlicht am4:04 am - Jan 7, 2021

cvs pharmacy coupons for dapoxetine https://ddapoxetine.com/

Jazmin Ednie Veröffentlicht am7:17 pm - Jan 6, 2021

Hello colleagues, good post and good arguments commented at this place, I am genuinely enjoying by these.|


Quyen Crumby Veröffentlicht am9:35 am - Jan 6, 2021

I’m gone to inform my little brother, that he should also visit this weblog on regular basis to obtain updated from most recent gossip.|


Mildred Veröffentlicht am5:26 pm - Jan 5, 2021

Taxi moto line
128 Rue la Boétie
75008 Paris
+33 6 51 612 712  

Taxi moto paris

What’s up Dear, are you in fact visiting this website
on a regular basis, if so after that you will definitely
get nice experience.

My webpage: hey

Joel Zauner Veröffentlicht am10:27 am - Jan 5, 2021

I do not even understand how I stopped up right here, however I thought this put up used to be great. I do not know who you’re but certainly you’re going to a well-known blogger if you happen to aren’t already. Cheers!|


Beau Sigman Veröffentlicht am1:29 am - Jan 5, 2021

Asking questions are truly pleasant thing if you are not understanding anything totally, except this paragraph gives good understanding even.|


who makes vidalista Veröffentlicht am9:17 pm - Jan 4, 2021

who makes vidalista https://vidalista.mlsmalta.com/

Tomas Grilli Veröffentlicht am2:08 pm - Jan 4, 2021

Pretty component to content. I just stumbled upon your website and in accession capital to assert that I get in fact enjoyed account your weblog posts. Any way I’ll be subscribing to your feeds and even I achievement you get right of entry to consistently fast.|


nolvadex tamoxifen Veröffentlicht am6:05 pm - Jan 3, 2021

nolvadex tamoxifen https://tamoxifen.mrdgeography.com/

Wesley Cucchiara Veröffentlicht am8:18 am - Jan 3, 2021

This is really interesting, You’re a very skilled blogger. I’ve joined your rss feed and look forward to seeking more of your excellent post. Also, I’ve shared your web site in my social networks!|


KiaAnoky Veröffentlicht am2:13 am - Jan 3, 2021

price of viagra 100mg uk

Pay Day Loans Veröffentlicht am1:00 am - Jan 3, 2021


LisaAnoky Veröffentlicht am3:27 pm - Jan 2, 2021

us online pharmacy cialis

Issac Cater Veröffentlicht am5:11 am - Jan 2, 2021

You really make it seem really easy with your presentation however I in finding this matter to be actually one thing that I think I’d by no means understand. It sort of feels too complex and very large for me. I am having a look ahead on your next put up, I’ll try to get the hang of it!|


LisaAnoky Veröffentlicht am2:51 am - Jan 2, 2021

cialis 20 mg price in canada

Payday Loans Online Veröffentlicht am1:35 am - Jan 2, 2021

personal loans for people with bad credit

do africans take hydroxychloroquine Veröffentlicht am3:36 pm - Jan 1, 2021

do africans take hydroxychloroquine https://hydroxychloroquine.mymvrc.org/

KiaAnoky Veröffentlicht am1:29 pm - Jan 1, 2021

[url=http://viagratpm.com/]viagra pill price in mexico[/url]

Ethan Myer Veröffentlicht am10:55 am - Jan 1, 2021

you’re truly a good webmaster. The web site loading velocity is incredible. It sort of feels that you are doing any distinctive trick. Furthermore, The contents are masterpiece. you’ve done a excellent activity in this matter!|


Christeen Stimmell Veröffentlicht am8:16 am - Dez 31, 2020

Can I just say what a relief to find someone who truly understands what they are talking about on the net. You actually realize how to bring an issue to light and make it important. More and more people must look at this and understand this side of the story. I was surprised you’re not more popular since you definitely have the gift.|


AmyAnoky Veröffentlicht am7:45 am - Dez 31, 2020

where to buy nexium 10 mg tablet

is ivermectin safe Veröffentlicht am3:41 am - Dez 31, 2020

is ivermectin safe http://ivermmectin.co/

Teddy Mootz Veröffentlicht am12:01 am - Dez 31, 2020

This post will help the internet people for setting up new blog or even a blog from start to end.|


Ramiro Elstad Veröffentlicht am11:41 am - Dez 30, 2020

Great delivery. Solid arguments. Keep up the amazing work.|


Direct Lender Loans Veröffentlicht am8:15 am - Dez 30, 2020

credit card debt consolidation loans

ivermectin use in humans Veröffentlicht am11:25 pm - Dez 29, 2020

ivermectin use in humans https://ivermectin1st.com/

cheap vidalista india Veröffentlicht am8:33 am - Dez 29, 2020

cheap vidalista india http://viidalista.co/