1

So I've been trying to get a small project set up for the upcoming eclipse, just to read changes in the humidity and temp during the eclipse.

I have two DHT11 sensors, I'm only using one.

I have downloaded this library (it's at the bottom), and this is the code I'm using.

#include <dht.h>
#define pin 13
dht DHT;
void setup() {

Serial.begin(9600); delay(2500); Serial.print("DHT11 Sensor: April 8 Solar eclipse data\n\n"); delay(1500); }

void loop() { DHT.read11(pin); Serial.print(" "); Serial.print(DHT.humidity); Serial.print(" "); Serial.print(DHT.temperature); Serial.print(",\n"); delay(2500);

}

The goal here is to have csv's that I can copy/paste into a .csv and import to matlab to do what I need on there.

I keep getting the title and "0.00 0.00," for the two data sets. With other libraries and borrowed code sometimes I get -999 for the datasets.

My set up

schematic

simulate this circuit – Schematic created using CircuitLab

My schematic isn't super accurate, the sensor's on the breadboard. LMK your thoughts.

jsotola
  • 1,554
  • 2
  • 12
  • 20

1 Answers1

1

If you are using a standalone DHT11 sensor (Without breakout board) you will need a 1KΩ pullup-resistor between 5v and Data.

The DHT's data pin is an open collector, meaning it can only pull a wire to ground to transmit data. If that wire wasn't pulled up to begin with, it won't have anything to pull down.

If your DHT11 is on a breakout board with the 1KΩ resistor already in place, I would suspect a bad sensor...

TPoE
  • 29
  • 5