Giter Site home page Giter Site logo

rbaron / b-parasite Goto Github PK

View Code? Open in Web Editor NEW
1.8K 38.0 133.0 28.79 MB

๐ŸŒฑ๐Ÿ’ง An open source DIY soil moisture sensor

C 83.61% XSLT 4.77% Python 3.55% CMake 5.80% JavaScript 2.27%
ble nrf52 sensor bluetooth-low-energy iot soil-moisture soil-moisture-sensor

b-parasite's Introduction

b-parasite firmware build

b-parasite

PCB front and back photo

b-parasite is an open source soil moisture and ambient temperature/humidity/light sensor.

Features

Software

This repository also hosts a few different firmware samples for b-parasite.

Sample Description Extra Documentation
samples/ble This is the most battle-tested and useful firmware. It periodically reads all sensors and broadcast them via Bluetooth Low Energy (BLE). It works with Home Assistant + BTHome out of the box. Docs
samples/zigbee An experimental/educational/exploratory basic Zigbee sample built on nRF Connect + ZBOSS. It integrates with Home Assistant via ZHA or Zigbee2MQTT. Docs
samples/blinky The classic "Hello, world" -
samples/soil_read_loop Reads the soil moisture sensor on a loop. Useful for experimenting and calibrating the sensor. -
samples/input Handles button presses. Useful for power profiling GPIO interrupts and testing debouncing for push switches on boards that have them. -

Documentation

Information about how to order, assemble, build the samples, protect the sensor and flash the firmware is on the Wiki.

Repository Organization

b-parasite stuck into a small plant vase

Case

Render of the original 3D printable case

We have three different 3D-printable cases:

  1. Original snap-on case - case/Top.stl, case/Bottom.stl
  2. High airflow - case/b_parasite_case_high_airflow.stl
  3. Mushroom-style - available on Printables

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 derrohrbach avatar drspangle avatar hallsny avatar hedda avatar jhbruhn avatar jrhbcn avatar judman avatar kasbah avatar lonewolf896 avatar mjdsys avatar mneuhaus avatar oleo65 avatar perja12 avatar rbaron avatar sairon avatar scottg489 avatar victorhooi avatar yuvalabou 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

b-parasite's Issues

How to debug?

When I turn on these variable, where or how can I these debug informations?

#define PRST_ADC_BATT_DEBUG 0
#define PRST_ADC_SOIL_DEBUG 0
#define PRST_BLE_DEBUG 0
#define PRST_SHT3C_DEBUG 0
#define PRST_ADC_PHOTO_DEBUG 0

How to order/Build

Hi and thanks for all the work!

I am interested in building some of them myself. Looks like I have to order pretty much everything myself. Could you give some hints/links on how to do that?

I've worked with a lot of sensors and smaller electronics in the past but never actually build/order my own pcbs. So I am a bit lost on that.

Thanks in advance!

Exchange SHTC3 with more abundant SHT3X/SHT20

Hi,

found your project yesterday and love it!
Today was checking the feasability of the current version and wanted to ask why you went for the SHTC3 instead of the rather more often used SHT3X series, especially the SHT31.
The only reason I can find is the bit easier way to solder the sensor due to the packaging of DFN-4 instead of DFN-8 and the pricing - Is that right?
Another option would the the SHT20

The downside is right now that the sensor is really hard to source as on https://lcsc.com/product-detail/Temperature-Humidity-Sensors_Sensirion-SHTC3_C194656.html

splitting sensor and RF-part

hi,

I still follow you project very tightly and will soon order my first batch! Unfortunately, I should have order the nRF when there where still more widely available, but at that time the temp sensor was on short. Anyway...
Will waiting I was thinking if it would be possible to split the sensor (parasitic cap) from the rest of the electronics.

  1. Would make the waterproofing of the electronics much easier, as I can have the nRF outside of my pots, and just the pcb for sensing in the pot.
  2. I have some metal pots, which work kind of as a faraday cage, very bad for the bt-signal.

When checking out the schematics, I see just one connection path (SENS_OUT) to the nRF. So i was thinking just to elongate this path via a cable. Now I'm a bit wondering if it is really that easy, or do I miss something? Thank you anyway for your amazing project!

