I2C Soil moisture sensor

Moderators: grovkillen, Stuntteam, TD-er

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

I2C Soil moisture sensor

#1 Post by albertobonati » 17 Feb 2017, 11:55

Hi
I use a pair of I2C soil moisture sensors (by Tindle), not supported in device list.
It is possible read data from this device (and maybe others unsupported I2c devices) from ESPEasy in some not many difficult way?
I'll like it very much, now I'm using ESPEasy and Domoticz for my home automation, no problem to interface moisture sensor with Domoticz but the best will be use ESPEasy for this device too.
Best regards
Bonati Alberto

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

Re: I2C Soil moisture sensor

#2 Post by krikk » 28 Feb 2017, 08:36

if you are taking about this sensor: https://www.tindie.com/products/miceuz/ ... re-sensor/

...i have a working plugin ready, still testing it, will try to get it on the official github as soon as possible...

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

Re: I2C Soil moisture sensor

#3 Post by albertobonati » 28 Feb 2017, 17:33

Hi.
Great new, it's my sensor!
Thank you very much, I'm waiting for...
Regards
Alberto

JR01
Normal user
Posts: 260
Joined: 14 Feb 2016, 21:04
Location: South Africa

Re: I2C Soil moisture sensor

#4 Post by JR01 » 03 Mar 2017, 10:33

Hi, looking forward to also use soil moisture sensors.

How good is the capacitance measure version 1. compared to the compared to the 2. 100 MHz signal - "transparant to minerals" version?

1. https://www.tindie.com/products/miceuz/ ... rod_search
2. https://www.tindie.com/products/Power_M ... rod_search
-----------
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.

psy0rz
Normal user
Posts: 232
Joined: 02 Feb 2017, 12:12

Re: I2C Soil moisture sensor

#5 Post by psy0rz » 04 Mar 2017, 20:55

krikk wrote:if you are taking about this sensor: https://www.tindie.com/products/miceuz/ ... re-sensor/

...i have a working plugin ready, still testing it, will try to get it on the official github as soon as possible...
he did it..its in the mega-branch now:)
Please support ESPEasy development via Patreon or buy us a coffee.

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

Re: I2C Soil moisture sensor

#6 Post by albertobonati » 07 Mar 2017, 21:30

Well, I tested this plugin but have problems...
It work, but only a few because after only a I2C read (right values of moisture and temperature ) it lost I2C connection and mus be reset.
I try a lot but always it's the same...

Well...ESP Easy 2.0 is really very nice !!!
This is my first build of ESPEasy with platformIO ...some work need to learn the whole but.. it work!!!

Regards

Alberto

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

Re: I2C Soil moisture sensor

#7 Post by krikk » 07 Mar 2017, 22:32

you have tested your hardware setup with the arduino sample code of the sensor (https://github.com/Apollon77/I2CSoilMoistureSensor) ?

perhaps missing pullup resistors... but difficult to say with this info :)

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

Re: I2C Soil moisture sensor

#8 Post by albertobonati » 08 Mar 2017, 21:39

Well...more informations need...!!
I tested the plugin with a ESP NODEMCU (Amica), SDA and SCL on 4 and 5 GPIO.
I tested another ESP NODEMCU with plugin to be sure problem is't on ESP device.
I added 3.3K pullup resistors on GPIO 4 and 5 but no results.
At first I2C scan tool can see moisture sensor on 0x20 address (default address), but after a first right read of values (temperature, moisture, light) it stop working.
On I2C scan tool I can read "Unknown error at address 0x1", "Unknown error at address 0x2" etc, all address the same.
After an hard reset it work, only a read an then again stop working.
I use other 2 soil moisture devices with Arduino code from Miceuz : https://github.com/Miceuz/i2c-moisture-sensor, all two works fine and send data to Domoticz (I added this to code...).
Maybe you have some idea?
Best regards
Alberto

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

Re: I2C Soil moisture sensor

#9 Post by krikk » 08 Mar 2017, 22:13

i identified a problem in my code today, but i am not sure that this could cause your problem, is in github already...
can you test again with this version... also please post serial console log if possible..

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

Re: I2C Soil moisture sensor

#10 Post by albertobonati » 09 Mar 2017, 22:36

Hi.
I tested last version but it's the same.
This is log:

