I2C Soil moisture sensor

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
krikk
Normal user
Posts: 118
Joined: 28 Feb 2017, 07:57
Location: Austria
Contact:

Re: I2C Soil moisture sensor

#31 Post by krikk » 23 Jun 2017, 06:34

the plugin is only in the testing or dev builds, nit in normal builds?

bobbybeans
Normal user
Posts: 119
Joined: 26 Feb 2017, 17:30

Re: I2C Soil moisture sensor

#32 Post by bobbybeans » 23 Jun 2017, 13:37

ahhhh that would explain it... thanks, I shall use those then :)

do you know when it would be moved into regular build?

bobbybeans
Normal user
Posts: 119
Joined: 26 Feb 2017, 17:30

Re: I2C Soil moisture sensor

#33 Post by bobbybeans » 24 Jun 2017, 22:09

1 other question. I was looking on the specs of the pins
pin 1 - MISO
pin 2 - VCC
pin 3 - SCK / SCL – I2C clock
pin 4 - MOSI / SDA – I2C data
pin 5 - RESET
pin 6 - GND

does this mean i can put it on either sck and mosi or scl and sda, in pairs??

krikk
Normal user
Posts: 118
Joined: 28 Feb 2017, 07:57
Location: Austria
Contact:

Re: I2C Soil moisture sensor

#34 Post by krikk » 24 Jun 2017, 22:52

bobbybeans wrote: 24 Jun 2017, 22:09 pin 2 - VCC
pin 3 - SCK / SCL – I2C clock
pin 4 - MOSI / SDA – I2C data
pin 6 - GND
only these 4 pins are needed if you connect it via i2c bus, the other pins are only needed for reprogramming the sensor as far as i know...

savage7
New user
Posts: 2
Joined: 17 Aug 2017, 14:34

Re: I2C Soil moisture sensor

#35 Post by savage7 » 17 Aug 2017, 22:20

I flashed Release v2.0.0-dev11 and the current github code on a wemos d1 mini. I successfully added the sensor and it reads all values correctly.
After some time the sensor stops working and i get this log:
"SoilMoisture: Bad Reading, resetting Sensor..."

On the i2c Scan Page I get:
Unknown error at address 0x1
Unknown error at address 0x2
...

The only thing that works it to power cycle, rebooting doesn't work. :cry:

Any Idea what could be wrong?
Any logs that could help debugging?

krikk
Normal user
Posts: 118
Joined: 28 Feb 2017, 07:57
Location: Austria
Contact:

Re: I2C Soil moisture sensor

#36 Post by krikk » 18 Aug 2017, 09:40

this is a known issue that i also have from time to time... see here for details... my workaround is to disable sleep mode for this sensor, then it does not happen that often, i also have a relay on my i2c powerline to solve this issues :)

savage7
New user
Posts: 2
Joined: 17 Aug 2017, 14:34

Re: I2C Soil moisture sensor

#37 Post by savage7 » 24 Aug 2017, 12:33

I have set the I2C ClockStretchLimit to 50000 now the sensor works stable for 3 days.

spachal
Normal user
Posts: 55
Joined: 22 Feb 2018, 22:11

Re: I2C Soil moisture sensor

#38 Post by spachal » 24 Feb 2020, 20:56

Hi, sorry for opening an old thread, but is there any news about soil moisture sensors? I found that in DEV MEGA version is this plugin still "TESTING", is it usable now? I'd like to use three sensors for my home plants, I2C communication.
So I have a few questions:

- I'd like to support developers, but their products on tindie are 10x more expensive that on Aliexpress. Are these the same sensors? (https://www.aliexpress.com/item/32842054964.html)
- couId I use the version of sensor with battery slot and speaker, with espeasy plugin?
- is it really possile to change I2C address for these sensors (one byte to register 1, how to do that)? I want to connect 3pcs on one ESP8266 (I2C), but it can be possible only in the case of diffrent addresses, I guess ..
- is it possible to power up these sensors from I2C (VCC+GND) 3.3V, or there is need to have CR2032 battery plugged?

Thanks for info! :]
Please excuse my English, thanks!

krikk
Normal user
Posts: 118
Joined: 28 Feb 2017, 07:57
Location: Austria
Contact:

Re: I2C Soil moisture sensor

#39 Post by krikk » 24 Feb 2020, 21:24

i only have the original version from tindie, and the plugin is usable, had it in outdoor use for more than a year...

about the aliexpress sensor: just found this pull request: https://github.com/Apollon77/I2CSoilMoi ... or/pull/19 <-- this seems to indicate that the cheap chirp sensor also can be used with the arduino library, so if you merge back the changes of this pull request into the espeasy plugin it may be possible that it works...

yes you can change the adress, had 5 sensors in use with one esp8266, so no problem, as i see the code of chirp it also supports it (https://github.com/Miceuz/PlantWatering ... src/main.c)

i am pretty sure you don't need the cr2032 if you have power connected...

but be aware that you need to waterproof the sensor (i used epoxy resin, but not to much like me :) ...and also don't use to long cables, had 5 sensors with more the 15 m cable lenght, was a bit problematic for me...

krikk
Normal user
Posts: 118
Joined: 28 Feb 2017, 07:57
Location: Austria
Contact:

Re: I2C Soil moisture sensor

#40 Post by krikk » 24 Feb 2020, 21:25

all my posting above asumes that the aliexpress sensor, behaves like the original chirp, which still has to be tested :)

spachal
Normal user
Posts: 55
Joined: 22 Feb 2018, 22:11

Re: I2C Soil moisture sensor

#41 Post by spachal » 24 Feb 2020, 21:39

