My super simple NRF51 touch buttons. I mostly use these to toggle overhead lights that I've converted to Tasmota.



My super simple NRF51 touch buttons. I mostly use these to toggle overhead lights that I've converted to Tasmota.



@NeverDie I spent the last week really deep diving into NRF BLE & NRF networking capabilities.
Some things I learned:

OpenThread is supported on the the NRF52840, NRF52811, NRF52833, as well as 10-15 chips from other vendors.
I really like the ability to route via IP and the fact that all of the nodes communicate with common, well known protocols. I like the secure-by-default approach, and the built in tools for administering networks (commissioning new nodes).
I'm going to keep exploring this route, seems promising....
The latest addition to my coin cell nodes, a PIR motion sensor based on the Ebyte NRF52805 module.
The PIR sensor is a Senba S16-L221D-2. I'm measuring around 24uA, which is higher than advertised, but with the 6-7uA from the NRF52805, should still get me 3-4 years on a single 2477.



Just started testing my new NRF52805 breakout board. I added a new generic variant to sandeepmistry/arduino-nRF5, added a new board to mysensors nRF5, now I'm testing compatibility.
This new NRF52805 chip is interesting. Way stripped down compared to the rest of the NRF5 line. No PWM, no LPCOMP, only 10 GPIO (maybe 8 usable).
But, it's cheap, ~$2.50 for the EBYTE BT104-BT5005 module, compact, and appropriate for most low-power use cases.
Interestingly, the chip does not support the current MySensors default, but deprecated, data rate of 250Kbps. Today I also learned that modules can only communicate on the same data rate. So I created a ESP8266 + NRF24L01+ gateway at MY_RF24_DATARATE RF24_1MBPS, and it worked!
Still need to test a few things:
If all goes well, I'll submit the merge requests and publish this board schematic on openhardware sometime in the next week.

A bed occupancy sensor. 4 50kg load cells, an HX711, and a Wemos D1 to make a wifi scale that rests on a bed slat under the boxspring.
Given the placement and weight distribution it doesn't turn the bed into a huge bath scale, but definitely accurate enough to use the deltas to estimate if there is someone in the bed. I can also tell when our 12lb (5.5kg) dog is on the bed.
I have rules in openhab to turn the overhead fan on and off. Also disables some TTS notifications if somebody is in bed.

Compact, simple NRF52 motion sensor
Ebyte E104-BT5032A NRF52832 module
MH-SR602 Motion Sensor
LiFePO4 AA Battery

First attempt at a modular NRF52805 based board. The smaller board has a Si7021 temp + humidity sensor and a BH1750 light level sensor, both I2C. Ideally, I should be-able to make other sensor boards with the same footprint as long as the sensors are I2C.
Also included:

I'll post pictures of the enclosure when it's ready.
I'm also waiting on delivery of a slightly larger version of this board that holds a 2477 battery and a SMD PIR motion sensor.
@neverdie Yep, I had the same experience with this LTC3108 breakout.
https://www.aliexpress.com/item/LTC3108-1-Ultra-Low-Voltage-Boost-Converter-Power-Manager-Breakout-Development-Board-Module-Diy-Kit/32867270266.html
I also intended to try the following modules which have a ton of functionality baked in. Unfortunately, they multiply the cost of a basic node by 2-5x.
BQ25570
https://www.aliexpress.com/item/32903287631.html
BQ25504
https://www.aliexpress.com/item/32976994195.html
From an energy harvesting perspective, I think rechargeable watch battery + 0.2F super cap + 4 100uf is my favorite setup. Cheap, fault tolerant, very small profile if you use 1206 ceramic capacitors (not shown in this prototype). Based on this design: https://www.allaboutcircuits.com/technical-articles/overview-of-the-ble-solar-beacon-from-cypress-semiconductor/


