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.