DHT11 Temperature and Humidity pull up resistor?

mauried:
The pullup resistor is needed because the data line to the sensor is bidirectional.
The sensor only sends data after its been told to by the Micro .
However, depending on the code that actually reads the Sensor, some Micros have weak pullups in them
that means that the resistor may not be needed.
You would have to study the code thats actually doing the sensor reading to see if this is the case.
The resistor value isnt critical, 10K is a good value.
Also, some suppliers of the sensor send it on a small breakout board, which already has the resistor installed.
If the Sensor is jumping back and forth between degree readings 3 D apart, then there is something wrong with either the code thats reading it
or the wiring , or the sensor itself.
The Sensors are pretty rugged so its not likley to be the Sensor.
They either work properly or not at all.

I added a 10k pullup resistor, I didn't really notice too much difference. Maybe its slightly faster now, I dont know. This is the relay module I have: http://i01.i.aliimg.com/img/pb/906/184/488/488184906_511.jpg I know it has a built in diode but not sure about the resistor.

I saw the temperature doing the 3 degree dance again this morning, it always seems to be between 16 and 19. The other thermometer was showing around 15 so 16 was the closer one. I AM setting the relay on at 19 and off and 20... could it somehow be getting stuck after I switch the relay pin to high?

As regards to analyzing the code, well I followed the instructions and downloaded the DHT library from here: http://www.hobbyist.co.nz/?q=documentations/wiring-up-dht11-temp-humidity-sensor-to-your-arduino.

I don't understand, how do I open the library to see what the DHT.read11(dht_dpin) is doing? I am assuming the dht library I downloaded is a standard one and thus should be relatively the same? Or is that library different to the one here? Arduino Playground - HomePage

This is my code which I copied from the former above and pretty much hacked it into my current prototype. However after a quick skim I don't see any mention of of a DHT.read11() function in the latter.

#include <dht.h>

#define dht_dpin 14 //no ; here. Set equal to channel sensor is on

dht DHT;
int flip=0;
int Max=0;
int Min=99;
int setemp=0;
float potvalue=0;

#include <LiquidCrystal.h>
LiquidCrystal lcd(0, 1, 2, 3, 4, 5);

void setup(){
lcd.begin(16, 2); 
//Serial.begin(9600);
delay(300);//Let system settle
pinMode(12, OUTPUT);
//Serial.println("Humidity and temperature\n\n");
delay(700);//Wait rest of 1000ms recommended delay before
//accessing sensor
}//end "setup()"

void loop(){

//This is the "heart" of the program.
DHT.read11(dht_dpin);
potvalue = analogRead(A1);
setemp=(potvalue/1012)*30;

if (int(DHT.temperature)>Max) {
Max=DHT.temperature;
}

if (int(DHT.temperature)<Min) {
Min=DHT.temperature;
}

if (DHT.temperature<20)
  digitalWrite(12, HIGH); 

if (DHT.temperature>19) 
  digitalWrite(12, LOW); 

lcd.setCursor(0, 0); 
lcd.print("Temp=           ");
lcd.setCursor(6, 0);
lcd.print(int(DHT.temperature), DEC);
lcd.print("C");
if (((millis()/1000) % 15) > 7 ){
lcd.print(" Max ");
lcd.print(Max);
}
else
{
lcd.print(" Min ");
lcd.print(Min);
}
lcd.setCursor(0, 1);
lcd.print("              ");
lcd.setCursor(0, 1);
if (((millis()/1000) % 15) > 7 )
{
lcd.print("Humidity = "); 
lcd.setCursor(11, 1); 
lcd.print(int(DHT.humidity), DEC);
lcd.print("%");
}
else
{
  lcd.print(setemp);
//lcd.print(millis()/1000);
}


//Serial.print("Current humidity = ");
//Serial.print(DHT.humidity);
//Serial.print("% ");
//Serial.print("temperature = ");
//Serial.print(DHT.temperature);
//Serial.println("C ");



delay(1000);//Don't try to access too frequently... in theory
//should be once per two seconds, fastest,
//but seems to work after 0.8 second.
}// end loop()

Edit:

One more thing I can think of, and im sorry this is starting to become more programming/wiring questions. But I have the third pin on my lcd (contrast pin to resistor to ground), connected through a resistor over the breadboard seperator into the adjacent bus*, and then into my ground bus on the breadboard. But I ran out of room on the breadboard ground bus and now I have my relay ground connected to the previous adjacent bus*

I dont recall the drastic temperature jumps when the relay wasent connected, but there has always been the low temperature inaccuracy (maybe its a flaw of the DHT11?)

Note: I also have the data line pullup resistor going to a seperate empty bus, that bus is then connected to the digital A0 pin on the arduino.

Thanks guys your help has been greatly appreciated so far and will continue to be so.