{"id":76623,"date":"2022-06-17T17:00:36","date_gmt":"2022-06-17T21:00:36","guid":{"rendered":"https:\/\/www.engineersgarage.com\/?p=76623"},"modified":"2023-08-23T12:47:44","modified_gmt":"2023-08-23T16:47:44","slug":"what-is-the-1-wire-protocol","status":"publish","type":"post","link":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/","title":{"rendered":"What is the 1-Wire protocol?"},"content":{"rendered":"<p><span data-preserver-spaces=\"true\">The 1-Wire protocol is a single-wire interface, half-duplex, bidirectional, low-speed and power, long-distance serial-data communication protocol. <\/span><span data-preserver-spaces=\"true\">Although this protocol is classified as a 1-wire standard, at least two wires are required in the 1-wire standard bus \u2014 one for the data and\/or power supply and another for the ground return. An additional wire might be necessary, depending on the power mode.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">A 1-wire standard has a master and slave configuration, where there can only be one master device, a computer or microcontroller, and several slave devices. It\u2019s possible to connect up to 100-slave, 1-wire devices, with a 1-wire standard bus. However, as slave devices are added to the bus, their polling by the master device might take more time.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">This protocol does not use a clock signal. Instead, the slave devices are internally clocked and synchronized with a signal from the master device. The master device is solely responsible for the read and write operations of the slave devices, so they cannot initiate a data transfer on their own. What they can do is indicate their presence over the bus when the master resets.\u00a0<\/span><span data-preserver-spaces=\"true\">Every master device is identified by a 64-bit address, stored within each one-wire slave device\u2019s ROM.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">This is a low-speed serial communication standard, with a typical data speed of 15.4 kbps. The bus can be overdriven to a maximum data speed of 125 kbps. The data speeds in the 1-Wire protocol are low compared to other standard serial-data communication protocols (like UART, I2C, and SPI), but the 1-wire bus is extremely economical in production and operation. It offers a simple hardware implementation and an extremely low-power footprint.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Although the hardware is simple, the software implementation on the microcontroller side is highly complex. And despite a low power consumption, it can communicate data over relatively long distances.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The 1-Wire protocol is used by temperature sensors, real-time clocks, timers, EEPROMs, and the popular iButton. Most of these 1-wire slave devices are products of (what\u2019s now) Maxim Integrated.\u00a0<\/span><\/p>\n<p>Let&#8217;s discuss in more detail.<\/p>\n<p><strong><span data-preserver-spaces=\"true\">What is the 1-Wire protocol?<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">The 1-Wire protocol is a single-wire interface for low-speed data communication in microcontrollers and computers. The protocol operates over a single data line without a clock signal. It\u2019s a master-slave serial communication protocol where the half-duplex bidirectional data communication with multiple slaves is solely managed and controlled by a single master.\u00a0\u00a0<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">The 1-wire standard bus<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">The 1-wire standard bus has at least two wires. One is the data line and the other is the ground return. Both master and slaves have an open-drain (open-collector) connection with the data line. This is why a 4.7K resistor typically pulls the data line up. There are two possible powering modes for the 1-wire slave devices: parasitic and conventional.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">In parasitic mode, only the data line and ground return must be traced to the 1-wire slave device. If the conventional power mode is used, an additional positive supply line must be traced to each 1-wire slave connected to the bus.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Therefore, the 1-wire bus on a PCB might have two or three lines. The conventional powering with three lines in the 1-wire bus is more reliable.\u00a0\u00a0<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">Parasitic Vs. conventional power<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">As mentioned, 1-wire slave devices can be powered in parasitic and conventional modes. All 1-wire slave devices have three terminals: VDD, GND and data. In the parasitic mode, the VDD and GND pins are connected to the ground, so the signal and power are supplied to the slave devices on the same line (i.e. the data line).\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The slave devices have an internal capacitor of 800 pF, which gets charged when the data line is HIGH. The stored charge keeps the slave live when the data line is LOW. The data line is typically pulled up by a 4.7K resistor.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Parasitic powering requires strict timing and supply to the exact specification to maintain the slave device live without fail. This is why this mode is less reliable. Often, an additional hard pull-up is used to ascertain the power supply.\u00a0<\/span><\/p>\n<div id=\"attachment_76624\" style=\"width: 796px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-76624\" class=\"wp-image-76624 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-01.png\" alt=\"\" width=\"786\" height=\"241\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-01.png 786w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-01-300x92.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-01-768x235.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-01-368x113.png 368w\" sizes=\"auto, (max-width: 786px) 100vw, 786px\" \/><p id=\"caption-attachment-76624\" class=\"wp-caption-text\">The parasitic powering of 1-wire devices.<\/p><\/div>\n<div id=\"attachment_76625\" style=\"width: 946px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-02.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-76625\" class=\"wp-image-76625 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-02.png\" alt=\"\" width=\"936\" height=\"410\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-02.png 936w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-02-300x131.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-02-768x336.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-02-368x161.png 368w\" sizes=\"auto, (max-width: 936px) 100vw, 936px\" \/><\/a><p id=\"caption-attachment-76625\" class=\"wp-caption-text\">The parasitic powering of 1-wire devices with an additional hard pull-up.<\/p><\/div>\n<p>In a conventional powering mode, 1-wire slave devices are externally powered. An additional wire is traced to each 1-wire slave. The external power supply to the slaves ensures safe operation even in harsh, high-temperature conditions.<\/p>\n<div id=\"attachment_76626\" style=\"width: 777px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-76626\" class=\"wp-image-76626 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-03.png\" alt=\"\" width=\"767\" height=\"285\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-03.png 767w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-03-300x111.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-03-368x137.png 368w\" sizes=\"auto, (max-width: 767px) 100vw, 767px\" \/><p id=\"caption-attachment-76626\" class=\"wp-caption-text\">The conventional powering of 1-wire devices.<\/p><\/div>\n<p><span data-preserver-spaces=\"true\">Typical 1-wire devices operate in voltages from &#8211; 1.71~1.89V, 1.71~3.63V, 2.97~6.63V, and 2.97~5.25V. The current drawn ranges between 1.06~5mA. The pull-up resistor sets the current level whether devices are supplied parasitic or conventional power.\u00a0\u00a0<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">How the 1-Wire protocol works<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">This interface is not usually used in microcontrollers or microcomputers. It\u2019s often implemented by software using bit-banging or a universal asynchronous receiver-transmitter (UART).\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Communication over the data line is initiated by the master using a reset. It pulls down the data line for 480 us and then releases it, allowing the typical pull-up resistor to pull the data line HIGH. If slave devices are connected to the bus, they respond to the reset signal by pulling the data line LOW for 60~240 us. If the line is pulled down by the slave(s), the master confirms their presence over the bus. After 60~240 us, the slave(s) release the data line, so the master can start writing.\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76627 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-04.png\" alt=\"\" width=\"636\" height=\"256\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-04.png 636w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-04-300x121.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-04-368x148.png 368w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">After a reset, the master can write and read data with the slave devices. Initially, it sends ROM commands, like the search ROM command (0xF0), to access the ROM address of the slave devices. After reading the ROM addresses of all the connected 1-wire slave devices, the master device can access one by sending the Match ROM command (0x55). The ROM commands are followed by the function ones.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">For example, if a 1-wire temperature sensor is connected to the bus, the microcontroller can send the function commands to start the temperature conversion, read the temperature, etc. The ROM and function commands are 8-bit long.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Since the 1-Wire standard does not use any clock signal, communication of the \u20180\u2019 and \u20181\u2019 bits occur by setting the logical level of the data line for a specific time slot. Usually, the time slot is 60 us long. There\u2019s also an interval of 1us between each time slot, so that the data line is pulled HIGH again by the pull-up resistor. During each 60 us time slot, 1 bit is communicated between the master and slave. The time slot can be up to 10 times shorter if the bus is overdriven.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">When the master has to write bits over the data line, it pulls the data line down.<\/span><\/p>\n<ul>\n<li><span data-preserver-spaces=\"true\">To write \u20180,\u2019 the master pulls down the data line for the full 60 us time slot, then releases it for a 1us interval between the time slots.\u00a0<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">To write \u20181,\u2019 the master pulls the data line down for a shorter period of 15 us, during the entire time slot, then releases it for a 1us interval between the time slots.\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-preserver-spaces=\"true\">The slave devices pulse at about the mid-time slot (i.e. 30us in the 60us time slot). They have a basic monostable multivibrator to detect the duration of the pulses. The ROM and function commands are 8-bit long. The data communicated is also in groups of 8 bits. The error detection is performed by an 8-bit cyclic redundancy check.\u00a0 \u00a0\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-05.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76628 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-05.png\" alt=\"\" width=\"629\" height=\"354\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-05.png 629w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-05-300x169.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-05-368x207.png 368w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><\/a><\/p>\n<p>The master reads from the slave device after sending a ROM search or function command. The read operation is controlled by the master device. The master reads from the slave bit-by-bit while data is communicated to the master in groups of 8 bits. Each bit is read in a 60 us time slot (or shorter if the bus is overdriven).<\/p>\n<p>The master pulls the data line down for 1 us and releases it. Then, it samples the data from the bus after 15 us. If the slave writes \u20180\u2019 over the bus, it keeps the line pulled down for the full 60 us of time slot, and then releases the data line for a 1us interval between the time slots. If the slave writes \u20181\u2019over the bus, it keeps the line pulled down for 15 us, and then releases the data line for the pull-up resistor to pull the data line HIGH.<\/p>\n<p>The master samples each bit after 15 us. If the bit sent by the slave is \u20180,\u2019 the line is pulled LOW at the time of sampling. If the bit sent by the slave is \u20181,\u2019 the line is pulled HIGH at the time of sampling.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-06.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76629 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-06.png\" alt=\"\" width=\"658\" height=\"350\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-06.png 658w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-06-300x160.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-06-368x196.png 368w\" sizes=\"auto, (max-width: 658px) 100vw, 658px\" \/><\/a><\/p>\n<p><span data-preserver-spaces=\"true\">The master can communicate with up to 100 slaves on a 1-wire standard bus. However, the greater the number of 1-wire slaves connected to the bus, the more time the master needs to pull data from them. The software libraries typically use bit-banging or the UART to time pulse durations. The LSB is always sent first in the 1-Wire protocol.<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">Protocol implementation<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">There are five types of bus signals in 1-wire communication, and each one is initiated and controlled by the master. These signals are Reset, Presence, Write 0, Write 1, and Read.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The protocol can be implemented by a microcontroller or computer in two ways: polled and interrupt-driven implementation. Polled is a software-only implementation. The interrupt-driven implementation requires a built-in timer\/counter.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">In terms of Arduino, the polled implementation (software-only) can be done using the delayMicroseconds() function. This function has this source code:\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\"><span style=\"color: #800000;\"><strong>void delayMicroseconds(unsigned int us)<\/strong><\/span><br \/>\n<\/span><span style=\"color: #800000;\"><strong>{<br \/>\n\/\/ calling avrlib&#8217;s delay_us() function with low values (e.g. 1 or<br \/>\n\/\/ 2 microseconds) gives delays longer than desired.<br \/>\n\/\/delay_us(us);<br \/>\n\/\/ for the 16 MHz clock on most Arduino boards<br \/>\n\/\/ for a one-microsecond delay, simply return. the overhead<br \/>\n\/\/ of the function call yields a delay of approximately 1 1\/8 us.<br \/>\nif (&#8211;us == 0)<br \/>\nreturn;<br \/>\n\/\/ the following loop takes a quarter of a microsecond (4 cycles)<br \/>\n\/\/ per iteration, so execute it four times for each microsecond of<br \/>\n\/\/ delay requested.<br \/>\nus &lt;&lt;= 2;<br \/>\n<span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;\">\u00a0 \u00a0 \u00a0 \u00a0 \/\/ account for the time taken in the preceeding commands.<br \/>\n<\/span><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;\">\u00a0 \u00a0 \u00a0 \u00a0 us -= 2;<br \/>\n<\/span>\u00a0 \u00a0 \u00a0 \u00a0\u00a0\/\/ busy wait<br \/>\n__asm__ __volatile__ (<br \/>\n&#8220;1: sbiw %0,1&#8221; &#8220;\\n\\t&#8221; \/\/ 2 cycles<br \/>\n&#8220;brne 1b&#8221; : &#8220;=w&#8221; (us) : &#8220;0&#8221; (us) \/\/ 2 cycles<br \/>\n);<br \/>\n}<\/strong><\/span><\/p>\n<p><span data-preserver-spaces=\"true\">For Arduino, the 1-wire write operation can be performed with this function:<\/span><\/p>\n<p><strong><span style=\"color: #800000;\">void OWWrite(uint8_t bit){<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">if(bit){<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/Write bit &#8216;1&#8217;<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 digitalWrite(PINNUMBER, 0x00);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(6);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 digitalWrite(PINNUMBER, 0x01);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(64);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">else{<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/Write bit &#8216;0&#8217;<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 digitalWrite(PINNUMBER, 0x00);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(60);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 digitalWrite(PINNUMBER, 0x01);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(10);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">}<\/span><\/strong><\/p>\n<p>For a computer, the same function can be written in C++, as follows:<\/p>\n<p><span style=\"color: #800000;\"><strong>void OWWrite(uint8_t bit){<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if(bit==1){<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/PF5 is port name<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PORTF &amp;= ~(1&lt;&lt;PF5);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(6);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PORTF |= (1&lt;&lt;PF5);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(64);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 else{<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PORTF &amp;= ~(1&lt;&lt;PF5);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(60);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PORTF |= (1&lt;&lt;PF5);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(10);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>}<\/strong><\/span><\/p>\n<p>For Arduino, the 1-wire read operation can be performed by this function:<\/p>\n<p><span style=\"color: #800000;\"><strong>uint8_t OWRead(void){<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 uint8_t result;<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 digitalWrite(PINNUMBER, 0x00);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(6);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 digitalWrite(PINNUMBER, 0x01);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(9);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 pinMode(PINNUMBER, INPUT);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 result = digitalRead(PINNUMBER) &amp; 0x01;<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(55);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 pinMode(PINNUMBER, OUTPUT);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return result;<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>}<\/strong><\/span><\/p>\n<p>For a computer, the same function can be written in C++ as following.<\/p>\n<p><span style=\"color: #800000;\"><strong>uint8_t OWReadBit(void){<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 uint8_t result = 0;<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PORTF &amp;= ~(1&lt;&lt;PF5);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(10);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PORTF |= (1&lt;&lt;PF5);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(20);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if(PINF &amp; (1&lt;&lt;PF5)){<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 result = HIGH;<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(30);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return result;<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>}<\/strong><\/span><\/p>\n<p>For Arduino, the reset and presence operation can be performed using this function:<\/p>\n<p><strong><span style=\"color: #800000;\">uint8_t OWResetPresence(void){<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 uint8_t result;<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(0);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 digitalWrite(PINNUMBER, 0x00);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(480);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 digitalWrite(PINNUMBER, 0x01);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(70);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 pinMode(PINNUMBER, INPUT);\u00a0<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 result = digitalRead(PINNUMBER)^0x01;<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(410);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 pinMode(PINNUMBER, OUTPUT);<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return result;<\/span><\/strong><br \/>\n<strong><span style=\"color: #800000;\">}<\/span><\/strong><\/p>\n<p>For a computer, the same function can be written in C++:<\/p>\n<p><span style=\"color: #800000;\"><strong>uint8_t OWResetPresence(void){<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 uint8_t result = LOW;<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PORTF &amp;= ~(1&lt;&lt;PF5);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(480);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PORTF |= (1&lt;&lt;PF5);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delayMicroseconds(55);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if(PINF&amp;(1&lt;&lt;PF5)){<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 result = HIGH;<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return result;<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>}<\/strong><\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Microcontrollers and computers can use the UART for the interrupt-driven implementation of the 1-Wire protocol. Computers might need an external UART chip or breakout board for communicating with 1-wire devices.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The UART\u2019s Tx and Rx must connect to the data line of the 1-wire bus. The UART port must have an open-collector buffer so that the slave(s) can pull down the data line. For the reset and presence signal, the baud rate must be set to 9600, and the controller\/computer needs to transmit 0xF0.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">During transmission:<\/span><\/p>\n<ul>\n<li><span data-preserver-spaces=\"true\">Bits 0~3 are set to \u20180\u2019<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Bit 4 is set to \u20181\u2019\u00a0<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Bits 5~7 are written by the slave.\u00a0<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">The stop bit is set HIGH<\/span><\/li>\n<\/ul>\n<p><span data-preserver-spaces=\"true\">If there\u2019s no slave connected to the bus, the received value is 0xF0. If any value other than 0xF0 is received, it indicates the presence of a 1-wire slave(s) on the bus.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">For a 1-wire write operation, the UART\u2019s baud rate must be set to 115200. The start bit must be set to \u20180\u2019 and the stop bit to \u20181.\u2019\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">To write \u20181,\u2019 the UART must transmit 0xFF and receive 0xFF in return. To write \u20180,\u2019 the UART must transmit 0x00 and receive 0x00 in return.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">For a 1-wire read operation, the UART\u2019s baud rate must be set to 115200. The start bit must be set to \u20180\u2019 and the stop bit to \u20181.\u2019 To read, the UART transmits a value of 0xFF, which is equivalent to releasing the line pulled in a HIGH state. The rest of the bits are written by the slave. If a slave writes \u20181,\u2019 all the bits after the start bit are set to \u20181,\u2019 so the UART receives a value of 0xFF. If a slave writes \u20180,\u2019 all the bits after the start bit are set to \u20180,\u2019 so the UART receives any value other than 0xFF.\u00a0\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-76630 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-07-245x300.png\" alt=\"\" width=\"750\" height=\"918\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-07-245x300.png 245w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-07-768x941.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-07-194x238.png 194w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-07.png 904w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/p>\n<p><strong>Sequence detection<br \/>\n<\/strong>The master device can search and detect any arbitrary number of 1-wire slave devices on the bus. It&#8217;s also possible to connect up to 100 slave devices to a 1-wire standard bus. However, in a standard 1-wire bus, the master has no mechanism to detect the physical sequence of the slave devices over the bus. And in some 1-wire devices, two additional pins are provided to support the sequence detection. One such device is DS28EA00.<\/p>\n<div id=\"attachment_76631\" style=\"width: 864px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-76631\" class=\" wp-image-76631\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-08-300x119.png\" alt=\"\" width=\"854\" height=\"339\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-08-300x119.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-08-368x146.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/TCH49-08.png 616w\" sizes=\"auto, (max-width: 854px) 100vw, 854px\" \/><p id=\"caption-attachment-76631\" class=\"wp-caption-text\">Sequence detection in 1-wire interface.<\/p><\/div>\n<p><strong>Devices<br \/>\n<\/strong>The 1-Wire protocol is a proprietary standard. All the 1-wire devices are manufactured by Maxim Integrated. Some of the notable 1-wire devices are listed in this table.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-76632 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/Screen-Shot-2022-06-17-at-4.24.42-PM-300x246.png\" alt=\"\" width=\"836\" height=\"686\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/Screen-Shot-2022-06-17-at-4.24.42-PM-300x246.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/Screen-Shot-2022-06-17-at-4.24.42-PM-768x629.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/Screen-Shot-2022-06-17-at-4.24.42-PM-1536x1258.png 1536w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/Screen-Shot-2022-06-17-at-4.24.42-PM-291x238.png 291w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/Screen-Shot-2022-06-17-at-4.24.42-PM.png 1656w\" sizes=\"auto, (max-width: 836px) 100vw, 836px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The 1-Wire protocol is a single-wire interface, half-duplex, bidirectional, low-speed and power, long-distance serial-data communication protocol. Although this protocol is classified as a 1-wire standard, at least two wires are required in the 1-wire standard bus \u2014 one for the data and\/or power supply and another for the ground return. An additional wire might be&hellip;<\/p>\n","protected":false},"author":387,"featured_media":76633,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[32,4043,13,9],"tags":[3479,1175,218,3483,3485,3481,3480,178,3482,3484],"class_list":{"2":"type-post","21":"entry","22":"has-post-thumbnail"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.2 (Yoast SEO v25.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is the 1-Wire protocol?<\/title>\n<meta name=\"description\" content=\"Learn about the 1-Wire protocol, how it works and is implemented using Arduino, a computer, and the UART.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is the 1-Wire protocol?\" \/>\n<meta property=\"og:description\" content=\"Learn about the 1-Wire protocol, how it works and is implemented using Arduino, a computer, and the UART.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/\" \/>\n<meta property=\"og:site_name\" content=\"Engineers Garage\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/engineersgarage\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/1Wire-rotator.png\" \/>\n\t<meta property=\"og:image:width\" content=\"954\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nikhil Agnihotri\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:site\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nikhil Agnihotri\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/\"},\"author\":{\"name\":\"Nikhil Agnihotri\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6\"},\"headline\":\"What is the 1-Wire protocol?\",\"datePublished\":\"2022-06-17T21:00:36+00:00\",\"dateModified\":\"2023-08-23T16:47:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/\"},\"wordCount\":2329,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/1Wire-rotator.png\",\"keywords\":[\"1wire\",\"Arduino\",\"avr\",\"bus\",\"communicationbus\",\"conventional\",\"parasitic\",\"pic\",\"powermode\",\"standardbus\"],\"articleSection\":[\"Arduino Projects\",\"AVR\",\"Electronic Projects\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/\",\"url\":\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/\",\"name\":\"What is the 1-Wire protocol?\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/1Wire-rotator.png\",\"datePublished\":\"2022-06-17T21:00:36+00:00\",\"dateModified\":\"2023-08-23T16:47:44+00:00\",\"description\":\"Learn about the 1-Wire protocol, how it works and is implemented using Arduino, a computer, and the UART.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#primaryimage\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/1Wire-rotator.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/1Wire-rotator.png\",\"width\":954,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.engineersgarage.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is the 1-Wire protocol?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.engineersgarage.com\/#website\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"name\":\"Engineers Garage\",\"description\":\"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News\",\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.engineersgarage.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\",\"name\":\"Engineer's Garage - WTWH Media\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"width\":372,\"height\":52,\"caption\":\"Engineer's Garage - WTWH Media\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/engineersgarage\",\"https:\/\/x.com\/EngineersGarage\",\"https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6\",\"name\":\"Nikhil Agnihotri\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g\",\"caption\":\"Nikhil Agnihotri\"},\"url\":\"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"What is the 1-Wire protocol?","description":"Learn about the 1-Wire protocol, how it works and is implemented using Arduino, a computer, and the UART.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/","og_locale":"en_US","og_type":"article","og_title":"What is the 1-Wire protocol?","og_description":"Learn about the 1-Wire protocol, how it works and is implemented using Arduino, a computer, and the UART.","og_url":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/","og_site_name":"Engineers Garage","article_publisher":"https:\/\/www.facebook.com\/engineersgarage","og_image":[{"width":954,"height":600,"url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/1Wire-rotator.png","type":"image\/png"}],"author":"Nikhil Agnihotri","twitter_card":"summary_large_image","twitter_creator":"@EngineersGarage","twitter_site":"@EngineersGarage","twitter_misc":{"Written by":"Nikhil Agnihotri","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#article","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/"},"author":{"name":"Nikhil Agnihotri","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6"},"headline":"What is the 1-Wire protocol?","datePublished":"2022-06-17T21:00:36+00:00","dateModified":"2023-08-23T16:47:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/"},"wordCount":2329,"commentCount":0,"publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"image":{"@id":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/1Wire-rotator.png","keywords":["1wire","Arduino","avr","bus","communicationbus","conventional","parasitic","pic","powermode","standardbus"],"articleSection":["Arduino Projects","AVR","Electronic Projects","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/","url":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/","name":"What is the 1-Wire protocol?","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#primaryimage"},"image":{"@id":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/1Wire-rotator.png","datePublished":"2022-06-17T21:00:36+00:00","dateModified":"2023-08-23T16:47:44+00:00","description":"Learn about the 1-Wire protocol, how it works and is implemented using Arduino, a computer, and the UART.","breadcrumb":{"@id":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#primaryimage","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/1Wire-rotator.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/1Wire-rotator.png","width":954,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/www.engineersgarage.com\/what-is-the-1-wire-protocol\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.engineersgarage.com\/"},{"@type":"ListItem","position":2,"name":"What is the 1-Wire protocol?"}]},{"@type":"WebSite","@id":"https:\/\/www.engineersgarage.com\/#website","url":"https:\/\/www.engineersgarage.com\/","name":"Engineers Garage","description":"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News","publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.engineersgarage.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.engineersgarage.com\/#organization","name":"Engineer's Garage - WTWH Media","url":"https:\/\/www.engineersgarage.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","width":372,"height":52,"caption":"Engineer's Garage - WTWH Media"},"image":{"@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/engineersgarage","https:\/\/x.com\/EngineersGarage","https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw"]},{"@type":"Person","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6","name":"Nikhil Agnihotri","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g","caption":"Nikhil Agnihotri"},"url":"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/"}]}},"featured_image_src":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/1Wire-rotator-600x400.png","featured_image_src_square":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/06\/1Wire-rotator-600x600.png","author_info":{"display_name":"Nikhil Agnihotri","author_link":"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/"},"_links":{"self":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/76623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/users\/387"}],"replies":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/comments?post=76623"}],"version-history":[{"count":0,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/76623\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media\/76633"}],"wp:attachment":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media?parent=76623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/categories?post=76623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/tags?post=76623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}