What will you need? The DS18B20 is placed into the breadboard so that the flat side faces you. The black jumper cable goes from GND, which is the third pin down on the right column to the first pin of the DS18B The yellow jumper cable goes from the fourth pin down on the left column and is connected to the middle pin of the DS18B The red jumper cable goes from the top left pin of the Raspberry Pi to the far right pin of the DS18B

Author:Kejind Kagami
Language:English (Spanish)
Published (Last):10 July 2014
PDF File Size:18.25 Mb
ePub File Size:16.2 Mb
Price:Free* [*Free Regsitration Required]

It is still more practical to know if we measure the temperature in the room or outside. Create a new script and paste the following code. Change the pin of the One-Wire bus. The script runs in a loop by scanning the bus every second.

Connect the probes successively to locate them. The last hex code will be used to identify the probes separately. There is very little chance that two probes have the same code. DS18X20 onewire. The scan method retrieves the identifiers of the probes attached to the OneWire bus.

Each identifier will be needed to read the temperature individually. To interrupt the loop, press the stop icon. Follow this tutorial to learn how to do it. We know how to identify Dallas DS18B20 probes, read the temperature individually. All that remains is to send the measurements to a home automation server.

The complete technical documentation is here. Save it as domoticz. Copy it on the development board. To use this module, we must initialize a Domoticz object by passing it the IP address of the server, the port and the identification key optional.

Then, to send measurements, it will suffice to call the method corresponding to the — measured quantity. For the DS18B20, we will use the setTemperature method. Each method waits The identifier Idx of the virtual appliance The value s Warning. The name of the library must be different from the class, otherwise the module can not be called. You will have an error object is not callable. For this, you can play capitalize for example. Then, the sendRequest method is called to publish the measurements to the server.

The sendRequest method is waiting for the server to return. If the server is not available, the return 0 method. Otherwise, it returns the HTML code of the server. If the Domoticz server has accepted the request, code is returned. Now create a new script and paste the code below. The identifier is stored in a hexadecimal array.

For this, we have the format function of MicroPython. Here, this article concludes this small series of tutorials on MicroPython. I hope you like it. We will resume the tutorials a little later to drive the robotic arm presented a few weeks ago. If you have special needs or problems, the comments are there for that.


[Arduino] Capteur de température DS18B20



Capteur de température Dallas



[Arduino] Capteur de température DS18B20


Related Articles