GithubHelp home page GithubHelp logo

bobek / b-parasite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rbaron/b-parasite

0.0 0.0 0.0 22.85 MB

๐ŸŒฑ๐Ÿ’ง A Bluetooth Low Energy (BLE) soil moisture sensor.

Python 0.80% C 94.13% XSLT 1.07% Makefile 4.00%

b-parasite's Introduction

b-parasite firmware build

b-parasite

PCB front and back photo

b-parasite is an open source Bluetooth Low Energy (BLE) soil moisture and ambient temperature/humidity/light sensor.

Features

  • Soil moisture sensor. I wrote about how capacitive soil moisture sensors works on this Twitter thread, based on this great post on wemakethings.net
  • Air temperature and humidity sensor using a Sensirion's SHTC3
  • Light sensor using an ALS-PT19 phototransistor
  • Powered by a common CR2032 coin cell, with a battery life of possibly over a year - see "Battery Life" below
  • Open hardware and open source design

Wiki Pages

Repository Organization

How It Works

Diagram containing two b-parasites, a bridge & an MQTT broker

b-parasite works by periodically measuring the soil moisture, air temperature/humidity and broadcasting those values via Bluetooth Low Energy (BLE) advertisement packets. After doing so, the board goes into a sleep mode until it's time for another measurement. The sleep interval is configurable - I often use 10 minutes between readings, which is a good compromise between fresh data and saving battery.

At this point, b-parasite's job is done. We have many possibilities of how to capture its BLE advertisement packet and what to do with the data. A common pattern is having a BLE-MQTT bridge that listens for these BLE broadcasts, decodes them and ships the sensor values through MQTT messages. The MQTT broker is then responsible for relaying the sensor data to interested parties. This is the topology shown in the diagram above.

Integrations

ESPHome

A popular choice for a BLE-MQTT bridge is the ESPHome project, which runs on our beloved ESP32 boards. b-parasite is officially supported and documentation for using it can be found in the b-parasite ESPHome docs. An example of using this platform is also available in this repo, under bridge/ (check out README.md there for more info).

ESPHome is a battle-tested project with a vibrant community, and is currently the most mature b-parasite bridge. ESP32 are also cheap, so you can sprinkle a few of them around the house to cover a wide range, and even share the same ESP32 with other sensors.

Home Assistant

b-parasite is supported by the ble_monitor Home Assistant custom component - please refer to the docs. This custom component gets Home Assistant to automatically discover nearby b-parasites based on their advertisement data.

Linux/Raspberry Pi & macOS

Another possibility is running parasite-scanner. It is a purpose-built bridge for b-parasites, and runs on Linux and macOS.

This is the quickest way to collect and visualize data from b-parasites, and I personally use it a lot for testing and debugging.

Protocol and Data Encoding

Sensor data is transmitted via BLE advertisement broadcasts. Here you can find a byte-by-byte description of the data as it is encoded inside the advertisement packet.

Battery Life

tl;dr: By taking readings 10 minutes apart, the battery should last for over a couple of years.

The main parameters involved in estimating the battery life are:

  • Current consumption (both in operation and during sleep)
  • Duty cycle (how much time it spends in operation vs. sleeping)
  • Battery capacity - this is roughly 200 mAh for CR2032 cells

Details and power comsumption measurements in the #48. This spreadsheet can be used to estimate battery life for different parameters.

b-parasite stuck into a small plant vase

Case

A 3D printable case model can be found in case/. Render of the 3D printable case

License

The hardware and associated design files are released under the Creative Commons CC BY-SA 4.0 license. The code is released under the MIT license.

b-parasite's People

Contributors

chentadot avatar drspangle avatar hallsny avatar hedda avatar jhbruhn avatar oleo65 avatar perja12 avatar rbaron avatar sairon avatar yuvalabou 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.