Hierarchy: DS18B20 Senzor teploty
The integrated circuit DS18B20 (1-Wire digital thermometer) can be connected in two ways. In normal wiring, pin 3 connects the VCC and the circuit is powered from there. The other option is to connect the pins 1 and 3 to each other and connect both to the GND. Then the circuit switches to parasitic mode and is powered directly from the data wire.
This is possible thanks to an internal integrated circuit design that contains a capacitor that is charged from both voltage sources.
You need to install two libraries:
Dallas Temperature Library is ready for use with both power sources, and when initializing the integrated circuits, it finds out how it is powered and internally adapts communications so that it works in parasitic mode as well.
The picture shows an example of the possible use of an integrated circuit on a breadboard.