DHT 11 low value problem.

I have a DHT11 temp/humidity sensor which I got as part of a DIY weatherstation kit with LCD. Its now fitted with an additional DS1307 RTC, and SD card reader. I am having some issues with all the components but mainly the DHT11..

Firstly, when the temperature gets to about 16-17 degrees it jumps around, sometimes to 19 degrees and back again. An example log looks something like this (in seconds):

18,18,53
18,18,53
18,18,53
18,18,53
17,16,55 }
16,16,53 }
17,16,53 }
19,16,53
19,16,54
17,16,54
18,16,55
19,16,56
19,17,56
21,17,58
20,18,59
21,18,56
21,18,56
21,18,56
21,18,56

So im heating it up slowly, it should really be at 18 going to 19 but it jumps down to 16/17 and back up, or vica versa. I've tried decoupling and filter capacitors with no change. Sometimes flicks between 16 and 19... is this just an inherent feature of electronics? Do I have a faulty sensor?

I also have a switch to tell it when to write to the SD, its wired in this way: From 5v power rail on breadboard to switch, from switch to breadboard followed by (in series) to digital pin 8 to read input, and resistor to ground.

When the switch is on the temperature jumps up a couple of degrees (17 to 19) and when switched off jumps down again. Someone please explain this??? I thought the DHT was digital how could a switch be interfering? (Note: again, this only seems to happen in the 16-19 range)

please post your code you used
Can you measure the voltage of the DHT during your experiments?

//Arduino 1.0+ Only
//Arduino 1.0+ Only

#include <LiquidCrystal.h>
#include "Wire.h"
#define DS1307_ADDRESS 0x68
#include <dht.h>
#include <SD.h>
#include <EEPROM.h>
#define dht_dpin 9 //no ; here. Set equal to channel sensor is on
dht DHT;

String datastring;
File dataFile;
String temp;
boolean SD_pin=0;
boolean SD_active=0;
int Displaycount=0;
int Mycount=0;
int Total=0;
LiquidCrystal lcd(2,3,4,5,6,7);

int mytemperature, myhumidity, avg;

int second;
int minute;
int hour; //24 hour time
int weekDay; //0-6 -> sunday - Saturday
int monthDay;
int month;
int year;

void setup(){



  Wire.begin();
  Serial.begin(9600);


  lcd.begin(16, 2);
  lcd.clear();
  // Print a message to the LCD.
  lcd.setCursor(2,0);
  lcd.print("Hello world!");
  // make sure that the default chip select pin is set to
  // output, even if you don't use it:*/
  pinMode(10, OUTPUT);
  pinMode(8, INPUT);

  // see if the card is present and can be initialized:
  if (!SD.begin(10)) {
    //Serial.println("Card failed, or not present");
    // don't do anything more:
    return;
  }
  //SD.remove("datalog.txt");

  DHT.read11(dht_dpin);
  mytemperature=DHT.temperature;
  myhumidity=DHT.humidity;
  avg=DHT.temperature;
  delay(1000);
}

void loop(){

  DHT.read11(dht_dpin);
  mytemperature=DHT.temperature;
  myhumidity=DHT.humidity;
  //SD_pin = digitalRead(8);
  lcd.setCursor(0,0);
  lcd.clear();
  Mycount+=1;
  Total+=DHT.temperature;
  avg=Total/Mycount;
  
  datastring=(String)mytemperature+","+(String)avg+","+(String)myhumidity;
  Serial.println(datastring);
  
  lcd.print(int(DHT.temperature));
  lcd.print(" C");
  
  TimeUpdate();
  print_time();
  if (!SD_pin) // if the sd pin wasent active last step
  {
    SD_pin=digitalRead(8);
    if (SD_pin){ // check if its active now
      SD.begin(10);
      lcd.setCursor(0,0);
      lcd.print("Insert SD card");
      //delay(1000);
    }
  }
  else //if the SD pin was active last step
  {
    SD_pin=digitalRead(8);
    if (!SD_pin){ // if its not active now
      lcd.setCursor(0,0);
      lcd.print("Remove SD card");
      //delay(1000);
    }
  }

 if (SD_pin){
    char filename[13];
  temp.toCharArray(filename, sizeof(filename));
  //Serial.println(filename);
  dataFile = SD.open(filename, FILE_WRITE);

  /*if(!SD.exists(filename))
   {
   dataFile = SD.open(filename,FILE_WRITE);
   //break;
   }*/

   //if (dataFile) 
   //{
  dataFile.println(datastring);
  dataFile.close();
  // }
 }

  if (Mycount>=59) {
    Mycount=0;
    Total=0;
  }
  //datastring=(String)mytemperature+","+(String)avg+","+(String)myhumidity;
/*
  if (Displaycount<=10){
   TimeUpdate();
   }
   else {
   lcd.setCursor(8,0);
   lcd.print("Avg: "+(String)avg);
   }*/

  //Serial.println(temp);
  //temp+=".txt";

  if (Displaycount>=20) Displaycount=0;
  Displaycount+=1;
  delay(1000);
}