Yep, I understand that, but all posts were from 2017, so I was curious if there is something new :]
So thanks for quick info, I really appreciate it! The easyest way is to buy some pieces and test it, these ones from AE are cheap enough :]. And of course I'll try to make it waterproof, probably with shrinkable tubing and silicone, I don't have any resin available :]
Please excuse my English, thanks!

rieders
Normal user
Posts: 22
Joined: 13 May 2018, 09:09

Re: I2C Soil moisture sensor

#42 Post by rieders » 27 Apr 2021, 12:19

Hello
I'm trying to connect the Plant Watering Alarm Sensor to a Wemos D1.
Unfortunately, the i2c scan does not show any device. do I still have to flash the sensor?
If so, does someone have a suitable hex file?
I use a "my smartUSB light" stick for flashing.

I hope someone can help me.
Don't let my plants dry out in the greenhouse.

Greetings André

albertobonati
Normal user
Posts: 40
Joined: 13 Dec 2016, 15:25

Re: I2C Soil moisture sensor

#43 Post by albertobonati » 27 Apr 2021, 12:57

Hi
You have to use D4-D8 pins for SDA-SCL, these pins have 10K pull-up resistors
Regards

rieders
Normal user
Posts: 22
Joined: 13 May 2018, 09:09

Re: I2C Soil moisture sensor

#44 Post by rieders » 28 Apr 2021, 13:02

Hello
Thank you for your reply.
I have now with D8-SDA and D4 SDL under i2c scan Unknown error at address 0x1 to Unknown error at address 0x7F.
Do I have to change the speed of the bus?

Many thanks for the help
André

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

Re: I2C Soil moisture sensor

#45 Post by Ath » 28 Apr 2021, 13:12

Since a couple of months the I2C scan is done with the low I2C speed, as configured. It can help to add 10k pull-up resistors between SDA and 3V3 and between SCL and 3V3, if not already mounted (some sensors have them pre-installed).
/Ton (PayPal.me)

rieders
Normal user
Posts: 22
Joined: 13 May 2018, 09:09

Re: I2C Soil moisture sensor

#46 Post by rieders » 29 Apr 2021, 13:49

Hello everybody

I have now added a 10K Ohm resistor for each SDA SCL on the sensor.
Unfortunately I have no connection with it either.
My sensor is this https://wemakethings.net/chirp/
.
When I run the example code on an Arduino Mega I get values.

So the sensor seems to go by itself.

I get 1 as the firmware version.

greetings
André

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

Re: I2C Soil moisture sensor

#47 Post by TD-er » 29 Apr 2021, 14:11

At what voltage is the sensor running?
Maybe if it is powered at 5V, the I2C signal levels are too low to ever been seen as a '1' ?

It does not show up in an I2C scan on ESPEasy?

Are you absolutely sure you have the same pins assigned to I2C (SDA/SCL) in the Hardware tab as you try to use to connect your sensor?

rieders
Normal user
Posts: 22
Joined: 13 May 2018, 09:09

Re: I2C Soil moisture sensor

#48 Post by rieders » 30 Apr 2021, 13:32

Hello
Many thanks for the answer.
Unfortunately, I don't get a device displayed under i2c scan.
I've tried with d1 and d2 pin.
I haven't had any success with d4 and d8 pin either.
10 kOhm resistors are soldered.

Now I have connected an i2c display to d1 and d2 for the test.
The display was recognized without any problems.
It did not work on ports d4 and d8.

I'm slowly getting stuck.

greetings
André

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

Re: I2C Soil moisture sensor

#49 Post by TD-er » 30 Apr 2021, 14:01

The pins you used to connect the display should be the ones to use for your other sensor.

I did notice on the photos of the sensor that it can operate in I2C as well as SPI mode.
Do you need to set some pin or jumper to switch between these modes?
How did you connect it for your initial test with the Mega microcontroller?

The only thing I can imagine is that the Arduino Mega is a 5V unit, so therefore I asked about the supply voltage used on the sensor.
What voltage do you use to power the sensor?
How are the pull-up resistors soldered? Between the SDA and + of your power supply I assume (and SCL and +), but if you power the sensor with a higher voltage than 3.3V, you may run into a number of issues, among which is damaging any other sensors connected to the same I2C bus...

rieders
Normal user
Posts: 22
Joined: 13 May 2018, 09:09

Re: I2C Soil moisture sensor

#50 Post by rieders » 30 Apr 2021, 17:56

I only applied 3.3v voltage to the sensor.
Actually, after supplying the sensor with voltage, it should recognize whether the I2C bus is present.
If so, the bus will do. If not, it goes into stand alone mode.
But I don't know whether the firmware on the Attiny 44 supports it.
It seems to work with the Arduino Mega.
I will do tests again. Maybe I can still get it to work.
I would like to use this sensor because it delivers 3 values that are important for plant growth.

greetings
André

Patou
Normal user
Posts: 106
Joined: 21 May 2018, 10:33

Re: I2C Soil moisture sensor

#51 Post by Patou » 20 May 2021, 01:26

Hello André,
I am really interested in your moisture sensor.
Did you manage to make it work ?
Patou

rieders
Normal user
Posts: 22
Joined: 13 May 2018, 09:09

Re: I2C Soil moisture sensor

#52 Post by rieders » 20 May 2021, 14:30

Hello
I was able to use part of the sensor.
Unfortunately, the gloss wasn't read correctly.
The other problem was that I couldn't reliably integrate the sensor.
First I have to press the button several times. It seems more of a coincidence than a methodology.
Maybe there is firmware for the sensor that "only" transmits the measured values.
I don't need the button, battery holder and buzzer.

I hope I could go on with you.
Greetings André

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 73 guests