ATTiny85 and DHT Sensor

Hi everyone, this seems to have a few old posts which I've read and still seem to be stuck. Any help would be appreciated.

I have an ATTiny85 and wanted to be able to put a sensor on it and send the data wirelessly. I have the wireless part working. But can't get a reading from either a DHT 11 or DHT 22.

I'm currently running the ATTinyCore @ 8mhz, with 3.3v at at vcc of both the uc and the DHT sensor.

I've tried various libraries, but currently trying the following (I've seen some having success with it for the same setup I'm doing). Not sure which version I have (0.1.29), I grabbed the latest from git.

Currently I'm always getting a read timeout.

I've tried various things I've seen others say fixed their issue

  • Changing the timeout the library uses (1000, 10000)
  • various sizes for a pull up resistor on the data pin
  • Tried removing the wireless lib/code to remove possible collisions
  • tried a couple of different DHT11 sensors I had and DHT22

I then modified the DHT lib code to get an idea how far in the loop its getting. and printing it out to soft serial

DHT Read Result -5 idx 40
DHT Read Result -5 idx 40
DHT Read Result -2 idx 40
DHT Read Result -2 idx 39

-5 error is DHTLIB_ERROR_ACK_H
-2 error is DHTLIB_ERROR_TIMEOUT

The idx value is the value of the bit trying to be read in the loop here

// READ THE OUTPUT - 40 BITS => 5 BYTES
for (uint8_t i = 40; i != 0; )

It seems to be getting close, but never getting an actual valid result yet.

The code I have is minimal to try and get a reading, in the loop reads the sensor, sleeps for 10 seconds.

Alright figured I'd post the fix, had an epiphiny while waiting to fall asleep last night. Definitely a NOOB moment.

In my setup with the ATTiny85, I used the 3 pins solution for the RF24 board that you can find with a quick google. Leaving me with 2 pins to play with. I figured I'd use one for the sensor, and the other for software serial for debugging.

The RF24 comms worked great, and the software serial worked great too. To setup the software serial you need to give it 2 pins, RX and TX, I only needed TX, but you can't pass the SoftwareSerial lib the same pin, bad things start to happen. So... I gave it both free pins I had left... <-- Yeah if you haven't picked it up this is where my issue was. The SoftwareSerial was messing around with the pin I told it to use for RX, but was using it for the sensor...

This morning I switched the use of SoftwareSerial lib to a send only version which only requires 1 pin... and voila everything worked... lmao

link to the send only software serial... just in case other make the same mistake I did