215712 : WD : Uptime 3 ConnectFailures 0 FreeMem 21944
219607 : SoilMoisture: Address: 0x20 Version: 0x23
219607 : SoilMoisture: Temperature: 20.90
219607 : SoilMoisture: Moisture: 247.00
219608 : SoilMoisture: Light: 65535.00
245713 : WD : Uptime 4 ConnectFailures 0 FreeMem 21944
275714 : WD : Uptime 4 ConnectFailures 0 FreeMem 21944
279398 : SoilMoisture: Bad Version, no Sensor?
305828 : WD : Uptime 5 ConnectFailures 0 FreeMem 21920
336108 : WD : Uptime 5 ConnectFailures 0 FreeMem 21920
340111 : SoilMoisture: Bad Version, no Sensor?

I will test plugin with ESP8266-01.

Regards
Alberto

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

Re: I2C Soil moisture sensor

#11 Post by krikk » 10 Mar 2017, 12:23

i have a clue what may be the problem... my code sends the sensor to sleep after reading, accorting to this https://github.com/Apollon77/I2CSoilMoi ... r/issues/8 this may cause the problem, will update the code soon...

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

Re: I2C Soil moisture sensor

#12 Post by krikk » 10 Mar 2017, 19:08

submitted a new pull request: https://github.com/letscontrolit/ESPEasy/pull/150 ...with this version you can disable the sleep and the version check, try to disable both and post you results, set your log level to debug before plz

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

Re: I2C Soil moisture sensor

#13 Post by albertobonati » 10 Mar 2017, 22:02

Hi.
Now it work fine, it work fine with "Check sensor version" enabled too...
Now I will chech your plugin with ESP8266-01 and 3 sensors....
Thank you very much for your work, it's really nice!
This moisture device is ok, it's cheap enaught and reliable enough...only some problem with calibration, best will be a 0-100 or a 0-10 moisture scale, I did it with formula value, maybe it can be integrate in your plugin with min-moisture and max-moisture values to change on-air....

Well...You did really a great work for me, many thanks!!

best regards

Alberto

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

Re: I2C Soil moisture sensor

#14 Post by albertobonati » 12 Mar 2017, 21:24

Hi.
I tested soil moisture plugin with ESP-01 and 3 soil moisture device and it's ok.
But I have an other problem, it don't send data to Domoticz http controller.
It seem to be a plugin problem because I try to send data with other devices (dummy device and analog device and have no problem).
IDX value and enable check are ok.

Log level 3 say:

1065590 : FILE : File saved
1073223 : FILE : File saved
1073377 : FILE : File saved
1085362 : SoilMoisture: Address: 0x20
1085362 : SoilMoisture: Temperature: 11.30
1085363 : SoilMoisture: Moisture: 358.00
1085363 : SoilMoisture: Light: 6732.00
1085387 : HTTP : connecting to 192.168.1.140 using port 8080
1085397 : HTTP : Success
1085410 : HTTP : closing connection

Log level 4:

1166668 : Content-Length: 24
1166670 : Content-Type: application/json;charset=UTF-8
1166671 : Cache-Control: no-cache
1166672 : Pragma: no-cache
1166673 : Access-Control-Allow-Origin: *
1166675 :
1166676 : {
1166677 : "status" : "ERR"
1166678 : }
1166679 : HTTP : closing connection

Best regards
Alberto

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

Re: I2C Soil moisture sensor

#15 Post by krikk » 12 Mar 2017, 22:43

the Domoticz http controller does not support SENSOR_TYPE_TRIPLE till now, did a pull request to fix that :) plz test, because i do not have Domoticz

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

Re: I2C Soil moisture sensor

#16 Post by albertobonati » 13 Mar 2017, 21:32

Hi.
New release v2.0.0-dev6 fixed this bug...
Now I'm testing plugin on ESP-01 with 3 soil moisture device and two controllers (Domoticz HTTP and Thingspeack) and it seem to work like a charme!
I'm testing the whole on my system and will report in a few days.
I'm using this formula value for 1-100 moisture scale:
100/(600-280)*(%value%-280)

Regards
Alberto

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

Re: I2C Soil moisture sensor

#17 Post by albertobonati » 14 Mar 2017, 13:49

Hi.
Now I'm trying to use ESPEasy plugin with battery powered ESP-07 and sleep mode, I have one with Arduino code and work fine.
I see on device setting "Send sensor to sleep:" check and "Sleep enabled:" on config page.
I used the second one in some test with ESP-07 and work fine, have I to check "Send sensor to sleep:" too?
How "Send sensor to sleep:" can sleep moisture device? I need to connect some other than GND, V+, SDA and SCL ?
Thanks
Alberto

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