0.2F 3.3v Capacitors
https://www.aliexpress.com/item/32577753501.html
3v Rechargeable Battery
https://www.aliexpress.com/item/32813917590.html
1206 100uf Capacitors
https://www.aliexpress.com/item/32376068793.html
Cheapest amorphous, indoor solar panels I have found: 2.7-3v
https://www.aliexpress.com/item/1854641441.html
Tiny S4 1N5817 Diodes
https://www.aliexpress.com/item/32813213875.html
USB + ESP8266 adapter for W2812B LED strip.
Well, this is actually a Tasmota + Openhab build, but could easily be MySensors.
Also worth noting, this 5m 150 led strip draws too much current to reliably use with a USB wall adapter.




@neverdie according to a few datasheets 2v at 200lux. The solar cells delivered were HENGYANG SC-3514.
http://www.vimun.cn/en/ProductInfo.asp?pid=18
http://www.solars-china.com/solars/indoor-solar-cells.pdf
On my windowsill, 2.5v typical in-direct sunlight, 2.7v is the highest I've recorded in direct sunlight.
So far, most of my Aliexpress buys have been fine for my needs. Haven't really gotten close to making a "production ready" module, so for prototyping it's been fine.
One exception: I thought I had a genius idea to repurpose these $1 solar powered keychain flashlights. They had an amorphous solar panel, rechargeable battery, button, leds and a housing...for $1. I bought 20 of them. First one I opened up, I realized it's a lie!
The solar panel is just glued to the circuit. The battery is just a normal non-rechargeable CR2016.

Playing around with enclosure designs for my new node

With all the NRF52 modules from EBYTE I've tried, the only way I can flash them is over SWDIO, SWCLK, GND, VCC via JLink clone.
And, before flashing is possible, I have to unlock the module by following these directions: https://github.com/micooke/arduino-nRF5-smartwatches/blob/master/nrf52_disable_read_protection.txt
I've tried a lot of the aliexpress modules.
My experience with cheap modules
@neverdie they work super well. I've been testing them for a few months now, very reliable.
One of the first supercap setups I made, "SolarRed". It's been running non-stop for 8ish months sitting indoors on a windowsill.


6 Month History SolarRed

Testing platform for different solar panel / super cap combos

@berkseo said in What did you build today (Pictures) ?:
Π‘apacitive touch button - V1.0 β 02:09
β Andrew EfektaSB
Looks really good! I like the LED bridge.
@TimO & @fabyte I took a stab at making all of the classes/interfaces @NonNullByDefault and adding/overriding null checks throughout. It builds fine, seems to be working well with my ethernet gateway.
I'm going to look at unit testing next.

