Arduino DS18B20 Temperature Sensor Tutorial

preview_player
Показать описание
In this video I go through the steps of setting up an Arduino DS18B20 temperature sensor. On top of this I also setup some LEDs to represent the current temperature of the sensor. Alternatively, you can see the temperature within the serial monitor.

You could really adapt and change the circuit in this tutorial to create a cool sensor. For example, you could attach something like a buzzer that will beep if it gets too hot or too cold.

The circuit is pretty straightforward to put together. One thing that you should probably be aware of is that I am using a waterproof version of the DS18b20 temperature sensor. If you’re using just a normal version, then it will look exactly like a transistor. You may need to refer to a datasheet to see which pins are which.

I also use two libraries in this tutorial, the first is called one wire and is required to be able to read data from the temperature sensor. The second is called the Dallas temperature library and is used to process the data we get from the sensor. This second one is optional but it makes things a lot easier than having to write code to process the data. It’s completely up to you if you want to do it the hard or easy way.

If you use the Dallas temperature sensor library, then the rest of the code is pretty straight forward. You can have multiple sensors and easily read them and use the data however you see fit.

You may come across a couple of issues that are easily fixable. The first is if you just consistently get super high or low temperatures then it’s likely the sensor isn’t connected properly. Double check the connection to fix this one.

Another issue is that not enough power is reaching the sensor. If this is the case, try and provide more power to the sensor by giving it a dedicated power source.

Комментарии
Автор

THANK YOU GUS!!!

Finally a clear and concise tutorial.

I am the king of noobs when it comes to wiring these things and your video really helped.

Presumably the wire going from the breadboard to Arduino 3.3Vdc and Gnd doesn't have to go to the Arduino? Would I be right in saying that it would still work if these two wires were plugged into a separate power supply and only the pin 5 wire was connected to Arduino???

Also whats the purpose of the resistor between red and white? How did you know to use this resistor?

Thanks again Gus... after that vid im away to have a look at your website! Keep up the good work, its much appreciated.

gtxviper
Автор

Awesome tutorial. Just what I was looking for.

colin
Автор

Hi, I need help, this is a digital temperature sensor on the pellet burner electronics. Everything works well but I need a little diversion on electronics. The thing is that at some point I need to tell the electronics that some temperature has been reached and if creativity has not been reached. How to influence that temperature via a sensor. There are three wires on the sensor: green, brown and white. Green is electronically connected under one connector and brown and white are connected together under the other connector. So, three wires, two connectors. Thanks.

softa
Автор

Is it mandatory to use Resistor???? I am facing temparature rating problem it is always showing -127 c. I hadn't used resistor, , , ,

monarulislammithu
Автор

How could I add a buzzer to this system? It would go off when it is between the two temperatures. Any help is appreciated.

bubbajr
Автор

thanks for video . i also showed how to get data from ds18b20 using normal usb ttl adapter, without using any microcontroller. may be that might be of your interest.

Electromaniaworld
Автор

what is the difference between sensor DS18B20, DS18S20, DS1822, DS1820?

tugasakhirhendro
Автор

i make my first of all projects whit this vid.. thanks mate.. i love you

Nsatiro
Автор

Will this work within a script that uses millis()? If there is any delay() in temperature reading the millis() will not count accurately.

Gunchulis
Автор

Hi, can I misure temperature only using the sensor? I've bought it on ebay and i did not received the wire. Thank you!

lucarignanese
Автор

How could i add a heating element to this? Using a solid state relay keypad lcd shield i want to display current temp and set temp, thanks for any help!

joshhagen
Автор

Perabens otimo projeto tem como adicionar um display a este projeto se for possivel vc.pode me dar uma dica?Obrigado..

tun
Автор

hello folks, any idea how can i hook up 15 ds18b20 to arduino mega and avoid parasite power ??

ismailsmile
Автор

is DS18B20 better than LM35 for tepmerature control circuits ?

alaahalawa
Автор

can you help me i want to do this but with 10 led bar graph segment ?
i need coding help for the led bar graph to turn every led on different temperatures

balancereplays
Автор

I used a D1 R32 and i got this error:In file included from

error: #error "Please define I/O register types here"

#error "Please define I/O register types here"

^

exit status 1
Error compiling for board ESP32 Dev Module.

samuelcp
Автор

Bro can u pls help me out with my problem, I m getting error called exit status 1 and error in compiling arduino uno and nano

darshanrajashekhar
Автор

Does that code work the same for a keyes sensor?

wrmaldonado
Автор

this video is perfect and my temp sensor is working fine. thanks a lot!

simonvoorspoels
Автор

Can someone help me find a sensor to read the the surface of the back of a solar panel? The back of the panel has a system that will cool the panel with water so i need it to be water resistant and to only read the surface temperature with minimal interference of the water on readings if at all possible.
thanks for any ideas you internet geniuses.

raulciprianoyahoo
welcome to shbcf.ru