The data line idles high through a pull-up resistor (it's open-drain like I2C), and devices can harvest power from that high level, storing charge on an internal capacitor while the line is idle, so they run "parasitically" off the data line and need only data and ground, no dedicated VDD. Communication happens by the master pulling the line low for precisely-timed intervals: a long low is a reset (slaves answer with a presence pulse), and short low pulses of different durations encode write-1, write-0, and read time slots, with the slave optionally holding the line low to signal a 0. Because the same wire alternates between delivering power (when high) and signaling (brief lows), devices must store enough charge to ride through the low periods, which works for low-average-current parts. The catch is high-current operations: when a DS18B20 performs a temperature conversion it draws more than the weak pull-up can supply, so the master must apply a strong pull-up (actively drive the line high) for the conversion time, or power the device conventionally. So 1-Wire trades a pin for tight timing and a limited power budget, ideal for cheap sensors and ID chips.
Communication Protocols · Interview question
How does 1-Wire send both power and data on a single line?
A strong answer
What a weak answer sounds like
You know the answer. Do you know what gets you dinged?
Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.
From the lesson
Modbus & 1-Wire
Two field protocols beyond the big three: Modbus (industrial register access over RS-485/TCP, master/slave with CRC) and 1-Wire (a single line carrying power and data to addressable sensors).