Re: I2C Soil moisture sensor

#18 Post by krikk » 14 Mar 2017, 16:26

device setting "Send sensor to sleep:" -> this setting only affects the i2c soil moisture sensor: the newer version of the sensor can "sleep" till next request, if you enable this, we will send the sleep command to the sensor after reading ist

the "Sleep enabled:" on config page... is a completly different setting, this enable/disables deepsleep mode of the complete esp8266... details see here https://www.letscontrolit.com/wiki/index.php/SleepMode

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

Re: I2C Soil moisture sensor

#19 Post by albertobonati » 14 Mar 2017, 16:31

Hi, do you know what moisture device version support sleep mode?
Thanks
Alberto

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

Re: I2C Soil moisture sensor

#20 Post by krikk » 14 Mar 2017, 16:50

sleep is supported since:
FIRMWARE_VERSION 0x23 //2.3

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

Re: I2C Soil moisture sensor

#21 Post by albertobonati » 18 Mar 2017, 23:19

Hi
My little report about Soil Moisture plugin.
I have 2 sensors with an ESP-01 board, ESP Easy mega dev6, they works since a week with no problem.

I'm working with a battery powered ESP-07 board too, I have no problem to send the board in deep sleep but I've tryed to send moisture device in deep sleep too but don't work.
I think soi moisture version is right :
192.168.1.110 Mar 18 22:22:06 ESP kern debug Unit 0 : SoilMoisture: Address: 0x21 Version: 0x23
and data read are right too:
192.168.1.110 Mar 18 22:18:22 ESP kern debug Unit 0 : SoilMoisture: Address: 0x21 Version: 0x23
192.168.1.110 Mar 18 22:18:22 ESP kern debug Unit 0 : SoilMoisture: Temperature: 20.50
192.168.1.110 Mar 18 22:18:22 ESP kern debug Unit 0 : SoilMoisture: Moisture: 314.00
192.168.1.110 Mar 18 22:18:22 ESP kern debug Unit 0 : SoilMoisture: Light: 65535.00
but after this:
192.168.1.110 Mar 18 22:18:22 ESP kern debug Unit 0 : SoilMoisture->sleep
192.168.1.110 Mar 18 22:19:20 ESP kern debug Unit 0 : SoilMoisture: Bad Version, no Sensor?
system don't recognize device and crash...after hard reboot system don't work at all and need to reflesh !!

Maybe put soil moisture sensor in deep sleep can help to sxtend battery life...

Best regards
Alberto

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

Re: I2C Soil moisture sensor

#22 Post by krikk » 19 Mar 2017, 09:19

but after this:
192.168.1.110 Mar 18 22:18:22 ESP kern debug Unit 0 : SoilMoisture->sleep
192.168.1.110 Mar 18 22:19:20 ESP kern debug Unit 0 : SoilMoisture: Bad Version, no Sensor?
system don't recognize device and crash...after hard reboot system don't work at all and need to reflesh !!
...normally a full power cycle should recover the sensor, have you tested this?

seems to me like you have the same issue like reported over here: https://github.com/Apollon77/I2CSoilMoi ... r/issues/8 ...a currently only have a v0x22 sensor for testing

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

Re: I2C Soil moisture sensor

#23 Post by albertobonati » 19 Mar 2017, 21:19

Hi
I have this problem if sleep only moisture sensor too:
Message: 0 : SoilMoisture: Bad Version, no Sensor?
Sensor don't awake after sleep...

Bui in this case I can reboot ESP and it work.

This with ESP-07, ESPmega dev.07, SDA and SCL in GPI0 4 and 5 with pull up resistors.

What's your configuration in sleep mode for soil miosture sensor?

Regards

Alberto

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

Re: I2C Soil moisture sensor

#24 Post by krikk » 22 Mar 2017, 21:36

fetched my v0x23 sensor from my "garden" to test this sleep problem out, and yeah i could reproduce it... and even better it is fixed with this pull request:

https://github.com/letscontrolit/ESPEasy/pull/178

so give it a try, sleep mode now works for me as expected

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

Re: I2C Soil moisture sensor

#25 Post by albertobonati » 24 Mar 2017, 22:12

Hi
Now it work for me too..it's great because ESP drain 1.20 mA with moisture sensor and ESP in sleep mode and 9.5 mA with only ESP in deep sleep...
I think it's really good for battery powered devices!