No docker expert here, but I think docker-compose is intended to provide the functionality of logically grouping containers/dependencies, as apposed to combining products in a single container.
It could definitely be helpful to maintain a few home automation compose "templates." For example, my template would be: OpenHAB, InfluxDB, Grafana, mosquitto.
@neverdie I was surprised to find the deceptive $1 solar keychain actually used a decent indoor solar cell. I can't find similar spec'd solar cell for less than $3 (at 10-20pcs). Despite the blatant false advertising, they're actually worth salvaging, especially with a solderable CR2032.
@berkseo Thank you!
First, I made the compatibility changes to SandeepMistry. This was surprisingly easy. The SDK in SandeepMistry/nRF5-arduino does most of the heavy lifting. I had to modify a few of the precompiler conditions to exclude PWM, change some serial definitions, and update to new handler naming conventions: https://github.com/sandeepmistry/arduino-nRF5/pull/442
Then, I defined a new Generic NRF52805 variant in mysensors/ArduinoHwNRF5 and handled one assumption of LPCOMP: https://github.com/mysensors/ArduinoHwNRF5/pull/12
Last, I had to handle a few small assumptions in the MySensors library: https://github.com/mysensors/MySensors/pull/1461
Well, adding
*(volatile uint32_t *)0x40004FFC = 0;
*(volatile uint32_t *)0x40004FFC;
*(volatile uint32_t *)0x40004FFC = 1;
just after the Si7021 sensor reading worked. Sleep current is back down to 12uA.
https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev1/ERR/nRF52832/Rev1/latest/anomaly_832_89.html#anomaly_832_89
Probably not the best place for it. I think it should probably live in TwoWire:end() https://github.com/sandeepmistry/arduino-nRF5/blob/8f41ab685197bfc27b56705ee8a7f63f653344ae/libraries/Wire/Wire_nRF52.cpp#L132
Working code
#define MY_NODE_ID 67
#define MY_RADIO_NRF5_ESB
#include <MySensors.h>
#include <SI7021.h>
static SI7021 sensor;
#define SLEEP_SHORT_MS (5000)
#define LED_INFO_PIN (5)
#define SLEEP_MS (30000)
MyMessage msgHum( 4, V_HUM );
MyMessage msgTemp( 5, V_TEMP );
void setup() {
pinMode( LED_INFO_PIN, OUTPUT );
blink(LED_INFO_PIN, 5);
}
void present() {}
void loop() {
blink(LED_INFO_PIN, 1);
sensor.begin(); //needs to be reinitialized after hack to disable
const float temperature = float( sensor.getFahrenheitHundredths() ) / 100.0;
const float humidity = float( sensor.getHumidityBasisPoints() ) / 100.0;
*(volatile uint32_t *)0x40004FFC = 0;
*(volatile uint32_t *)0x40004FFC;
*(volatile uint32_t *)0x40004FFC = 1;
sleep(SLEEP_SHORT_MS);
send( msgTemp.set( temperature, 2 ) );
sleep(SLEEP_SHORT_MS);
send( msgHum.set( humidity, 2) );
sleep( SLEEP_MS );
}
void blink(uint8_t led, uint8_t count){
for(int i = 0; i < count; i++){
digitalWrite( led, HIGH );
wait( 5 );
digitalWrite( led, LOW );
if( i < count - 1 ) wait(100);
}
}
Sensor node on the left, button node on the right.

@NeverDie said in nRF5 action!:
https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/bluefruit-nrf52-api
Ha, I ordered one yesterday. I'll mess around and report back.
@electrik I believe NRF52832 and 51822 are the only supported NRF modules at this time. Some people have experimented and modified dependent libraries to get NRF52840 to work with MySensors but I'm not sure it's completely working and definitely wouldn't start there.
Personally, I like using the Ebyte NRF24 PA+LNA modules for my gateways and repeaters and use the NRF5 modules for end nodes.
I'm not even sure you can use NRF5 as a radio for a gateway, if so it might only work as a serial gateway.
As for additional items, I bought a jlink clone after having trouble unlocking ebyte modules with a STLink. Then my jlink clone caused issues (old firmware, not updatable) so I ended up buying a real JLink-edu.
Other things worth noting: there are a surprising number of hardware bugs with the NRF chips that mostly result in higher power consumption. General advice would be to stay away from NRF51822. EBYTE modules have been consistently reliable, high quality.
@steven987 I would argue the perfect battery setup is a single AA or AAA LiFePO4.
Cons
LiFeP04 Batteries
https://www.ebay.com/itm/12X-SOSHINE-LIFEPO4-AAA-10440-BATTERY-280MAH-3-2V-FOR-WIRELESS-MOUSE-ALARM-TOY/333294469931?hash=item4d99e6032b:g:lk0AAOSw04ddULoH
TP5000 Charging Module (I use for solar charger)
https://www.aliexpress.com/item/32807030878.html
Solar Cells
https://www.aliexpress.com/item/32882323830.html?spm=2114.12010612.8148356.16.192a59c23u0hej
@NeverDie Buttons -> Mysensors Gateway -> OpenHab Rules -> Tasmota Switches / Outlets / Extension cords.
I am tempted to explore the BLE route. It seems to support a majority of my sensor use cases, I like the idea of standardizing on the GATT protocol, and there are already a ton of tools and connectors in place.
@waspie just to follow up, 24hr reboot() is working perfectly. Appreciate the help.
@NeverDie Oh I've been running around 20 NRF52805 nodes for the past ~2 years https://forum.mysensors.org/post/108893. They've been working very well for me.
edit:
PRs to get working with mysensors
https://github.com/sandeepmistry/arduino-nRF5/pull/442
https://github.com/mysensors/ArduinoHwNRF5/pull/12
@skywatch that's good to know, thank you
@mfalkvidd Yeah, I realize I can only use a portion of the strip, or keep it very dim. I actually bought this with the hopes of flashing with Tuya Convert, but turns out they switched to non ESP modules. So, I figured I would make my own.

+1
I've tried the E73 Ebyte NRF52832 modules, various NRF51822, and "diymroe" STM32F407, all with the same result...not seeing anything and nothing to serial out.
Somebody with more experience with hardware debugging could probably dive deeper using STLINK / JLINK tools.
I know there are a few issues related to their use on github:
https://github.com/mysensors/NodeManager/issues/463
https://github.com/mysensors/NodeManager/pull/438
I also remember the project owner, @user2684, mentioned he doesn't get notifications from the MySensors forum, best to open an issue via github.
@waspie Given that all of my interrupt nodes stopped triggering after 36 hrs (before your reboot workaround), it has to be related. Itβs just weird that my nodes would continue to wake up and broadcast battery level.
Is the LPCOMP interrupt method dependent on the wdt? Maybe resetting/restarting the wdt every 24hrs would suffice? Or maybe you have to reactivate LPCOMP every 36 hr wdt cycle?
@sundberg84 I noticed similar issues with my nodes. Given the high internal resistance of coin batteries, there is actually a significant voltage drop during high current scenarios (radio transmission). Enough of a drop to trigger brownout, which then leads to brownout loops.
I recommend disabling status LEDs, and using large capacitor(s) (200uF+), ideally ceramic. I'd also drop BOD to 1.8v.
Also make sure you're sleeping between transmissions (~5 sec) to make sure the capacitors have enough time to recharge.
@Avamander That would make a great gateway. I believe I read a getting started guide by the creator of that Pi Hat, Playing with Thread and MQTT-SN on Nordic nRF52840. The tutorial is a little outdated now, but it's a good overview of the process of setting up a Thread network. There is a lot of good content on that blog.
I agree, but it is still not clear to me what the appropriate relationship between MySensors and OT / BLE Mesh is. It seems there is a lot of overlap in functionality. While I prefer to focus on the NRF5 series, a majority of the community is using ATMEGA328 and NRF24, or LoRa modules, which wouldn't support OT / BLE.
At the very least, I'd like to see MySensors tap into some more of the advanced NRF5 capabilities: OTA, NFC.
There are also a few examples of NRF5 modules running in dual mode: BLE + OT. If it's possible to run 2.4GHz + BLE in parallel, then there is potential to create a MySensors bridge device.
Or maybe leveraging BLE to configure MySensor nodes at runtime: modifying sleep duration, send frequency.
Given the abundance of storage and memory on the NRF5 devices, it is also feasible to create something like Tasmota / ESPeasy for MySensors. Use the same firmware on every node, have the MySensors gateway/controller manage and push configuration templates. Given the great work on MySensors NodeManager and the SmartSleep functionality, it seems like the foundation is already in place.
@martim Yep, you just need to make sure to turn off the EEPROM module after setup, then it's basically an Atmega328p and NRF24L01+. It has solderable jumpers to bypass the voltage regulator and status LED.
Here is a claim of 12uA in sleep: https://forum.mysensors.org/post/96631
@NeverDie Once covid started, my aliexpress luck really took a dive. Two missing shipments, one partial shipment, and very little recourse. If I absolutely have to, I'll buy from banggood. I don't think I would make such an expensive purchase on aliexpress, especially when shipping is a significant portion of the cost. OR, I would want to talk to somebody who has purchased from that seller and has the exact product I'm looking at.
Contrary to my 3D printing and PCB/component experience, where I do okay with cheap/counterfeit parts, the tolerances and high cost of mistakes in my CNC experience are leading me to pay the premium for quality parts.
@Jon-Raymond I pushed my latest changes, posted a question to the merge about next steps.
@waspie Looks like there is a related issue with NRF51822
#35 in https://infocenter.nordicsemi.com/pdf/nRF51822-pan_v2.0.pdf?cp=5_4_1_8
But I don't think you'll need to do hack I listed above (not sure it'll even work for NRF51822). You can probably replace the three lines above with
NRF_TWI0->ENABLE = 0;
NRF_TWI1->ENABLE = 0;
Just be sure to call Wire.begin() before each sensor read. Or if you're using a library, make sure you call the service that calls Wire.begin(), in my case that was sensor.begin().
I'll try with one of my NRF51 modules tomorrow and report back.
I should add that I haven't tried PCB milling yet. I mostly try to make aluminum parts with my 3040 machine.


@Jon-Raymond Well, not seeing a lot of activity in the repo.
I took a very long shot at adding support https://github.com/nikolac/arduino-nRF5/tree/nrf52805-s112-support.
I was able to flash the softdevice, but I haven't tested or even uploaded a working sketch (sloppy). Feel free to mess around and test. If it works for you, I do the same for S113.
Biggest question I have is around figuring out the proper values for the "linker scripts" https://github.com/nikolac/arduino-nRF5/blob/nrf52805-s112-support/cores/nRF5/SDK/components/softdevice/s112/toolchain/armgcc/armgcc_s112_nrf52805_xxaa.ld
@neverdie Not that I've found. A thread here, a thread there, but nothing focused. Might make sense to create a new mysensors forum category, Energy Harvesting?
Forum is a good place for conversation, but I think a wiki would really help document the results of those conversations. Also a place to provide some intro material: What is energy harvesting? Why pursue it? The easy route, the advanced route...
I'd gladly help with the content.
One thing I had to do was explicitly set secure="false" into /opt/openhab/userdata/config/org/openhab/mqttbroker.config.
Please try that, then restart.
@willemx I have a MySensors weather station powered by a 5.5v solar panel, TP5000, and a AA LiFePO4 that has been running for 2 years.
I also have a couple of soil sensors with a similar set up. It's been very reliable.
If you take the battery out while the TP5000 + solar panel is still connected, I believe it will pulse 3.2 - 3.6v into your board. I would recommend using a HT7333 or XC6206 voltage regulator and a large capacitor, just in case.
You don't need to be super concerned with power efficiency. I find my small solar panel tops off the battery within the first hour of indirect sunlight.
@neverdie I've primarily been prototyping with the SC14351 because I don't have to worry about voltage regulation when coupled with supercaps.
@NeverDie Currently using 6, [GND, VCC, SWDIO, SWCLK, - , TX, RX, -, -, -]

@neverdie I used tantalum because they were laying around and I was too impatient to wait for the 1206 100uf ceramic caps I had ordered.
Those are definitely interesting. The high ESR on the lower capacitance coin-cell "H-type" 0.47F super caps caused a voltage drop significant enough to trigger brownout on my first few nodes.
I was hoping to try these out, but they seem to have been discontinued https://www.mouser.com/new/Murata/murata-dmh-supercaps/.
@neverdie Awesome. Interested to see how they work out for you.
For other options, this is the only retail outlet I've been able to find that carries different size/volt versions of the chinese amorphous panels.
https://cnmarsrock.aliexpress.com/store/group/Amorphouse-solar-panel/400691_511437499.html
@neverdie In theory, indoor is optimized for visible light spectrum. Outdoor, a combination of visible and IR. https://www.powerfilmsolar.com/about-us/the-horizon-blog/2018/08/10/outdoor-vs-indoor-solar-the-key-differences
But, who knows with these chinese panels. I haven't tested the indoor vs outdoor side by side. I do know these amorphous "outdoor" panels work significantly better indoors than the mono/polycrystalline panels I have.