I tried to use an ATTiny85 with the TinyDHT library with the DHT11 sensor for a thermostat-type circuit. Code is not the problem, have checked countless times.
I found that the DHT11 needs a 16mhz clock, which - no problem, I already have 8 of those for another project. Put it across pins 2 and 3 (of the attiny, not digital pins), put 2 22pf capacitors from pins 2 and 3 to ground.
I selected the 16MHz (external) option in Arduino IDE (using Arduino as ISP, pins connected correctly). I was able to burn the bootloader, but when I wanted to upload my sketch to the chip, it either gives me
avrdude: Expected signature for ATtiny85 is 1E 93 0B
Double check chip, or use -F to override this check.
or
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
If I try to change the clock speed again, it still gives me the same error. Is my ATTiny dead?
Show a wiring diagram of the Attiny85 with external oscillator and any necessary load capacitors.
I guess your change to configure it for a 16MHz external oscillator worked but it now appears that that external oscillator, which it now requires, does not perform correctly.
Would you mind sharing the referece for this info? How many volts are you providing to the circuit?
I have a working project (small device that shows temp/humidity in a 0.96" OLED) that uses Attiny85 and a DHT11 at 8 Mhz. What I found out is that the sensor is not found if you provide 3V (2xAA batteries). So I needed to use 3xAA (4.5V).
At this point I agree with @6v6gt and providing the external oscillator may "resurrect" your ATiny85.
Agree with @6v6gt here. It sounds like you've correctly configured the chip to use an external clock source but that clock source isn't working correctly. You need that clock source working otherwise you will see the symptoms you describe.
There is an Arduino as ISP sketch - not sure if they all do it - that also generates a clock - think it's 4MHz - on a pin that can be used in exactly this situation.
EDIT: Take a look here for a modified programming sketch from AdaFruit that outputs an 8MHz clock:
It says:
... a fork of Arduino's ArduinoISP which adds an 8 MHZ 'crystal' output on pin #9 so you don't need an extra oscillator/crystal. Can also rescue some bricked chips with bad oscillator fuses
First check that your ATtiny85 is function by following the example of the attached file. (You ned to use a fresh ATtiny85 NOT the one you are currently working and suspecting.) ProgrammingATtiny85 (5).pdf (172.6 KB)
This is a rough schematic. I tried getting help from ChatGPT but it continuesly told me to check the wiring edit: forgot to mention but im using 5v from a custom made power source box (its just a step up, really)
A fresh Attiny85 that comes from factory is set to to work using internal 8 MHz oscillator which has been configured by manipuating the Fuse Bits.
When you want to operate the chip using external 16 MHz crytal, you must set the fuse bit properly.
The following Tables are the summary of the fuse bits of ATtiny85 MCU. You need an AVR Programmer (Fig-1) or Universal Programmer (Fig-2) to change the fuse bits.
Yes! The clock options are dependent on the fuse bits named: CKSEL0-CKSEL3.
Now, it is importatnt for me to know the values of the Fuse Bits of your ATtiny85 to proceed with the trouble shooting process.
If you have a Programmer, then read the fuse bits and post it here; else, get few new ATTiny85 and learn programming using the attached file of post #6.
I can’t match that photo with your post #7 schematic? Apart from the show/stopping short that @runaway_pancake spotted, it looked right to me. But the photo….