byte bcdToDec(byte val)  {
  // Convert binary coded decimal to normal decimal numbers
  return ( (val/16*10) + (val%16) );
}

void TimeUpdate(){

  // Reset the register pointer
  Wire.beginTransmission(DS1307_ADDRESS);

  byte zero = 0x00;
  Wire.write(zero);
  Wire.endTransmission();

  Wire.requestFrom(DS1307_ADDRESS, 7);

  second = bcdToDec(Wire.read());
  minute = bcdToDec(Wire.read());
  hour = bcdToDec(Wire.read() & 0b111111); //24 hour time
  weekDay = bcdToDec(Wire.read()-1); //0-6 -> sunday - Saturday
  monthDay = bcdToDec(Wire.read());
  month = bcdToDec(Wire.read());
  year = bcdToDec(Wire.read());

  temp=(String)monthDay+"-"+(String)month+"-"+(String)year+".txt";
}


void print_time(){
  lcd.setCursor(1, 1);
  switch (weekDay)                      // Friendly printout the weekday
  {
  case 1:
    lcd.print("MON  ");
    Serial.print("MON  ");
    break;
  case 2:
    lcd.print("TUE  ");
    Serial.print("TUE  ");
    break;
  case 3:
    lcd.print("WED  ");
    Serial.print("WED  ");
    break;
  case 4:
    lcd.print("THU  ");
    Serial.print("THU  ");
    break;
  case 5:
    lcd.print("FRI  ");
    Serial.print("FRI  ");
    break;
  case 6:
    lcd.print("SAT  ");
    Serial.print("SAT  ");
    break;
  case 7:
    lcd.print("SUN  ");
    Serial.print("SUN  ");
    break;
  }


  Serial.print(monthDay);
  Serial.print("/");
  Serial.print(month);
  Serial.print("/");
  Serial.print(year);
  Serial.print(" ");
  Serial.print(hour);
  Serial.print(":");
  Serial.print(minute);
  Serial.print(":");
  Serial.println(second);

  lcd.setCursor(8,1);

  lcd.print(monthDay);
  lcd.print("/");
  lcd.print(month);
  lcd.print("/");
  lcd.print(year);

  lcd.setCursor(8,0);
  lcd.print(hour);
  lcd.print(":");
  lcd.print(minute);
  lcd.print(":");
  lcd.print(second);
  lcd.println("   ");

}

The voltage with the switch on flicks between 4.48v to 4.5v and with the switch off 4.98v to 5v. I tried disconnecting the LCD backlight and + and -. Once again when the temperature gets near 17 or 19 degrees it flips to the other and then slowly climbs up or down as normal.

Is it a problem with the sensor, or the pins on the arduino, or the wiring? I guess the only way to find out is to buy another sensor and see if that fixes it. I added a 10k "pullup resistor" directly from the data line to arduino but I guess it has to go through the + wire too, I doubt this will fix it though.

Please help im really frustrated at this thing. Could it be that im reading the temperature every second? But then why does it work fine until it reaches either 17 or 19 degrees?

Changing the on/off position of the switch still causes the temperature to jump a few degrees.

how do you power the Arduino?
According to specifications you need USB or a 7V wall wart.
A 5V wall wart is not sufficient.