Home Labs Stories TinyLoRa Atmospheric Sensor


image story


Posted on Jan. 11, 2018

2 Hours


This is a step-by-step tutorial for a ATtiny85 Atmospheric Sensor Node.
I really love the ATtiny series because they are small, cheap and have a very low power consumption.
This Atmospheric Sensor BME280 Node measures barometric pressure, humidity, and temperature every 15 min en goes into sleep mode and is awakened by the watchdog timer.
The RFM module transmits the values to the TTN backend in the Activation by personalization (ABP) mode with a fixed spreading factor over one of the four random channels.

I wrote a easy to use Arduino library with an example sketch that fits in the 8K Bytes Flash Memory of the ATtiny85.
It is based on my earlier sketch from the TTN forum together with the BME280 lib.
Unfortunatly the ATtiny85 is limited witch 5 I/O pins and all are needed for the SPI communication and the RFM95 input.
Luckily we can make use of the Reset Pin PB5 by changing de fuse bits from the ATtiny85 and use it as a normal I/O pin for the slave select of the BME280.
Once changed the Reset Pin into a normal I/O pin you can't programm the chip anymore "unless you have a high-voltage serial programmer",
so it is importent to upload the sketch to the ATtiny before changing the fuse bits.