GithubHelp home page GithubHelp logo

lora-environmental-sensors's Introduction

LoRa Environmental Sensors

Arduino based board for a Atmospheric Sensor BME280 LoRaWan Node. The LoRa Node measures barometric pressure, humidity, and temperature every 5 min. After the measurements, the ATtiny85 goes into sleep mode and is awakened by the watchdog timer. The RFM module sends the values to the TTN backend with Activation by Personalization (ABP) a fixed spreading factor and one of the four random channels. This project is based on the TinyLoRa-BME280 project [1].

BOM

Ref Value Description
BT1 3034 Battery Cell Holder
BT1 CR2032 Battery Cell CR2032 (210 โ€“ 230 mAh)
U1 BME280 SparkFun BME280
U2 ATtiny85-20SU Atmel 8-bit AVR Microcontroller
U3 RFM95W-868S2 Low Power Long Range Transceiver Module
- Wire Wire for the antenna, 8.6 cm

The ATmega microprocessor needs an arduino bootloader. To burn a bootloader to the blank chip see [2]

Wiring

ATtiny85 RFM95 BME280
PB3 CS (Slave Select)
PB4 NSS (Slave Select)
PB2 SCK SCK
PB1(DO) MOSI SDI
PB0(DI) MISO SDO

Installation

The Arduino IDE has to be properly installed.

Add the Libraries to you IDE:

  • Install the Attiny Baord Manager

    Multiple managers can be separated with a comma.

  • Install TinyLoRa-BME280 v1.1

    • Download the ZIP archive from TinyLoRa-BME280 v1.1
    • Install the ZIP archive in the Arduino Library Manager
  • Open Examples > TinyLoRa-BME280_v1.1-master > ATtiny_LoRa_BME280

    • Edit NwkSkey, AppSkey, DevAddr
    • Change the Spreading Factor in ATtinyLoRa.cpp
    • The Sleep time can be set with the SLEEP_TOTAL var.
  • Burn the sketch to the Chip using an Arduino UNO [2]

    • Burn a bootloader first to set the fuses correctly

Payload Format

The Payload is encoded as byte array.

byte content
0..1 temperature (*100)
2..3 humidity (*100)
4..8 barometric pressure

To decode the values add this code in the TTM Console as decoder under Paload Formats.

function Decoder(bytes, port) {
  temp = ((bytes[0]) << 8)
              + ((bytes[1]));
  hum = ((bytes[2]) << 8)
              + ((bytes[3]));
  pres = ((bytes[4]) << 24)
              + ((bytes[5]) << 16)
              + ((bytes[6]) << 8)
              + ((bytes[7]));

  return {
    pressure: ( pres / 100 ),
    temperature: ( temp / 100 ),
    humidity: ( hum / 100 )
  };
}

Links

  1. TinyLoRa-BME280 v1.1
  2. Programming ATtiny85 with Arduino Uno

License

License CC BY 4.0 - Attribution 4.0 International

lora-environmental-sensors's People

Contributors

spielhuus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.