I tried to make a simple project with Attiny85 chip and DHT11 sensor. After 2 days of struggle, made it finally work, but not quite as expected. TinyDHT library does work, while DHTNEW does not.

I wonder,

  • what can be changed to make any of the libraries work at lower clock rate?
  • how to make DHTNew work?

My results so far:

with TinyDHT:

  • @ 16 MHz works nominally, showing valid T/H values (if I breathe on the sensor, it shows 95-99% humidity)
  • @ 8 MHz, shows nothing (either nan, or zeros)
  • @ 1 MHz, shows temp/hum as 5, 5 (or 50, 50, can't tell)

with DHTNEW:

  • @ 16 MHz returns SENSOR_NOT_READY
  • @ 16 MHz with mySensor.setDisableIRQ(true); -> WAITING_FOR_READ at first, then nothing (nan or 0)
  • @ 8 MHz WAITING_FOR_READ at first, then TIMEOUT_C
  • @ 8 MHz with setDisableIRQ -> always TIMEOUT_C
  • @ 1 MHz always TIMEOUT_A

Here's the setup on photo and as a scheme. Arduino UNO works as a programmator for Attiny chip, as shown in this tutorial. After I upload the code to Attiny85, the chip starts working normally, and there's no need to disconnect the Arduino board. (For actual work, I disconnect it, connect 5V power, and it works the same way.)

Settings in the IDE:

  • Board: Attiny25/45/85
  • Processor: Attiny85
  • Clock: Internal from 1 to 16 MHz
  • Programmer: Arduino as ISP

How I test this:

  • change clock frequency
  • run Tools -> Burn bootloader
  • run Sketch -> Upload
  • wait till upload ends (RX/TX diodes stop blinking)
  • the LED on breadboard blinks me the numbers

Physical look

Connection scheme

  • 1
    Reading the measurements requires somewhat accurate timings (i.e. millis() needs to work). Did you check that a blink sketch blinks at the expected frequency when you change your clock settings? – Mat Nov 30 '20 at 9:40
  • @Mat It blinks somewhat correctly, but I need to check that to tell more exactly. It may be some % off, indeed. – culebrón Nov 30 '20 at 10:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.