BeFlE / SoMoSe

Soil Moisture Sensor
21 stars 6 forks source link

Initialization time of ~600ms #10

Open andyfr opened 1 year ago

andyfr commented 1 year ago

Hi, I want to build a battery powered moisture sensor with an ESP32. As it is battery powered I'm putting the ESP32 into deep sleep and power it up once every hour to save energy. I noticed that the sensor needs roughly 600 ms after powering up, before it measures any useful data. I'm using the I2C protocoI to measure the values. I would like to reduce the time to save more energy.

Are the 600ms by design, or am I doing something wrong?

BeFlE commented 1 year ago

Hi,

the sensor needs some time until the first measured value is available. On the one hand, this is because the (slow) CPU has to boot and on the other hand, the oscillating circuit has to stabilize for the measurement. Then the proper measurement has to be done and calculated.

So you don't do anything wrong.

An low-power version, for exactly such purposes, I have already in planning.

Many greetings Christian

FHEMbeta commented 4 months ago

Hi,

the sensor needs some time until the first measured value is available. On the one hand, this is because the (slow) CPU has to boot and on the other hand, the oscillating circuit has to stabilize for the measurement. Then the proper measurement has to be done and calculated.

So you don't do anything wrong.

An low-power version, for exactly such purposes, I have already in planning.

Many greetings Christian

I have bought two of the SoMoSe BeFIE sensors and running them with a solar powered battery on ESP8266. In comparison to a Trübner SMT50 sensor I noticed a really high (around factor 20) power usage of the SoMoSe BeFIE sensor even when the ESP is in deepsleep mode.

Waking up the ESP all 30 minutes to publish the current readings via MQTT continously discharges the 4000mAh Li-Ion battery which is charged by a 0.6W solar panel.

So I decided to power off the sensor in deep sleep with a transistor to get the current draw down. This works ok for some days, but needs more extra logic, wiring and I don't know if it has some drawbacks over time. One point is that after cutting off the voltage and turning it on again, the SoMoSe BeFIE sensor needs about 30-40 seconds to get stable values via 3.3V. Otherwise the results are really unusable with moisture over 100% (while it is absolutely dry - 3% after 40 seconds).

What's the current state of the low-power version? I need a lot of sensor for my outdoor plants so that I can connect them to the automatic watering system. Would like to test if the low power sensor works without modification with battery and solar powered. Would like to connect 5-10 sensors to one ESP8266 with different addresses.

BeFlE commented 4 months ago

Hi,

thanks for your message. The new low power version is currently in production. Production should be completed in a few days/weeks. So the new sensors will be available very soon.

Best regards Christian

FHEMbeta commented 4 months ago

Thanks for your quick reply.

What's the current consumption of the new sensor? Is it possible to get a sample (country DE) for testing purposes?

Elektroarzt commented 4 months ago

I just made a housing and some periphery for the v2.2 sensor. Will the new version be backwards compatible in form / fit / function?

FHEMbeta commented 4 months ago

@Elektroarzt Can you please upload the STL files? Would bei great.

Elektroarzt commented 4 months ago

I thought about publishing it. At the moment it's beta. Give me some time to test the solution indoors and outdoors and check compatibility with the new SoMoSe (V3.0?). Will be with step-down 5...40V and epoxy sealed electronics. Here a little teaser:

image

FHEMbeta commented 4 months ago

Please publish, it looks really nice.

I soldered the wires and finished with some fluent plastic (called Microdip). But ist's much more work than printing a 3D file and doesn't Look as nice as your solution.

You could declare the file as Beta and update it on ThingIverse as soon as progress continues.

BeFlE commented 4 months ago

Hi,

the PCB of the new version is 99% compatible with version 2.2, only the upper holes are different. I have just uploaded the new .stp file. Otherwise, the new version is completely backwards compatible with the old version.