Feature request of a Zigbee (Zigbee End Device) firmware image for b-parasite

I like to request an optional Zigbee firmware image for b-parasite which could be used as an alternative to the Bluetooth firmware:

https://community.home-assistant.io/t/zigbee-flower-sensors-for-soil-moisture-light-temperature-humidity/272803/

At least the nRF52840 SoC used by Ebyte E73-2G4M08S1C radio module could support Bluetooth, Thread, and Zigbee 3.0 stacks:

https://csa-iot.org/csa_product/nrf52840-zigbee-3-0-for-nrf-connect-sdk/

https://www.nordicsemi.com/products/nrf52840

https://www.ebyte.com/en/product-view-news.aspx?id=445

Would be great if someone with the skills could build the b-parasite application with Zigbee End Device support for nRF5 SDK.

https://www.nordicsemi.com/Products/Development-software/nRF5-SDK-for-Thread-and-Zigbee

https://www.nordicsemi.com/Products/Development-software/nRF-Connect-SDK

Transmission Range

HI,

Thanks for your Work. I created 10 of the version 1.2 bParasites and they work great. Except that the range is very limited. I can place my ESP32 (with ESPHome) no more that 10 meters (line of sight, no Walls) away from the bParasite before the connection drops.
Is anyone having similar Issues? Or is this the expected Range?

I think I already us the most powerfult Trasmission setting (PRST_BLE_ADV_TX_POWER 8).

Thanks for your help!

Theengs Decoder integration

Hi @rbaron and all,

great project! I only stumbled across this recently through another user and have just submitted a decoder PR to Theengs Decoder

Theengs Decoder

a BLE decoding library which can be used on micro controllers (ESP32, ESP8266, Arduino), and on Windows or Unix machines. It's also the BLE decoding basis for

OpenMQTTGateway

and

Theengs Gateway

Hope this helps in getting this project an even wider compatibility.

Thanks

Measure between Transmissions

Arguably, the transmission of the sensor data is the most battery-expensive part of a measurement cycle.
Could we decouple measuring and transmitting and measure between transmission intervals as well, and communicate those measurements in a batch transmission? This could give us a higher measurement resolution for less overall consumption in theory.

These transmissions could either be triggered by an internal counter, or optionally using alarms when a value deviates heavily from it's previous value, or for example the soil moisture is under a certain predefined threshold.

This would make the firmware and receiving logic quite complicated though. Also, I don't know whether more than 1 or 2 data packets could fit into a BLE packet anyways.

RTT with FTDI board using OpenOCD

This question is less about the p-parasite and more about OpenOCD.

As I lack access to a J-Link debugger to program the nRF SoC, I've had to resort to an FTDI-based programmer with OpenOCD.
However, I suspect that my b-parasite doesn't quite work right and wish to investigate the logs it generates.
(It never blinks the LED nor broadcasts any BLE packets and I think that it gets stuck at power_management_init())

Now I've been wondering how to make use of the RTT functionality with OpenOCD, because I can't seem to get that to work either.
As I understand, one has to setup RTT in OCD before being able to 'use' it.
(Syntax: rtt setup <address> <size> <id>)

Unfortunately, if I try to do that with the example values as provided in the OCD docs, I am met with this message:

> rtt setup 0x20000000 2048 "SEGGER RTT"
> rtt start
rtt: Searching for control block 'SEGGER RTT'
rtt: No control block found

Both NRF_LOG_ENABLED and NRF_LOG_BACKEND_RTT_ENABLED are set to 1 in sdk_config.h.

Perhaps I am using the wrong address or control block ID?
My knowledge about RTT is admittedly quite limited.

For reference, I am using a nrf52833.

WiFi version

Hi, have you ever considered designing an ESP based version of the sensor for longer range and wider coverage of WiFi (comparing to BT) ? Thanks, and congrats on this project!!

Add pushbutton to design

I think it would be useful to have a hardware de-bounced pushbutton added to the design. There appears to be room above the coin cell battery.

