📥 RESOURCES & DOWNLOADS
• Datasheets: https://drive.google.com/drive/folder...
• Practical Example
– The AVR Oscilloscope: https://drive.google.com/file/d/1tuTz...
– The DHT Program: https://drive.google.com/file/d/1Lqdl...
✏️ EXERCISES
• Implement a DHT Master: https://drive.google.com/drive/folder...
🧠 QUIZ
https://forms.gle/g1UNSD27LzZmTbHAA
Have you ever wanted to connect multiple sensors and memory devices using just a single data wire? In this comprehensive section, we explore the 1-Wire protocol developed by Maxim (Dallas Semiconductor) - a unique bus system that allows multiple devices to communicate and even draw power from a single wire. You will also learn about the popular DHT11/DHT22 temperature sensors and understand why they are NOT actually 1-Wire devices despite common misconceptions.
We begin by clarifying a common myth: the DHT11 and DHT22 humidity/temperature sensors use a proprietary protocol that is incompatible with true 1-Wire. While both use a single data wire with pull-up resistor, the DHT protocol differs fundamentally - bit timing varies based on value (26-28us for 0, 70us for 1), it supports only point-to-point connections, and has no addressing scheme for multiple devices.
The true 1-Wire protocol is explored in depth: a half-duplex bus system supporting one master and multiple slaves on the same wire. Each 1-Wire device has a globally unique 64-bit ID burned into ROM - unique not just on the bus but on the entire planet. This ID consists of an 8-bit family code identifying the device type, a 48-bit serial number, and an 8-bit CRC checksum for validation.
Communication mechanics are thoroughly covered: the reset pulse (480-640us) that initializes all devices, the presence pulse (60-240us) confirming at least one slave exists, and bit transmission where each bit takes exactly 60us regardless of value. The master always initiates by pulling the line LOW, and slaves sample at the 15us mark. Bus "weight" (total capacitance from wire length, devices, and connections) determines maximum distance - too much capacitance prevents the line from returning HIGH fast enough.
The Search ROM algorithm demonstrates 1-Wire's elegant device discovery: slaves transmit their ID bit, then its complement; the master determines if conflict exists (both readings are 0), makes a decision, and slaves with non-matching bits drop out. Through multiple iterations, the master builds a table of all connected device IDs - essential for addressing specific devices in subsequent operations.
Parasitic power explains how 1-Wire devices operate with only ground and data connections: an internal transistor and capacitor charge when the line is idle HIGH, then supply power during LOW periods when the data line cannot. This "power stealing" from the data line enables remarkably simple wiring - some devices need only two pins connected.
Implementation approaches are discussed: since ATmega has no hardware 1-Wire support, you must either use a dedicated translator chip (1-Wire to I2C) or implement the protocol in software through "bit-banging" - directly controlling pin timing in code. Libraries exist for master operation, but slave implementations may require custom development. An oscilloscope (minimum 2x, preferably 4x the signal frequency) helps debug timing issues - the course provides an ATmega-based oscilloscope (76kS/s) suitable for DHT debugging.
#Arduino #ATmega #1Wire #OneWire #DHT11 #DHT22 #TemperatureSensor #HumiditySensor #BitBanging #ParasiticPower #SearchROM #EmbeddedSystems #SingleWire #Maxim #Dallas
📖 CHAPTERS
0:00 Introduction
3:19 The DHT Protocol
7:31 The 1-Wire Protocol
16:09 Signals on a 1-Wire Bus
22:19 The Search ROM Algorithm
30:55 Existing Libraries
34:16 Practical Example: Analyzing the DHT Protocol
36:40 The AVR Oscilloscope and how to use it
44:25 Plotting the Data using GNUPlot
59:54 Summary and What's next?