About the power consumption: In continuous mode, the sensor requires approx. 2.2mA. In low power mode it requires approx. 800uA (standby) and 1mA (measurement). I am still working on this at the moment.

For comparison, the v2.2 requires approx. 25mA.

For samples please write me an e-mail to info@befle.de, I think I can spare a prototype ;)

Best regards Christian

Elektroarzt commented 4 months ago

@BeFlE: Thanks for the information, that's good news :grinning: @FHEMbeta: Concerning the housing, it is tailored to some components I use for mains power supply (e.g. ESP32-C3 Supermini, buck converter, etc.). So it will not fit for your Devboard nor a battery pretty sure. Are you fixed on a special board? If not, we could do some development on teamwork for a SoMoSe companion project. I would fork the project and you could bring in your insights of a battery version. I could bring in my mains power supply version including the 3D design of a housing. What do you think? I'm also tinkering on a water valve system with flow meters for irrigation.

Sorry for spamming this issue off topic, we should move this conversation asap.

BeFlE commented 4 months ago

Just a little update: I have now preferred to deal with the LowPower mode again. The standby consumption could be reduced to 16uA.

Elektroarzt commented 4 months ago

Do you have a release date for the V3 hardware? I'm very looking forward to it

BeFlE commented 4 months ago

Production is expected to be completed by the end of calendar week 20. Orders can then be placed by e-mail. It is expected to be available on Amazon from the end of May.

Elektroarzt commented 4 months ago

Will your ESP32 firmware support deep sleep to have the whole system energy saving beside the 16uA of the sensor?

BeFlE commented 4 months ago

Currently, deep sleep is not yet supported. However, it is in progress and will be done next.

Elektroarzt commented 3 months ago

@FHEMbeta: the whole project including housing and a system PCB maintaining an ESP32 is released under this Link

FHEMbeta commented 3 months ago

@Elektroarzt Really great project! I am really looking forward to the battery powered version (with solar?), as I have a lot of plants without a power connection next to it.

Elektroarzt commented 3 months ago

I think solar powering is not suitable for ESP32 in Central European regions with small solar panels that fit to the sensor size. I am tinkering on a battery version with Qi charging possibility to keep the water resistance.

BeFlE commented 3 months ago

I think that should work. At least it does mathematically, with long pauses between measurements and MQTT transmissions. I already have a circuit in design, prototype currently in production, consisting of solar energy harvester, LIR2450 battery, energy-saving buck converter and ESP32-C3. Calculated total consumption <100 microamperes in standby, average 300mA for 5 seconds during measurement and transmission. This results in a total consumption of approx. 40mWh per day with 1 measurement per hour. This can be compensated for with a small solar cell.

Elektroarzt commented 3 months ago

That sounds great, really looking forward to it.

FHEMbeta commented 3 months ago

I think that should work with a small solar cell powered, too.

I am running multiple ES8266 boards waking up every 30 minutes, measuring, publish via MQTT and deep sleep. They are continously 100% charged.

I tested an ESP32-C6 (very low consumption in deep sleep) with the new v3.4 sensor. But I am really getting non consistent results, no results from the sensor or it stops working. Maybe the ESP32-C6 is currently not really stable supported. Debugging via Arduino serial monitor does not work (sadly Windows 11). Reading firmware and hardware version is very unreliable.

@BeFlE Could you please publish a PCB + housing with a 18650 or 21700 Li-Ion cell and mini solar cell? That should run forever.

BeFlE commented 3 months ago

@FHEMbeta That is the intention. However, I have decided on the LIR2450 Li-Ion cell for the time being, as I want to save as much space as possible. I think this cell should provide enough of a buffer to bridge longer periods of unsunny weather. But only the tests will show that when the prototypes arrive.

FHEMbeta commented 1 month ago

@BeFlE Any updates on your project with the Li-Ion cell? I would like to buy multiple sensors and put each in a small case with battery (+solar) that run independently, My current setup with IP65 cases is not really nice, too big and impractical. Placing the sensors with a small footprint would be really nice (for example on the balcony in small boxes, vegetable patch, bananas and palm trees).

