Translations:1-Wire/27/en

Материал из Wiren Board
The most popular 1-Wire temperature sensor is the DS18B20, installed in a sealed housing. Buy

Connect

Connecting a 1-Wire Sensor to a Wiren Board Controller

The controller already has a 3 kΩ pull-up resistor between the data bus and VCC - no external resistor is needed.

Three wire connection

The sensor has three outputs. Their colors may vary from model to model, it is advisable to find the documentation for your model.

Signal Terminal Color: Model 1 Color: Model 2 Color: Model 3
Vdd (VCC, Power) + 5V Out Red Red Red
GND (ground) GND Black Black Yellow
DQ (DATA, data ) 1W Blue Yellow Green

Two-wire connection

Connect the power and ground pins of the sensor and connect them to the ground of the controller. With this connection, the sensor will take power from the data channel.

This method is not recommended, especially for connecting several sensors: the current from the data line may not be enough for all sensors, besides, polling slows down - time is spent on charging the internal capacitances of the sensors with voltage from the data line.

1-Wire busbar

The number of possible sensors and the reliability of their operation depends on the length of the bus, its topology and cable. Typically, up to 20 sensors of 5 meters of cable connected in a star work reliably at home.

The main document when designing a bus is instructions from the 1-Wire developer. Main points:

  • Bus length when connecting one sensor is up to 200 meters.
  • When connecting several sensors, connect them to a 5 V supply (do not use a two-wire circuit).
  • Laying a line with one bus is better than star laying.
  • For laying a long bus or in conditions of increased interference (for example, in a shield) - use a twisted pair cable, for example, Cat 5, better shielded.
  • Длина шины при подключении одного датчика до 200 метров.
  • При подключении нескольких датчиков, подключайте их к питанию 5 В (не используйте двухпроводную схему).
  • Прокладка линии одной шиной лучше, чем прокладка звездой.
  • Для прокладывания длинной шины или в условиях повышенных помех (например, в щитке) — используйте витую пару, например, Cat 5, лучше экранированную.

A twisted-pair connection is a signal on one core of the pair, ground on the second, and similarly power supply: plus power on one core of the pair, minus on the second. Connect the power negative to signal ground. Connect the screen on one side to the minus power supply.