Giter Club home page Giter Club logo

weather-node's Introduction

Weather Node

Weather Node is a small battery-powered temperature and humidity sensor that transmits measurements via Bluetooth LE to your phone.

The battery is expected to last for 3 - 6 months (depending on battery and ambient temperature).

You can easily assemble your Weather Node as it requires very few components:

  • MCU board with nRF24LE1 microcontroller;
  • DHT22 (or DTH11) temperature/humidity sensor;
  • battery socket for CR2032;
  • two resistors (10k), two capacitors (0.1uF and 4.7uF), and an LED.

After assembling, you could get something like this:

Schematics:

In order to upload firmware to the nRF24LE1 board you may also need FT232RL usb-uart convertor or an Arduino. Check out these links for more info on nRF24LE1 flashing options.

Arduino-based Weather Node

A version of Weather Node built with Arduino Pro Mini (or any other) and nrf24L01 module.

This is a reworked version of BLE_beacon project by cbm80amiga adapted in a way so it would work with Weather Node Station, an Android app.

The device can use external DHT11 sensor (humidity + temperature) or internal Arduino sensor (temperature only).

Main changes from the original version:

  • CPU clock is lowered to 8MHz for boards with 16 MHz crystal (for reliable operation from 3v battery);
  • connection of CE pin of nrf24L01 moved to Arduino pin A0;
  • BLE data format of Weather Node;
  • random MAC generation on power-on;
  • usage of calibration values for the internal Arduino temperature sensor (this should give better temperature precision);
  • longer sleep period.

Notes on Arduino power supply

If you plan to power the device from CR2032 or another low-capacity power source, add 300uF capacitor in parallel to the battery, as nrf24L01 chip creates a current surge during data transmission that can reset the Arduino. Also, remove the power regulator IC and LEDs from the Arduino board for lower power consumption.

Weather Node Station

Weather Node Station is an app for your phone that receives data from Weather Nodes.

Only Android version is available now (.apk). After installation you will need to give the app permissions to access Bluetooth (on modern Android versions it also requires Location permissions as well).

The app is developed with react-native framework, so it's possible to compile it for IOS (I'm sure it'll require some fixes though). You're very welcome to try and do that, especially if you have the necessary environment installed.

How to use with ESPHome and Home Assistant

See #8

Project Files

  • wnode1-firmware/ - firmware for Weather Node MCU (nRF24LE1). Project for Code::Blocks with SDCC
  • wnode2-arduino-firmware/ - Arduino sketch for Arduino-based Weather Node
  • wnodestation/ - React Native app for phone

Known Issues

  1. DHT22 turned out to be a crappy sensor. It showed very bad stability under freezing temperatures and low voltage power supply. It will be replaced with superior AHT10 the moment I'll get my hands on it.

Funny readings from DHT22 after 12 hours in my fridge (~ +5°C).

BLE Protocol Details

Weather Node emulates BLE advertisement packages. All meaningful data is packed in "Manufacturer Data" section. Layout of the section:

Field Offset (bytes) Size (bytes) Value
UUID 0 2 UUID[0] == 0xA9, UUID[1] ==0x53
Humidity 2 2 Humidity in DHT22 format
If (humidity[0] == 0x80 && humidity[1] == 0x00) then
the channel is inactive.
Temperature 4 2 Temperature in DHT22 format
Flags 6 1 Bits 0, 1: battery level (0 - HIGH, 1 - MED_HIGH, 2 - MED_LOW, 3 - LOW)
Bit 2: sensor failure flag
Reserved 7 1 -

License

All files in this repo, except ./wnode1-firmware/nRF24LE1_SDK and ./wnode2-arduino-firmware go by MIT License © github.com/AlexIII

  • wnode1-firmware/nRF24LE1_SDK is a separate project. It's licensed under LGPL v2.1.
  • wnode2-arduino-firmware is a modified fork of BLE_beacon project by cbm80amiga. It's licensed under LGPL v3.0 © 2019 Pawel A. Hernik.

Due to SDK licensing, precompiled firmware (*.hex) for nRF24LE1 is under LGPL v2.1.

weather-node's People

Contributors

alexiii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

weather-node's Issues

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.