One idea is to have the sensor broadcast an additional data-point of 'dry set point'. When you press/hold the button the current moisture level is published. Then you could use this in automations to know when the plant needs to be watered. Or you could use this value in the sensor code and publish a binary true/false when the current moisture level falls below the set point.

Orientation of Q4 (Photoresistor) on v1.2.0 - JLCPCB is asking

Hi, got this mail from JLCPCB:

Sorry to bother you, but there is one thing that we want to confirm with you about your SMT order before proceeding.



Since we are not so sure about the polarities of the components Q4 are correct or not.
Could you please kindly check if the polarities and placements of the components are correct in the below picture?
Is it okay to proceed with production?

image
image

I used the latest parasite.csv as BOM and parasite-top-pos.csv for positioning.
As I'm not so good in reading schematics, I Prefer to ask.

My opinion: It's wrong.
The Emitter (PHOTO_OUT) has to be connected to Pin 7 and not 8. For the collector the same just vis-ร -vis.

@rbaron is the pos csv maybe wrong here?

Poll from battery-powered client

Hi - this looks like a fantastic device. We run a solar powered client (central control box) that currently uses wired sensors and I would like to change to wireless. However, the main unit sleeps most of the time, waking every 30 minutes. From what I know about BLE, it's possible to poll a sensor and still maintain a good sensor battery life. Is polling something you have thought of including in the b-parasite rather than broadcasting?

Advice/help to Build the Code firmware

I have a problem following the Wiki because I'm not usual to compile/build/make firmware... (my fault not of the wiki)
I'm using windows10 64bit with visual studio code and I can install all extension you want/need.

Following the wiki steps:

  • Download and Extract SDK Easy but first question: When I extract the folder "DeviceDownload" inside there are all zip files SKD and s112nrf52720 s113nrf52720 s122nrf52800 s140nrf52720 ... I have to extract all of them or only the "nRF5_SDK_17.1.0_ddde560" zip-folder? The command make flash_softdevice will expect a zip file or a simply folder?
  • Configuration Easy editing files.
  • Build the Code This is my big huge problem... I open with Visual studio code for windows the folder that I download from github code/b-parasite. I tried using windows terminal inside Visual studio code to set variable SDK_ROOT (on linux is export SDK_ROOT=C:\Users\andre\Downloads\nRF5_SDK_17.1.0_ddde560 ) but I found on google that on windows is set command set SDK_ROOT=C:\Users\andre\Downloads\nRF5_SDK_17.1.0_ddde560 . But now I'm not able to do make command. The error is like "make is not a known command... command not found". (You can see below)
Screenshot: sorry it is in italian

Is it possible use make command on windows? which visual studio code's extension I have to use? (For example for build marlin firmware for 3d printer there is a specific extension stand alone.) On google there are lot of different methods to use make installing software that I don't know: MinGW or WSL or Chocolatey or Winget. Can I ask you which you use? There is a better way to Build the code on windows? Do you have link tutorials or guide? this tutorial by SparkFun will help me to flash the firmware with my new J-Link EDU Mini but for now I'm stuck... (It will be a second problem)
I have also raspberry and a linux pc but if it is possible I prefer to use windows (also because I download sdk for windows.)
Thanks

How to program

HI,

Nice work!!

I'm looking for guidance on how to program the devices, I have an Atmel ICE that has SWD would that work?

Are there any cheap programmers that could easily be used?

Bad availability of nRF52 module - alternatives?

Hello there, lately I stumbled upon this awesome project and was totally set on building a dozen of those.
Unfortunately, the nRF52 Bluetooth module seems to be more than a little elusive right now, in my region starting only at โ‚ฌ15 per piece.

Therefore, my question(s) did you ever consider any alternative Bluetooth modules? Or if not, could you elaborate on the specific features used by the nRF52 module, e.g. the requirements for other modules?
Then I could try to adapt the board accordingly.

Consider redesign board for CR2477 or CR2450 battery instead of CR2032?

Suggest re-design board with battery-clip/battery-holder/battery-retainer for CR2450 or CR2477 batteries instead of CR2032 batteries?

  • CR2477 is 24 x 7.7 mm in size and usually has about 1000 mAh of capacity on average.
  • CR2450 is 24 x 5.0 mm in size and usually has about 550 mAh of capacity on average.
  • CR2032 is only 20 x 3.2 mm (coin cell size) but only has 200 mAh average capacity.

Alternative universal solder pads supporting fitting battery-clips/battery-holders/battery-retainers for either CR2477, CR2450, or CR2032?

I think that it might be possible to find a cleverly designed battery-clip/battery-holder/battery-retainer for CR2477 that could even be able to hold either a CR2477 or a CR2450 or even two CR2032 batteries stacked on top of each other, or what do you think?

Example:

MYOUNG MY-2477-02 (Mfr. Part # MY-2477-02 LCSC Part # C2979175)
https://lcsc.com/product-detail/Battery-Connectors_MYOUNG-MY-2477-02_C2979175.html

MYOUNG MY-2477-01 (Mfr. Part # MY-2477-01 LCSC Part # C2979173)
https://lcsc.com/product-detail/Battery-Connectors_MYOUNG-MY-2477-01_C2979173.html

MYOUNG MY-2450-01 (Mfr. Part # MY-2450-01 LCSC Part # C964845)
https://lcsc.com/product-detail/Battery-Connectors_MYOUNG-MY-2450-01_C964845.html

Reference:

https://jeelabs.org/2015/07/29/could-a-coin-cell-be-enough/index.html

PS: I personally hate to replace batteries so really looking to get a large battery capacity and a long time between replacements.

Add a brightness sensor

Hello, this is a really nice project.

I am thinking about adding a brightness sensor to be able to better coordinate the location of the various plants in retrospect.

What do you think?

Minimal Case Design

I've been working on getting a bulk order of these sensors together for a home garden sensing project, and I've noticed that it might be possible to drastically reduce the amount of material used in the case without compromising the overall design. Is there any chance that someone with access to a 3d printer might want to take a crack at prototyping? I'm afraid I'm using an outsourcing service for mine, as I haven't got a printer.

Negative Temperature Values

Wanting to use one left-over b-parasite to verify the temperature of my fridge, I noticed that the device does not transmit negative flawlessly (at least not to the ble_monitor solution). Is it a problem with the encoded packets or with the decoding?

As a plant-logging use-case, it might come in handy for plants which are on a balcony, or in the garden, although that specifically will not happen for my plants right now.

Community Gallery

I would love to build a small and friendly community of users, and it's really heartwarming to see pictures of your b-parasites. If you have some and would like to share, I invite you to post them in this issue.

I'll start. I believe this is a type of red Alocasia:

bp1

And a little bonus. This is a fun Calathea time-lapse experiment I ran a while ago:

plantlapse-calathea.mp4

ESP32 with ESP Now

Did you ever test ESP now an an ESP instead of WIFI and maybe 2x1.5 Lithium AA batteries as power source?

BLE has a very bad range in my tests, and ESP now might be better and still save a lot of energy compared to WIFI.

Conformal coating / Case

Hi,
I want to use the sensor outside on my balcony. Would it be possible to coat the pcb and what parts would I need to spare?
Regarding the case, is there any issue with temperatures, is there any max temperature which shouldn't be exceeded?
Thanks a lot for providing the whole informations and the project itself!

Add conductivity measurement

It seems that soil conductivity is an indicator for nutrient-content of the soil. If my understanding is correct, it could be realized via a simple soil-resistance measurement, where the electrodes are spaced with a known distance.

As exposing bare copper would lead to very easy corrosion there, the electrodes could be realised via (stainless steel) screws which are screwed into electrode-screw-holes?

This would obviously mean a rather large redesign, potentially influencing the current moisture measurement circuit (esp. the capacitor) as well (unless introduced as a second prong?).

Offset correction

Some of my sensor are reporting an moisture offset of around 2 โ€“ย 5 %. Is it possible to correct that value? These values seem to be a lot less stable than the 0 % readings I get from the others, when they aren't in soil. Is there already some kind of compensation?

Option to use internal Random Static Address

Changing the config for every device and then recompiling is (comparably) tedious when flashing many devices. Additionally, there is an overhead involved when having to manage the MAC-addresses of all the devices involved.
An option to use the internal random-static MAC-address unique to each nrf-IC in the config could come in handy. The implementation only has to skip the set_address call and read it out for the advertisement package. This coupled with sensor autodiscovery by HA makes provisioning of a new device very handy.
The readout of the address could happen on boot and then logged to the RTT log.

Moisture readings overflow

I haven't dug into this myself yet, but noticed this morning that one of my plants moisture reading "overflowed". When looking at the code, I saw that moisture readings are actually fit to a polynomial and the final values from the equation. Haven't done any debugging yet, so probably not much to go on, but opening the issue as something is clearly miss-behaving. Will follow up as I get time.
I'm also not convinced that the moisture reading is right in the first place. It's continuously trending up, yet I haven't added water to the soil since adding the sensor.

Love this project, thanks a bajillion for open sourcing.

Screen Shot 2021-05-12 at 11 18 35 AM

Screen Shot 2021-05-12 at 11 18 41 AM

Flashing Issue

I've been trying to flash a couple of these PCB's and I am getting this error on one of them

user@box:~/Desktop/b-parasite/b-parasite-main/code/b-parasite$ make flash_softdevice
Flashing: s140_nrf52_7.2.0_softdevice.hex
nrfjprog -f nrf52 --program /home/user/Desktop/b-parasite/nRF5_SDK_17.0.2_d674dde/components/softdevice/s140/hex/s140_nrf52_7.2.0_softdevice.hex --sectorerase
Failed to read device memories.
ERROR: JLinkARM DLL reported an error. Try again. If error condition
ERROR: persists, run the same command again with argument --log, contact Nordic
ERROR: Semiconductor and provide the generated log.log file to them.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.
make: *** [Makefile:316: flash_softdevice] Error 33

Not sure if I maybe cooked my Bluetooth module when I used the hot air reflow station on it, have some more on order but wasn't sure if I was missing something silly in the meantime.

"Increasing" moisture?

I have a few parasites flashed with different intervals to trial the signal pickup and for the most part it seems to be working well....but the data for the moisture being recorded by the log seems to be running in a strange direction. This one has the most data, but other longer interval sensors seem to be trending the same way. Did I screw something up on the programming? I get the battery voltage is tied to the output moisture, but it makes sense the voltage is going down, why would the moisture be going up? Is this expected/within tolerance? I didn't set up moisture/adc debug yet but that's the next step, but not sure where to look necessarily?

edit: I dont think i screwed it up as the main files were all pulled and used the latest firmware from the repo, only changes were MAC and prst name. just reflashed a few with debug on to run overnight, see what happens. (new readings with the new flash are even higher? was reading ~95 now at 100 after reinsertion?) Theoretically all i can think of is i screwed up something with the battery or the coding, or would it be like, interfacing with plant roots potentially that are absorbing moisture? idk! Or does calibration need to happen with every board?

Screenshot_20220812-223610_Home Assistant
Screenshot_20220812-223622_Home Assistant

Alternate Parts Availability

Right now as most have seen the nRF52840 (E73-2G4M08S1C) as proposed is currently unavailable for the most part and the ones that are available have obviously went up in price. From what I can determine this particular version of the part, the advantage is the fact that it is pre-mounted on a daughter board which makes hand soldering easier and has a ceramic antenna already attached.

The Nordic nRF52840 SoC itself is available at LCSC (C190794) for pick and place manufacturing and at a better cost with 14,000+ currently available with more reportedly coming in. Using the Nordic in this fashion also gives you access to more of the IO's that are available.

From what research I can find, the ceramic antenna is what is considered a medium gain antenna. Better range and performance could be achieved by designing in an IFA pcb copper trace antenna that would also occupy near the same footprint of the ceramic antenna.

How to solder nRF52

Hi,

I realize it's not really about the b parasite as such, but I've done what's suggested in the doc and ordered the board and controller separately. But I've never had to solder something that doesn't have pins before and after trying, it's insanely hard, I just made a huge mess.

Any tips, tricks or links to good tutorial on how to assemble this ?
Also is there a list of the "pins" (pads ?) actually used, looks like some of them can be ignored but which ones ?

Thanks !

programming - low voltage detected at the target

hi,

I try to flash the firmware with my J-Link Edu. but unfortunately I get following error? As it's the first time flashing with swd, I cannot figure out what the issue is. After a successful compile, it would like to flash the softdevice part and encounter the following error:

% SDK_ROOT=~/Documents/b-parasite-main/code/nRF5_SDK_17.1.0_ddde560 PLATFORM=E73_2G4M08S1E make flash_softdevice
Flashing: s140_nrf52_7.2.0_softdevice.hex
nrfjprog -f nrf52 --program /Users/lorenz/Documents/b-parasite-main/code/nRF5_SDK_17.1.0_ddde560/components/softdevice/s140/hex/s140_nrf52_7.2.0_softdevice.hex --sectorerase
ERROR: Unable to connect to a debugger.
ERROR: Low voltage detected at the target. Please make sure the device is
ERROR: properly supplied.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.
make: *** [flash_softdevice] Error 43

same for just make flash, the Vcc is directly connected to the jlink. no coincell involved.
Any ideas? Thx

Major battery life improvement

It turns out the SoftDevice lets us put our application in deep sleep while it keeps advertising.

In the current firmware, we have this piece of code:

  prst_adv_start();
  nrf_delay_ms(PRST_BLE_ADV_TIME_IN_MS);
  prst_adv_stop();
  symbolic_go_to_deep_sleep_for(PRST_DEEP_SLEEP_IN_SECONDS);

We can change it into something like this:

prst_adv_start();
symbolic_go_to_deep_sleep_for(PRST_BLE_ADV_TIME_IN_MS);
prst_adv_stop();
symbolic_go_to_deep_sleep_for(PRST_DEEP_SLEEP_IN_SECONDS);

Impact in power consumption

To see the difference, I set:

#define PRST_DEEP_SLEEP_IN_SECONDS 3
#define PRST_BLE_ADV_TIME_IN_MS 1000

Before:
vanilla

After:
adv-sleep

This trick brought the average current while awake from 7.48 mA to 1.63 mA. This drop has a meaningful impact on the oveal battery life.

In both cases the full deep sleep (no app + no advertising), hovers around 3.24 uA:

state-machine-sleeping

If we plug these new values in the battery estimation spreadsheet, for a cycle of 10 minutes:

Before:
image
After:
image

These numbers are optimistic, but the relative increase is very real. I am looking forward to putting this to test in the real world.

Are there J-Link alternatives?

Hi, just wanted to say I love the idea behind this project, and hope to someday obtain some of these for myself.

I wanted to know if you've ever explored any alternatives to jlink debuggers for programming? Given that these devices aren't really available for sale anywhere (cheaply), if we're expecting everyone to fabricate their own devices, obtaining the debugger is a pretty high hurdle to clear.

The suggested devices seem to be essentially sold out everywhere, what ones available on ebay look to be $50, and they also come with the annoying EDU restriction that sounds like it makes it essentially illegal to turn around and sell any products you make from it.

Given that most end users don't really need "debugging" since we aren't developing the firmware, we just need a way to bit-bang in the boot code. Are there other devices or techniques that could achieve this? I see some cheap ARM debuggers on Ali for ~$8 shipped, any idea if something like those work? Is there any way to just bit-bang the interface with a RPI or ESP32 gpio?

Just wondering if you've ever thought about this, to drive more adoption of this project. For a typical user who might like a handful of these devices (~5?), once you have to acquire your own expensive debugger, it probably becomes cheaper to just buy some MiFlora or something rather than spending the expense to make your own.

Thanks!

ble_monitor support in wiki/readme

I just added support for b-parasites to this handy Home Assistant Integration: custom-components/ble_monitor#597
Allows slipping the ESPHome devices with manual configuration, although they can be used as "extension".
The integration discovers the parasites automatically and adds them as a HomeAssistant Device.

Maybe this integration can be mentioned in the wiki or readme as soon as a release with that PR was made.

Consider switching to nRF52840 based module like Ebyte E73-2G4M08S1C instead to also allow Zigbee and Thread firmware?

Please consider switching to nRF52840-based module like Ebyte E73-2G4M08S1C instead to also allow Zigbee and Thread firmware?

https://www.ebyte.com/en/product-view-news.aspx?id=445

https://www.ebyte.com/en/new-view-info.aspx?id=299

https://community.element14.com/members-area/personalblogs/b/blog/posts/trying-out-the-chengdu-ebyte-nrf52840-module

Alternatively could use nRF52840 based radio modules from RFstar like RF-BM-ND05 or RF-BM-ND05I :

https://www.szrfstar.com/product/list-182-en.html

https://www.szrfstar.com/product/155-en.html

https://www.szrfstar.com/product/219-en.html

nRF52840 can support Bluetooth, Zigbee, and Thread so could make a universal hardware design using different optional firmware.

https://devzone.nordicsemi.com/f/nordic-q-a/37602/zigbee-thread-support-for-nrf52832

image

BLE 5 Long Range / Coded PHY

BLE 5 introduced a new PHY - the Coded PHY - which extends the range of BLE at the expense of data rate and current consumption. For b-parasite, data rate is not very relevant, as we only need a few bytes every few minutes.

This article for Nordic finds that the outdoor range is roughly doubled when using Coded PHY under test conditions.

Test Setup

I implemented experimental support for Coded PHY for b-parasite in a7732f1. I flashed two b-parasites, one running Coded PHY and one running the usual Uncoded PHY. Both advertise for 1 s with a 30 ms interval and sleep for 2 s.

I then hacked support for Coded PHY in ESPHome's esp32_ble_tracker component in rbaron/esphome/ble_ext_tracker_component. I'm using it like this in an ESP32-C3-DevKitC-02 dev board with a PCB antenna:

esphome:
  name: prst-ext-tracker
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: esp-idf
    sdkconfig_options:
      CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y

 external_components:
   - source: github://rbaron/esphome@ble_ext_tracker_component
     components: [ esp32_ble_tracker ]

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

api:
  password: !secret home_assistant_api

esp32_ble_tracker:

sensor:
  # Uses Coded PHY.
  - platform: b_parasite
    mac_address: "f0:ca:f0:ca:02:01"
    humidity:
      name: "Coded PHY Humidity"
    temperature:
      name: "Coded PHY Temperature"
    moisture:
      name: "Coded PHY Soil Moisture"
      force_update: true
    battery_voltage:
      name: "Coded PHY Battery Voltage"
  - platform: ble_rssi
    mac_address: "f0:ca:f0:ca:02:01"
    name: "Coded PHY RSSI"
  # Does not use Coded PHY.
  - platform: b_parasite
    mac_address: "f0:ca:f0:ca:02:02"
    humidity:
      name: "Uncoded PHY Humidity"
    temperature:
      name: "Uncoded PHY Temperature"
    moisture:
      name: "Uncoded PHY Soil Moisture"
      force_update: true
    battery_voltage:
      name: "Uncoded PHY Battery Voltage"
  - platform: ble_rssi
    mac_address: "f0:ca:f0:ca:02:02"
    name: "Uncoded PHY RSSI"

logger:

Power Consumption

Default, Uncoded PHY - Average 1.49 mA while transmitting:
uncoded

Coded PHY - Average 7.2 mA while transmitting:
coded

Indoor Range

In this test, I left the ESP32-C3 in my office and walked down the stairs in my building.
Screen Shot 2022-09-11 at 16 09 04

Initial Results

With this first quick and simple test, I unfortunately haven't observed any meaningful differences in indoor range. There are still many parameters to experiment with, of course, but we have to start somewhere. I also want to try a nRF52-based scanner and a better, non-PCB antenna.

Open source the rotisserie / drying jig

A while ago I built this extremely questionable spinning jig to try and get the coating layer to dry more uniformly:

rotisserie

I wrote about it in a twitter thread and to my surprise more people wanted to join in on the fun. Fair warning: don't take it too seriously.

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.