Skip to content

Commit

Permalink
doc: add absolute url to be able to generate cargo doc
Browse files Browse the repository at this point in the history
  • Loading branch information
zeldan committed Jan 4, 2025
1 parent cee62d0 commit ce1a949
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn main() -> ! {
}
```

![running](/docs/example_esp32_dht_running.png)
![running](https://raw.githubusercontent.com/rust-dd/embedded-dht-rs/refs/heads/main/docs/example_esp32_dht_running.png)


## Implementation Specification
Expand All @@ -124,8 +124,8 @@ We have gathered all the information you need to understand in order to implemen
The DHT20 differs from the DHT11 and DHT22 because it uses the I2C communication protocol, while both the DHT11 and DHT22 rely on a single-wire signal for data transmission.


- [DHT11 and DHT22 Documentation](docs/dht11_22.md)
- [DHT20 Documentation](docs/dht20.md)
- [DHT11 and DHT22 Documentation](https://github.com/rust-dd/embedded-dht-rs/blob/main/docs/dht11_22.md)
- [DHT20 Documentation](https://github.com/rust-dd/embedded-dht-rs/blob/main/docs/dht20.md)



Expand All @@ -142,5 +142,5 @@ The DHT20 differs from the DHT11 and DHT22 because it uses the I2C communication

## Example Schematic

| ![Schematic](./docs/example_esp32_schematic.png) [Click to zoom](./docs/example_esp32_schematic.png) | ![Running](./docs/example_esp32_wired.jpg) [Click to zoom](./docs/example_esp32_wired.jpg) |
| ![Schematic](https://raw.githubusercontent.com/rust-dd/embedded-dht-rs/refs/heads/main/docs/example_esp32_schematic.png) [Click to zoom](https://raw.githubusercontent.com/rust-dd/embedded-dht-rs/refs/heads/main/docs/example_esp32_schematic.png) | ![Running](https://raw.githubusercontent.com/rust-dd/embedded-dht-rs/refs/heads/main/docs/example_esp32_wired.jpg) [Click to zoom](https://raw.githubusercontent.com/rust-dd/embedded-dht-rs/refs/heads/main/docs/example_esp32_wired.jpg) |
|:--:|:--:|
8 changes: 4 additions & 4 deletions docs/dht11_22.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHT11/DHT22

![steps](/docs/dht11_22_steps.png)
![steps](https://raw.githubusercontent.com/rust-dd/embedded-dht-rs/refs/heads/main/docs/dht11_22_steps.png)

## Step 1

Expand All @@ -10,20 +10,20 @@ After powering on the DHT11/DHT22 (once powered, allow 1 second to pass during w

The microprocessor's I/O pin is set to output mode and pulled low, holding this state for at least 18 milliseconds. Then, the microprocessor's I/O is switched to input mode. Due to the pull-up resistor, the microprocessor’s I/O line and the DHT11/DHT22 DATA line will remain high, waiting for the DHT11/DHT22 to respond with a signal, as illustrated below:

![step2](/docs/dht11_22_step2.png)
![step2](https://raw.githubusercontent.com/rust-dd/embedded-dht-rs/refs/heads/main/docs/dht11_22_step2.png)


## Step 3

The DHT11/DHT22’s DATA pin detects an external signal and goes low, indicating that it is waiting for the external signal to complete. Once the signal ends, the DHT11/DHT22’s DATA pin switches to output mode, producing a low signal for 80 microseconds as a response. This is followed by an 80-microsecond high signal, notifying the microprocessor that the sensor is ready to transmit data. At this point, the microprocessor's I/O pin, still in input mode, detects the low signal from the DHT11/DHT22 (indicating the response) and then waits for the 80-microsecond high signal to start receiving data. The sequence of signal transmission is illustrated below:

![step3](/docs/dht11_22_step3.png)
![step3](https://raw.githubusercontent.com/rust-dd/embedded-dht-rs/refs/heads/main/docs/dht11_22_step3.png)

## Step 4

The DHT11/DHT22 outputs 40 bits of data through the DATA pin, and the microprocessor receives these 40 data bits. The format for a data bit "0" consists of a low level lasting 50 microseconds, followed by a high level lasting 26-28 microseconds, depending on changes in the I/O level. For a data bit "1," the format includes a low level of 50 microseconds followed by a high level lasting up to 70 microseconds. The signal formats for data bits "0" and "1" are shown below.

![step4](/docs/dht11_22_step4.png)
![step4](https://raw.githubusercontent.com/rust-dd/embedded-dht-rs/refs/heads/main/docs/dht11_22_step4.png)

## End signal

Expand Down
6 changes: 3 additions & 3 deletions docs/dht20.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHT20

![steps](/docs/dht20_steps.png)
![steps](https://raw.githubusercontent.com/rust-dd/embedded-dht-rs/refs/heads/main/docs/dht20_steps.png)

- SDA = Serial Data Line
- SCL = Serial Clock Line
Expand All @@ -16,15 +16,15 @@ After powering on, wait at least 100ms. Before reading the temperature and humid
## Step 2
Wait for 10ms before sending the 0xAC command to trigger the measurement. The command consists of two bytes: the first byte is 0x33 and the second byte is 0x00.

![step4](/docs/dht20_step2.png)
![step4](https://raw.githubusercontent.com/rust-dd/embedded-dht-rs/refs/heads/main/docs/dht20_step2.png)

## Step 3
Wait for 80ms for the measurement to complete. If Bit [7] of the status word is 0, the measurement is done, and you can proceed to read six bytes continuously; if not, continue waiting.

## Step 4
After receiving the six bytes, the following byte is the CRC check data, which can be read if needed. If the receiver requires CRC validation, an ACK is sent after the sixth byte is received; otherwise, send a NACK to terminate. The initial CRC value is 0xFF, and the CRC8 check uses the polynomial: CRC [7:0] = 1 + X^4 + X^5 + X^8.

![step4](/docs/dht20_step4.png)
![step4](https://raw.githubusercontent.com/rust-dd/embedded-dht-rs/refs/heads/main/docs/dht20_step4.png)

## Step 5
Compute the temperature and humidity values.

0 comments on commit ce1a949

Please sign in to comment.