ATTiny85 and DHT11 - Sensor always returning 0 Good day.

I am making a small weather station using ATTiny85, DHT11, and an OLED display.

There are many, many tutorials that explain how this works, and various libraries that show you how to get the DHT11 to work with the ATTiny85 and others that are dedicated to the SSD1306 Oled displays, some even show you how to combine them together. Well, for the better part of 2 days nothing worked for me.

My schematics is as follows:


And here is a picture of the actual thing, working with a CR2032 Coin Cell:



The Libraries I am using are:


OLED Libraries for ATTiny85 - Source: http://www.14core.com/wiring-digispark-attiny85-with-096-oled-screen-display/
Rob Tillaart DHT Library - Source: https://github.com/RobTillaart/Arduino/tree/master/libraries


My Code is as follows:

    //OLED Libraries for ATTiny85 - Source: http://www.14core.com/wiring-digispark-attiny85-with-096-oled-screen-display/

#include &lt;font6x8.h&gt;
#include &lt;font8x16.h&gt;
#include &lt;num2str.h&gt;
#include &lt;ssd1306xled.h&gt;
#include &lt;ssd1306xled8x16.h&gt;
#include &lt;SSD1306_minimal.h&gt;
#include &lt;TinyWireM.h&gt;
#include &lt;USI_TWI_Master.h&gt;

#define DEG "\xa7" "C"

SSD1306_Mini oled;

char strHum[4];
char strTemp[4]; 

#include &lt;dht.h&gt;
dht DHT;
#define DHT11_PIN 1


void setup()
{


  TinyWireM.begin(); // initialize I2C lib - comment this out to use with standard arduinos
  oled.init(0x3c);
  oled.clear();



}


void loop()
{

  //            DHT Code goes here                              //

  DHT.read11(DHT11_PIN); //Calling the read function

  float hu  = (DHT.humidity, 1);
  float te  = (DHT.temperature, 1);



  //            OLED Start -- DO NOT CHANGE ANYTHING            //

  //oled.clear();

  oled.startScreen();
  oled.cursorTo(10, 0);
  oled.printString("ATTiny85 &amp; DHT11");

  oled.startScreen();
  oled.cursorTo(12, 9);
  oled.printString("Temp &amp; Humidity");

  oled.startScreen();
  oled.cursorTo(10, 18);
  oled.printString("www.MDChaara.com");

  oled.startScreen();
  oled.cursorTo(0, 27);
  oled.printString("mdchaara@gmail.com");


  oled.startScreen();
  oled.cursorTo(0, 45);
  oled.printString("Humidity(%): ");

  oled.startScreen();
  oled.cursorTo(110, 45);
  oled.printString( itoa(int(hu), strHum, 10));


  oled.startScreen();
  oled.cursorTo(0, 55);
  oled.printString("Temperature(c): ");


  oled.startScreen();
  oled.cursorTo(110, 55);
  oled.printString( itoa(int(te), strTemp, 10));


  //            OLED End          //


  delay(5000);
}


Now I know that the OLED code works, and it was a very interesting round or research to get it to work. The DHT code is another story. I have tried 6 different libraries and none of them worked. They all either return 0, 1, or blank readings on the screen.

I have checked if the sensor is working with an Uno and a Nano, works well! I checked the connections, and the soldered parts and did continuity tests, but the issue still remains.

I am asking because I am hoping a fresh set of eyes can pin-point the issue that I am facing. Any help will be highly appreciated.


Arduino IDE: 1.8.2
OS: Windows 7 64 bits
Micro controller: ATTiny85-20PU


Sketch is uploaded to the micro controller using Arduino Uno as a programmer.
Sketch is uploaded at Internal 8MHz clock setting.

Thank You.
Ok i tried something like that for myself and thanks to this and ..many other posts and forums/videos i could make myself something that works but with a little other setting like in the start post (other libs ect)

in my case the main reason for the "1" output on the oled was this:

  float hu  = (DHT.humidity, 1);    //original

  hu  = (DHT.humidity);       //what worked for me 


Maybe you can figure out more Problems, my code is shure not perfekt! But maybe it helps someone for a vew steps

#include &lt;dht.h&gt;
#include &lt;U8x8lib.h&gt;
#define DHT11_PIN 1
dht DHT;
int temp = 0;
int humi = 0;
char strTemp[4]; 
char strHumi[4];

U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(/* clock=*/ 2, /* data=*/ 0, /* reset=*/ U8X8_PIN_NONE);         // Digispark ATTiny85 Pin 0 Data, Pin 2 clock



void setup(void)
{

  u8x8.begin();
  u8x8.setPowerSave(0); //enegergiesparen 0 aus

}

void loop(void)
{

  int chk = DHT.read11(DHT11_PIN);

  temp = (DHT.temperature);
  humi = (DHT.humidity);



  u8x8.setFont(u8x8_font_chroma48medium8_r);
  u8x8.drawString(0,0,"~~~~~~~~~~~~~~~~");
  u8x8.drawString(0,1,"Temperatur");
  u8x8.drawString(1,2,( itoa(int(temp), strTemp, 10)));
  u8x8.drawString(4,2,"Grad Celsius");
  u8x8.drawString(1,3,"--------------");
  u8x8.drawString(0,4,"Luftfeuchtigkeit");
  u8x8.drawString(1,5,( itoa(int(humi), strHumi, 10)));
  u8x8.drawString(4,5,"Prozent");
  u8x8.drawString(0,6,"~~~~~~~~~~~~~~~~");
  delay(200);
}