Moisture Sensor from BeFlE

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
bloop16
New user
Posts: 7
Joined: 04 Feb 2021, 15:48

Moisture Sensor from BeFlE

#1 Post by bloop16 » 19 Mar 2023, 16:36

Dear Community,

I have bought an Moisture Sensor called SoMoSe from BeFlE and am trying to get it working.
Sadly a couldn't find a device to get the Sensor working.
Does anyone know how to get the sensor working?
Is there a way to get an i2c device running without the separate device?
I`m not a developer and my knowledge is not good enough to understand what the developer ment.

https://github.com/BeFlE/SoMoSe

Thank´s for your help

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#2 Post by Ath » 19 Mar 2023, 17:21

ESPEasy currently supports this moisture sensor.

The plugin for this sensor is available in all Collection builds and the Climate build.
There is no support (yet) in the plugin for the model you have selected (have a link where to buy that?), but it's possible to add that. Your sensor doesn't support the "Light" measurement, that is available in the miceuz sensor I linked, so that would read 0 in all cases.
/Ton (PayPal.me)

bloop16
New user
Posts: 7
Joined: 04 Feb 2021, 15:48

Re: Moisture Sensor from BeFlE

#3 Post by bloop16 » 19 Mar 2023, 17:33


User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#4 Post by Ath » 19 Mar 2023, 17:43

I'll try to add support for this sensor.
/Ton (PayPal.me)

bloop16
New user
Posts: 7
Joined: 04 Feb 2021, 15:48

Re: Moisture Sensor from BeFlE

#5 Post by bloop16 » 19 Mar 2023, 17:57

Thank`s a lot! :D

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#6 Post by Ath » 01 Apr 2023, 13:30