There is a strange thingh I notice, if I don't link RST and GPIO16 for deep sleep, ESP don't send message:
Deep sleep canceled by GPIO16(D0)=LOW.
as usually do
but system enter in deep sleep:
Message: 0 : Entering deep sleep...
Message: 0 : EVENT: System#Sleep
after this, system don't wake up, I see a 14 mA drain and no more.
All is OK after restart and GPIO16 and RST link.
Now I will start field test and will report.
Thanks a lot and best regards
Alberto

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

Re: I2C Soil moisture sensor

#26 Post by bobbybeans » 22 May 2017, 13:03

Hey guys I just bought a i2c moisture sensor off ebay. Mine is actually the 2.4v of the one on tindie. It is the chirp version that you just put a battery in. However it still has the i2c header on it. as its cheaper and if I am buying lots of them it adds up
A few questions about it
I see the default address is 0x20 based on the tindie website, how do I change that? reason I ask I want to buy about 6 of them and hook them all up to an single esp? would that be possible?
I have an herb bed in my window sill that has 6 different boxes and I wanted to monitor them individually then if one of them gets dry I would activate to turn on a servo it would select the right port on a 3d printed water diverter then activate a relay for a pump to pump water into it. and it would do that in tiny spreadable amounts. I 3d printed a square with holes in one side of it and an inlet port for easy even watering

also looking at it this part seems shiny as maybe is has some coating on it, is that good enough to have outside? or I was thinking making a mold and dipping the top half in resin so it seals it jus so the moisture doesn't ruin the circuit.
I know the new version is more accurate in terms of measuring, I'm not really going for accuracy all I need to do is keep the soil moist for plants

finally does anybody know the pinout of this device. the 2.4v only has it labelled "isp" is the layout the same as what's display on the tindie page of the 2.7 version?

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

Re: I2C Soil moisture sensor

#27 Post by albertobonati » 22 May 2017, 13:35

Hi
You can change device address, look at Tindle documentation section (Address change example).
Maybe you can change address with ESP EASY plugin (last version), I don't try it...

You can monitor all six device with a single ESP8266 board , I have 3 of then and works fine.

I have enclosed my device in epossidic resin (body) and painted the part to be fitten in soil with poliester painting.
I find this solution the better after some other attemps.

Regards
Alberto

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

Re: I2C Soil moisture sensor

#28 Post by krikk » 22 May 2017, 15:44

the chirp sensor (https://www.tindie.com/products/miceuz/ ... ing-alarm/) is not the same than the soil moisture sensor (https://www.tindie.com/products/miceuz/ ... re-sensor/), so not sure if my espeasy plugin works for the chirp... please give feedback if its the case... for the normal i2c soil moisture sensor adress change is supported in the latest version...

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

Re: I2C Soil moisture sensor

#29 Post by bobbybeans » 23 May 2017, 16:40

Hey thanks for both of the reply it gives good insight

Kirk
I am a bit confused as to why you say its different? by looking at both of them it looks to be the same general layout of parts with LEDs resistors and I THINK the same chip. I can't see the exact chip model from the pictures. The one on my chirp v2.4 is a atmel1653 i believe . can someone tell me what chip is on their sensor only one? obviously the chip has a battery and speaker.
Mine also has a SPI interface so i would assume i can set it up?
Worst case senario is I hook up the chip my soldering little wires on it and reporgram it since this project is opensource.
Based on the documentation from the chirp one this is what it says
"Totally hackable

I’ve made this device to be hackable and open. It’s based on ATTINY44A microcontroller, the code is available on Github (see below). A standart AVR 6 pin ISP programming header is available on the board for programming and for serial communication.

The device acts as a I2C slave, the header can be used to read the moisture and light levels. Another microcontroller or a board such as Arduino can be used as I2C master to read those levels."

So i would assume its the same just with bat and speaker as I said
I will check this out after holiday next week

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

Re: I2C Soil moisture sensor

#30 Post by bobbybeans » 22 Jun 2017, 23:39

hey there sorry to bring up an old thread, I am having trouble compiling i have the latest version of both the plugin and the 2.0r10.
i compile it and everything goes fine, i connect to it then go to devices but its no where listed in the devices. Do I need to uncomment something somewhere?
I have tried reflashing it and redownloading the latest releases of both a couple times. I am on arduino 1.6.2 as well :( any suggestion?
or would you be able to provide a .bin file?
as youll probably see from past posts that ive made i have always struggled with compiling items myself :( however i have gotten better and got it to work a few times out of many

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: 3416
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: 8643
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: 8643
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é

Post Reply

Who is online

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