Using ATtiny 84’s internal temperature sensor

I have always wanted to test the internal temperature sensor that the ATtiny84 has. I think it is quite nice for a really low power node since no external hardware is required. I googled for some time and found a nice example, but for ATtiny85, that MCU has different registers to poke before accesing the internal temperature sensor.I modified the code for ATTiny84 following the datasheet for setting the correct registers. One thing to note about the internal temperature sensor is that it requires calibration. So in my code I added some serial printout to see the readings and adjust if necessary. I was surprised to see that I only needed a correction of 2 in the readings, pretty good results. So I put up a small sketch¬†on github to read the TinySensor’s internal temperature and send it over the RFM12B. You need to modify the¬†TEMPERATURE_ADJUSTMENT define with a positive or negative value to adjust for correct readouts.

Interesting experiment with satisfactory results. As a matter of fact, I also adapted the code for my Attiny85+RFM12B project and it also works nice.

 

Page views: 5757

2 thoughts on “Using ATtiny 84’s internal temperature sensor

  1. Hi Martin
    You’ve done some great projects with these little beasts, ATtiny84/85s!
    I want to replicate this project here using the Attiny85+RFM12B, as you state in the last paragraph of your post:

    > As a matter of fact, I also adapted the code for my Attiny85+RFM12B project
    > and it also works nice

    Is that code available somewhere? Thanks!

Comments are closed.