bloop16 wrote: 19 Mar 2023, 17:57 Thank`s a lot! :D
I have created PR #4582 that adds support for the BelFlE Soil moisture sensor. Can you please test using this Actions build (once it's finished, you will need one of the Collection builds, or a MAX build when working with an ESP32 with 16MB Flash), and report your findings here?

NB: I ordered such sensor myself, so have already done some quick tests here.

Edit: Updated to newer Actions build
/Ton (PayPal.me)

bloop16
New user
Posts: 7
Joined: 04 Feb 2021, 15:48

Re: Moisture Sensor from BeFlE

#7 Post by bloop16 » 01 Apr 2023, 22:49

WoW, really quick!
Seams to work, i'll gonna test in soil for the next week!
And check how it is working with a second sensor.
Thanks a lot!

bloop16
New user
Posts: 7
Joined: 04 Feb 2021, 15:48

Re: Moisture Sensor from BeFlE

#8 Post by bloop16 » 06 Apr 2023, 21:19

Everything fine, seams to work great!
Shall i test anything else?

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#9 Post by Ath » 07 Apr 2023, 19:27

Thanks for reporting your results.
I've updated to latest available mega update, but that shouldn't change the working of this plugin, though you are welcome to re-test using the latest build from this Actions run
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#10 Post by Ath » 10 Apr 2023, 14:28

bloop16 wrote: 06 Apr 2023, 21:19 Everything fine, seams to work great!
Shall i test anything else?
The PR has been merged, and included in the latest release. Documentation is also updated.
/Ton (PayPal.me)

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#11 Post by sptotal » 29 Sep 2023, 15:47

Which release binary I have to flash to get the BeFlE moisture sensor on a Wemos D1 mini?

If I flash the current one ESP_Easy_mega_20230822_normal_ESP8266_4M1M.bin I can not see any device Environment - Soil moisture sensor.

TD-er
Core team member
Posts: 8810
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Moisture Sensor from BeFlE

#12 Post by TD-er » 29 Sep 2023, 15:50

As mentioned in the link posted by Ton: https://espeasy.readthedocs.io/en/lates ... #p047-page
It should be in all "Collection" builds and also the "Climate" build.

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#13 Post by sptotal » 29 Sep 2023, 16:12

So the build ESP_Easy_mega_20230822_collection_C_ESP8266_4M1M.bin would be the right one?

It's a little bit difficult if you are new to EspEasy...

TD-er
Core team member
Posts: 8810
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Moisture Sensor from BeFlE

#14 Post by TD-er » 29 Sep 2023, 16:25

Yep, any "collection" would be OK.
Just have a look at any other plugin you may also need to see if "collection_C" would be the best choice for you.
See: https://espeasy.readthedocs.io/en/lates ... al-plugins

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#15 Post by sptotal » 30 Sep 2023, 12:09

I how flashed the Collection_C Firmware and configured BeFIE Sensor AS device. SDA: GPIO-4 (D2) and SCL: GPIO-5 (D1) but I get no readings. Voltage of the sensor ist connected correctly to 5V of the Wemos D1 mini.
20230930_120837.jpg
20230930_120837.jpg (2.96 MiB) Viewed 5324 times
What ist going wrong? How can I debug it?

TD-er
Core team member
Posts: 8810
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Moisture Sensor from BeFlE

#16 Post by TD-er » 30 Sep 2023, 12:46

Can you see it as an I2C device in the I2C scan? (tools page)

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#17 Post by sptotal » 30 Sep 2023, 14:20

Thank you. I2C scan Said "No devices". I reattached the cable and now it's measuring without resoldering. Values are a bit off, i.e. temperature about +6°C. Moisture weg is around 140 which should be 100 as maximum.

Is it possible to calibrate the Sensor via ESP Easy? I have a few "Trübner SMT50" soil moisture sensors which are really good (precise out of the box) but expensive, too.

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#18 Post by Ath » 30 Sep 2023, 14:55

sptotal wrote: 30 Sep 2023, 12:09 Voltage of the sensor ist connected correctly to 5V of the Wemos D1 mini.
I'd suggest to connect the sensor to 3.3V, as the GPIO pins of the ESP are not really specified for 5V, though there are some ppl using that all the time, it's still not advised.
sptotal wrote: 30 Sep 2023, 14:20 Values are a bit off, i.e. temperature about +6°C. Moisture weg is around 140 which should be 100 as maximum.

Is it possible to calibrate the Sensor via ESP Easy? I have a few "Trübner SMT50" soil moisture sensors which are really good (precise out of the box) but expensive, too.
The only calibration available in this plugin is the Formula field, next to the Values names. For Temperature it's usually enough to subtract the desired offset, but I don't know how linear the Moisture reading is, so maybe you can get calibration values from another, more accurate, device when measuring close to this sensor? You should then be able to derive a formula from that data.
/Ton (PayPal.me)

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#19 Post by sptotal » 01 Oct 2023, 10:56

3.3V instead of 5V seems to be the solution. Now I have really consistent readings which seems to be true if nothing changes.

Thank you for the fast good support ;)

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#20 Post by Ath » 01 Oct 2023, 13:06

Great!

Thanks for the feedback :)
/Ton (PayPal.me)

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#21 Post by sptotal » 01 Oct 2023, 21:07

Is it possible to use multiple BeFIE moisture sensors with one Wemos D1 mini? Each Sensor gets it's own I2C adress and all of them connected to the same GPIO pins.

Or is only one sensor of one type supported by the firmware?

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#22 Post by Ath » 01 Oct 2023, 21:11

Multiple sensors can be configured and work at the same time but I'm not (really) sure if they keep their manually set I2C address, as there doesn't seem to be a 'save' operation available.
That would make restarting the unit after power-loss rather cumbersome.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8810
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Moisture Sensor from BeFlE

#23 Post by TD-er » 01 Oct 2023, 21:34

Or you could try using an I2C multiplexer.
Then the multiplexer output determines what sensor is addressed.

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#24 Post by sptotal » 02 Oct 2023, 13:52

I just tried: If you change the I2C address by ESP Easy then this will be a permanent setting for the BeFIE. Running two sensors on one Wemos D1 mini on different addresses the address change will be permanent and survive a reboot (or cut off voltage).

GREAT :D

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#25 Post by Ath » 03 Oct 2023, 15:07

That's great :)
I'll try to keep that knowledge in memory, but that may be hard :?

The I2C address can be chosen freely between 0x01 and 0x7F for this sensor, but when connecting many (> 5) of them you should remove the 10k pull-up resistors from all but 1 board, to avoid overloading the I2C bus with too low pull-up resistance. When connecting other I2C devices you should avoid the address(es) used there. And your I2C scan (Tools page) may look weird, reporting completely different devices than actually connected :lol:
And of course you are limited to the number of tasks (Devices) on your ESP (max. 12 tasks on ESP8266, max. 32 tasks on ESP32).
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8810
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Moisture Sensor from BeFlE

#26 Post by TD-er » 03 Oct 2023, 20:12

Ath wrote: 03 Oct 2023, 15:07 That's great :)
I'll try to keep that knowledge in memory, but that may be hard :?
[...]
If only we had some way to document specific info about plugins...

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#27 Post by Ath » 03 Oct 2023, 21:14

TD-er wrote: 03 Oct 2023, 20:12 If only we had some way to document specific info about plugins...
Fixed that... #4837
/Ton (PayPal.me)

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#28 Post by sptotal » 07 May 2024, 10:04

There will be a new low power version of the BeFlE Somose sensor released. This sensor needs new logic to work.

Can anybody please tell me how to adjust the code of the P047 module to get the new sensor working?


Here are the changes of the Arduino implementation of the new sensor:
SoMoSe_Arduino.h https://github.com/BeFlE/SoMoSe/compare ... c2eedd3058
SoMoSe_Arduino.cpp https://github.com/BeFlE/SoMoSe/compare ... e18df48646
SoMoSe_Arduino.cpp https://github.com/BeFlE/SoMoSe/compare ... 5b156ac281

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#29 Post by Ath » 07 May 2024, 10:32

We're not using the library from BeFlE, (and looking at that code makes me really unhappy, seeing f.e. the inconsistent method naming and the many spelling errors :().

When will that sensor be available? as it looks best & easiest to me to have it added as a new/extra model to the plugin, and integrate the changes within the current code.
You're welcome to create a PR for it, but I can also pick it up, somewhere in the near future.

We have a developers guide available: https://espeasy.readthedocs.io/en/lates ... ormIO.html
/Ton (PayPal.me)

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#30 Post by sptotal » 07 May 2024, 10:45

The new sensor will be released end of May. See https://github.com/BeFlE/SoMoSe/issues/ ... 2096156495

I am really on the lowest level of programming concerning hardware in EspEasy. I only know the basiscs of rules to control my ESP :oops:

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#31 Post by Ath » 09 May 2024, 17:46

I've created pull request #5049 to add support for the new BeFlE v3.x hardware, based on the updated code in the BeFlE SoMoSe repository

@sptotal I haven't planned to order the new sensor, but I assume you are ordering one. Can you test the code from the PR on the actual hardware? Download binaries from this Github Actions run. (You can only download when logged in with a Github account.)
/Ton (PayPal.me)

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#32 Post by sptotal » 13 May 2024, 09:45

@Ath Thank you very much for the pull request. I would like to test it but I am not able to get it running and to select the new BeFlE sensor.

I successively flashed the following Binaries and am not able to select BeFie v3.x:

1) ESP_Easy_mega_20240509_climate_ESP8266_4M1M.bin
2) ESP_Easy_mega_20240509_collection_D_ESP8266_4M1M.bin
3) ESP_Easy_mega_20240509_collection_C_ESP8266_4M1M.bin


I can only select the following soil moisture sensors:
Sensors.jpg
Sensors.jpg (12.49 KiB) Viewed 585 times

What am I doing wrong?

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#33 Post by Ath » 13 May 2024, 09:49

Ah, that's because of the limitations for binary size, then the later added sensors (Adafruit and the new BeFlE v3) are excluded :o

I'll create a custom build for you, and upload it here later today (I'm not near my ESPEasy development system ATM :?)

Are there other plugins required for your build to be usable?
/Ton (PayPal.me)

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#34 Post by sptotal » 13 May 2024, 09:55

I only need the BeFlE Somose v2.2, v3.x , the Analog input - internal and MQTT/WiFi connection.

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#35 Post by Ath » 13 May 2024, 10:59

What MQTT Controller?
/Ton (PayPal.me)

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#36 Post by sptotal » 13 May 2024, 11:06

That's the MQTT Controller:
MQTT.jpg
MQTT.jpg (16.53 KiB) Viewed 554 times

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#37 Post by Ath » 13 May 2024, 20:57

Here's a Custom build with the new P047 - Environment - Soil moisture sensor with support for the BeFlE v3.x hardware
/Ton (PayPal.me)

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#38 Post by sptotal » 13 May 2024, 23:35

You are so great, now I can choose BeFlE v3.x ;)

But I can not read any values. I2C scan says 0x01 is connected and if I disconnect the v3.4 sensor then there's no result in I2C scan.

Without option "Force Slow I2C speed": no value and no log entry.

With option "Force Slow I2C speed" I always get the following error in log:
SoilMoisture: Bad Reading, resetting Sensor...
No value from the sensor, too.

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#39 Post by Ath » 14 May 2024, 08:38

A few questions:
- How long are the wires to your sensor?
- Do you have pull-up resistors installed on the SDA and SCL lines?
- You didn't swap the SDA and SCL wires? (no harm, but won't work)
- Was the sensor used by someone else before you got it, and reprogrammed it to I2C Address 0x01?
- I assume you changed your config to use 0x01 as the address, but you can reconfigure it to something else, by setting the checkbox "Change Sensor Address", and filling the desired hexadecimal value for the new address (0x55 ?) and saving the settings. On next start (immediately if the task is enabled) it will be updated. (Fixed it in this PR as it has a bug in the current release version :o)
/Ton (PayPal.me)

sptotal
Normal user
Posts: 14
Joined: 29 Sep 2023, 15:44

Re: Moisture Sensor from BeFlE

#40 Post by sptotal » 14 May 2024, 09:26

- The sensor has original cable length as it was on SoMoSe v2.2 with total length of 60cm.
- I can not detect any pull-up resistor on SDA/SCL.
- SDA (D2) and SCL (D1) are connected correctly in same order as the "old" SoMoSe v2.2.
- The sensor is a prototype which was send me from the inventor of this soil moisture sensor. He has developed the Arduino code and it should work.
- I did not change the address to 0x01, it was originally this value. Maybe it's wrong as changing the address does not work, too. After changing address to 0x15, I2C scan always reports 0x01 only.

I2C scan does not recognize the supported device.

User avatar
Ath
Normal user
Posts: 3607
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Moisture Sensor from BeFlE

#41 Post by Ath » 14 May 2024, 09:51

I2C Scan should at least list the address, the device names may be excluded, not sure if these names are included in the Custom build.
You can enter the found address in the I2C Address field, but I assume you already tried that.
Adding a 10k pull-up to 3V3 on both SDA/SCL should fix the pull-up state.

To me it feels like the hardware wasn't programmed as intended, I assume BeFlE/SoMoSe can help you identify the status of the device, hopefully they have a Reset to factory defaults-procedure...
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests