Connecting 1-Wire temperature sensors

1-wire is an interface that allows you to build networks from devices with a common bus topology, one master - many slaves. Each device has its own unique 64-bit address.
The Atom series controllers give a possibility to connect DS18B20 temperature sensors to multifunctional inputs.


The DS18B20 is a high-precision digital temperature sensor.Main characteristics:● Range: -55 .. 125 ° C● Accuracy: 0.5 ° C● Power supply: 3-5.5V
For two-way signal transmission, despite the name, can be used:● 2 wires: one common / ground and the other for power and data transmission.● 3 wires (which we recommend): the first common / ground, the second for data transmission, the third for power.


This is the peculiarity of this network, that for power and data you can use one conductor, although, as a rule, the devices have a third pin to connect external power.
Basic parameters of the 1-Wire interface:● supply voltage of devices - 3.3-5V;● the maximum length of the bus line when using twisted pair - up to 300 m;● the maximum number of subscribers on the bus line of maximum length - up to 250;● the speed of exchange of the bus line of the maximum length - to 16,3 kbit / s

Important! Up to 20 sensors can be connected to one controller input. If the number of sensors is more than 3 and the line length is long, it may be necessary to connect an additional pull-up resistor (between the 3.3V power output and the controller input), with a resistance of 1.5 kОhm to 4.7 kОhm, depending on the length and number of sensors. The greater the length and number of sensors, the smaller resistor should be.


1-wire network topology

Although 1-Wire networks often have a fairly "free topology", they usually fall into several generalized categories based on the distribution of 1-Wire devices and the organization of connecting wires.

1. Linear topology: the 1-Wire bus is formed as a single line, starting from the controller and extending to the most remote slave device. Other slave devices are connected to the 1-Wire bus with small (<3 m) branches.


2. Topology "Star": the 1-Wire bus is divided near the controller and extends to several branches of different lengths. There are subordinate devices along or at the ends of the branches.


Testing has shown that the topology of the star network is the least stable. Different branches have inconsistent electrical parameters, which cause spurious signal reflections in the bus, which cause data errors. For this reason, the use of a star topology is not recommended. If several 1-wire physical lines are installed in the system, the best solution is to connect them to different inputs of the controller.

Interferences in the 1-Wire network

The 1-wire bus is sensitive to interference and the organization of connecting wires. Here are some tips for installing a bus:● Route the 1-Wire bus away from high-voltage wires, transformers and LED lighting wires (they can cause significant interference from high currents and dimming lamps).● No need to use a shielded twisted pair. When you try to ground the screen - the connection is completely lost.● Branches from the bus in 2-3 meters, in general, do not degrade the quality of the system, but can simplify installation.

Didn’t find the answer to your question?

You can contact the technical support chatbot.Found a mistake on the site? Help us fix it!