BeFlE commented 1 month ago

Hi,

The project is going quite well, I have been testing the hardware for about 2 months and it has worked without any problems so far. Unfortunately, I don't have enough time at the moment to get the whole thing ready for production. The PCB is about 25x45mm in size, the built-in LiIon cell can easily operate several sensors even under bad light conditions. If there is general interest, I can calculate the costs for a small series and have some PCBs produced. Best regards Christian

FHEMbeta commented 1 month ago

Do you have a solar panel, too? Which size does it have?

I am really interested in a small footprint design running without to replace the battery. 3D printing is no problem. A clean PCB without wiring on small room would be really nice.

Do you have some pictures and a little bit more information about this?

Elektroarzt commented 1 month ago

Interested too 😁 I could help in making a compact system from it in Fusion 360 for an easy DIY solution.

Elektroarzt commented 1 month ago

@BeFlE if you could provide a sample, I could develop the companion parts in parallel? Just a thought

FHEMbeta commented 1 month ago

@Elektroarzt Did you made any further tests with a solar powered implementation?

I tested the Somose V3.4 and it seems to have really low consumption with latest firmware. 21700 Li-Ion with a 0.6W solar panel with partial shade is always fully charged. Running on ESP32-C3.

The only problem I have: soil moisture is around always double the value of my Trübner SMT50 sensor (which gives values from 0-50%). How to confirm the values of the sensor?

Elektroarzt commented 1 month ago

No, I built an experimental model on basis of a Li-Ion cell and Qi wireless charging. I plan to use the sensor indoors and I'm not so confident if a solar version will work for me in this case.

BeFlE commented 1 month ago

@FHEMbeta yes of course I also have a solar cell installed, I totally forgot to mention that. At the moment I'm using this, it's a bit smaller than the PCB itself. At the moment it is still connected with cables, later it should be connected by stacking on spring contacts.

Pictures will follow this evening.

I'm also still working on the sensor's firmware and have recently optimized the measurement process to increase the measurement frequency. I still have to test this, but the measured values now seem much more stable and more plausible.

@Elektroarzt Yes, I have a sample that I can spare. But it's not the final version yet.

FHEMbeta commented 1 month ago

@BeFlE Do you know any other retailer to buy this solar panel (is really smaller than the smalles I know from AliExpress)? Estimated delivery time is 13 weeks and have to buy 13 pieces to get a "good" price.

BeFlE commented 1 month ago

@FHEMbeta No, unfortunately I don't know of any distributor who has such or similar cells available. At the moment, however, there are enough in stock and ready for immediate shipment, the delivery time of 13 weeks refers to the manufacturer's subsequent delivery. I know about the annoyance with the high shipping costs, but unfortunately there are very few alternatives in Europe.

P.S. If you are looking for even smaller cells, you will also find them there :)

FHEMbeta commented 1 month ago

You are right, more than enough in stock.

Could you please post all hardware which is necessary for your prototype. I would build 5-10 sensors depending on the total cost of each one.

Do you have STL files for the case fitting with the SM101K07L?

BeFlE commented 1 month ago

You only need my PCB, a LIR2450 Li-Ion cell and a solar cell, and possibly a housing.

Unfortunately I have no further data on the solar cell, only what can be found online. Maybe on the manufacturer's website?

BeFlE commented 1 month ago

As promised, here are the pictures...

PXL_20240731_180429333.jpg

PXL_20240731_180412687.jpg

PXL_20240731_180409143.jpg

Elektroarzt commented 1 month ago

If you could provide the 3d model of the PCBA I would make a first shot of a complete system if you like.

BeFlE commented 1 month ago

@Elektroarzt I have uploaded the 3D model of the PCB. Please note that it is not yet the final version and things may still change.