Analyzing non-standard signals

dev board Arduino UNO
chip DHT11
tool Saleae Logic Analyser
sensor temperature
features I2C logic analyser

Before starting

Dependancies

Ensure the following requirements are available:

Description

View the decoded non-standard signal from the graph produced by Saleae to read temperature from a DHT11 sensor.

Capture the signal in Saleae:

All signals

Manually decoding the signal gives us:

0010 0110 0000 0000 0001 1100 0000 0000 0100 0010
RH MSB    RH LSB    T MSB     T LSB     Checksum

Take the temperature MSB which is 0001 1100 in binary and 28 in decimal, which is the same as what is shown i the serial monitor.

Code

Download code
#include "DHT.h"

#define DHTPIN 7
#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);

  Serial.begin(9600);
  Serial.println("Start DHT11");

  dht.begin();
}

void loop() {
  float t = dht.readTemperature();

  if (isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);

  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);

  Serial.println(t);
}

Makefile

BOARD?=arduino:avr:uno
PORT?=/dev/cu.usbmodem14*

.PHONY: default lint all flash clean

default: lint all flash clean

lint:
	cpplint --extensions=ino --filter=-legal/copyright *.ino

all:
	arduino-cli compile --fqbn $(BOARD) ./

flash:
	arduino-cli upload -p $(PORT) --fqbn $(BOARD)

clean:
	rm -rf build

Serial console

Serial output from the firmware.

Analyzing non-standard signals serial console

Schematic

Wire up the hardware accordingly

Analyzing non-standard signals schematic

Prototype

A photo of the actual setup.

Analyzing non-standard signals prototype

References

Watch