1-Wire Protocol
1-Wire is a bus that carries data, and often power, on a single wire plus ground. Every device has a factory-programmed 64-bit ID, so one controller pin can find and talk to dozens of temperature sensors, ID chips or authentication devices. TI's HDQ and SDQ are similar single-wire interfaces used in battery fuel gauges and battery authentication. A logic analyser with a 1-Wire decoder turns the pulse widths into reset, presence, ROM commands and data bytes.
How 1-Wire Signalling Works
The line idles high through a pull-up resistor. Every transaction starts with the controller holding the line low for at least 480 µs (reset); each device then answers with a presence pulse. After that, every bit is a time slot started by the controller pulling the line low. To write a 1 it releases the line within 15 µs; to write a 0 it holds it low for 60 to 120 µs. To read, it pulls low briefly and samples the line about 15 µs later: a device sending 0 holds the line low through the sample point.
ROM IDs, Commands and Search
- Reset and presence: the controller learns that at least one device is on the bus.
- ROM command: Read ROM (33h) reads the 64-bit ID when only one device is present; Match ROM (55h) followed by an ID selects one device; Skip ROM (CCh) addresses all devices at once; Search ROM (F0h) finds every ID on the bus, one bit at a time.
- Function command: device-specific, for example Convert T (44h) and Read Scratchpad (BEh) on a DS18B20 temperature sensor.
- Data and CRC: bytes move least significant bit first. The ROM ID and many data blocks end with a CRC-8 (polynomial x8 + x5 + x4 + 1) so the controller can detect errors.
The 64-bit ID is an 8-bit family code (for example 28h for the DS18B20), a 48-bit serial number and an 8-bit CRC. Search ROM uses the open-drain bus as a wired AND: each device sends its ID bit and its complement, and the controller sees whether all devices agree or there is a conflict, then picks a branch.
Parasite Power
Many 1-Wire devices can run with no supply pin, charging an internal capacitor from the data line while it is high. Operations that need more current, such as a temperature conversion or an EEPROM write, require the controller to hold the line hard high through a strong pull-up for the duration. Missing that strong pull-up is a common cause of readings that return the power-on default value.
HDQ and SDQ
Texas Instruments uses its own single-wire interfaces on battery products. HDQ connects a host to a battery fuel gauge: the host sends a break, then an 8-bit command (a 7-bit register address and a read or write bit, least significant bit first); on a read the gauge returns a data byte, and on a write the host sends one. The maximum rate is about 5 kbit/s. SDQ is used for battery authentication and ID devices and is closer to 1-Wire in its timing. Both are open drain on one wire with a pull-up, so the same probing applies, but they need their own decoders.
Where 1-Wire, HDQ and SDQ Are Used
- Temperature sensing: chains of DS18B20 sensors in buildings, cold stores, data loggers and 3D printers, all on one cable.
- ID and authentication: serial number chips, iButton keys, and secure authenticators in printer cartridges, medical sensors and accessories.
- Battery packs: HDQ fuel gauges and SDQ or 1-Wire authentication in phone, laptop and tool batteries.
- Configuration memory: small EEPROMs identifying a plug-in module or cable assembly.
Common 1-Wire Faults and How to Find Them
| Symptom | Likely Cause | What to Check |
|---|---|---|
| No presence pulse | Device unpowered, line shorted, or reset pulse too short | Measure the reset low time (480 µs or more) and look for the device pulling low after release |
| Temperature reads 85 °C or the default value | Conversion started without enough power, usually parasite power with no strong pull-up | Check the line stays hard high during the conversion time |
| CRC errors on long cables | Pull-up too weak for the cable capacitance, so the line rises slowly | Look at rising edges on an oscilloscope; lower the pull-up value or use an active pull-up driver |
| Search finds some devices, misses others | Reflections or timing error during the search bits | Decode the Search ROM bits and look for slots read at the wrong time |
| Errors only when the processor is busy | Software bit-banging delayed by interrupts, stretching a time slot | Measure slot widths in the capture against the datasheet limits |
Tools for Analysing and Decoding 1-Wire, HDQ and SDQ
Watch tools record the line and decode pulse widths into resets, ROM IDs, commands and data. 1-Wire is slow, so almost any logic analyser has enough sample rate; 1 MS/s or more resolves the time slots.
| Product | Role | Capability | Price ex VAT |
|---|---|---|---|
| Saleae Logic 8 | Watch | 8 channels, digital and analogue; 1-Wire decoder in the Logic 2 software, and the analogue view shows slow rising edges | £405 |
| ZeroPlus LAP-C Pro Series | Watch | Logic analyser with 1-Wire protocol analysis as standard; ZeroPlus also lists 1-Wire (Advanced), HDQ, SDQ and DS18B20 decoders, so ask us to confirm which are supplied with your LAP-C Pro model | £925 |
| Acute TravelLogic 34-Channel | Watch | Logic analyser running Acute's decoder library, which includes 1-Wire and HDQ; SDQ is supplied on request from Acute | £1,161.65 |
Need to drive a 1-Wire bus from a PC for production programming or test? Tell us the devices and cable length and we will recommend a set-up. For the two-wire battery bus used by many smart batteries, see our SMBus and PMBus guide.
Frequently Asked Questions
How Many Devices Can Share a 1-Wire Bus?
The 64-bit IDs allow far more than you will ever fit; the practical limit is electrical. Cable length, capacitance and the pull-up decide it. Dozens of sensors on tens of metres of twisted pair is common with a suitable pull-up or active driver.
Why Does My DS18B20 Read 85 °C?
85 °C is the power-on value of the temperature register. Reading it means the conversion did not complete, usually because a parasite-powered sensor did not get a strong pull-up during conversion, or the read happened before the conversion time had passed.
Is 1-Wire the Same as HDQ?
No. Both use one wire and a pull-up, but HDQ is TI's fuel gauge interface with a break, an 8-bit command and register access, and no 64-bit ID. Use an HDQ decoder for TI gauges.
Can I Use a UART to Drive 1-Wire?
Yes. A common trick uses a UART with TX and RX tied together through a diode or open-drain buffer, sending specific bytes at chosen baud rates to create reset and bit slots. It frees the processor from bit timing.
What Sample Rate Do I Need?
Standard speed slots are tens of microseconds long, so 1 MS/s is plenty. Overdrive slots are much shorter, so use 10 MS/s or more if your devices run in overdrive.
Where to Start with 1-Wire, HDQ and SDQ
More Protocols
By John Legg CEng, Director, Debug Store. Updated 12 November 2026.


